This commit is contained in:
committed by
Git OBS Bridge
parent
614a20ee4e
commit
750b94deb2
@@ -396,21 +396,24 @@ Index: xen-3.2.1-testing/tools/ioemu/xenstore.c
|
||||
===================================================================
|
||||
--- xen-3.2.1-testing.orig/tools/ioemu/xenstore.c
|
||||
+++ xen-3.2.1-testing/tools/ioemu/xenstore.c
|
||||
@@ -217,6 +217,13 @@ void xenstore_parse_domain_config(int do
|
||||
bdrv_set_type_hint(bs, BDRV_TYPE_CDROM);
|
||||
if (pasprintf(&buf, "%s/params", bpath) != -1)
|
||||
xs_watch(xsh, buf, dev);
|
||||
+ /* if pyhsical put a watch on media-present after creating it */
|
||||
+ if (drv && !strcmp(drv, "phy")) {
|
||||
+ if (pasprintf(&buf, "%s/media-present", bpath) != -1) {
|
||||
+ xs_write(xsh, XBT_NULL, buf, "1", strlen("1"));
|
||||
+ xs_watch(xsh, buf, "media-present");
|
||||
+ }
|
||||
+ }
|
||||
@@ -232,6 +232,16 @@ void xenstore_parse_domain_config(int do
|
||||
fprintf(stderr, "qemu: could not open hard disk image '%s'\n",
|
||||
params);
|
||||
}
|
||||
+ /* if pyhsical CDROM put a watch on media-present after creating it */
|
||||
+ if (type && !strcmp(type, "cdrom") && drv && !strcmp(drv, "phy")) {
|
||||
+ if (pasprintf(&buf, "%s/media-present", bpath) != -1) {
|
||||
+ if (bdrv_is_inserted(bs_table[hd_index + (is_scsi ? MAX_DISKS : 0)]))
|
||||
+ xs_write(xsh, XBT_NULL, buf, "1", strlen("1"));
|
||||
+ else
|
||||
+ xs_write(xsh, XBT_NULL, buf, "0", strlen("0"));
|
||||
+ xs_watch(xsh, buf, "media-present");
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
/* open device now if media present */
|
||||
@@ -418,6 +425,50 @@ void xenstore_record_dm_state(char *stat
|
||||
/* Set a watch for log-dirty requests from the migration tools */
|
||||
@@ -425,6 +435,50 @@ void xenstore_record_dm_state(char *stat
|
||||
free(path);
|
||||
}
|
||||
|
||||
@@ -461,7 +464,7 @@ Index: xen-3.2.1-testing/tools/ioemu/xenstore.c
|
||||
void xenstore_process_event(void *opaque)
|
||||
{
|
||||
char **vec, *offset, *bpath = NULL, *buf = NULL, *drv = NULL, *image = NULL;
|
||||
@@ -437,6 +488,11 @@ void xenstore_process_event(void *opaque
|
||||
@@ -444,6 +498,11 @@ void xenstore_process_event(void *opaque
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -485,7 +488,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/ide.c
|
||||
} IDEState;
|
||||
|
||||
#define BM_STATUS_DMAING 0x01
|
||||
@@ -1405,8 +1406,15 @@ static void ide_atapi_cmd(IDEState *s)
|
||||
@@ -1446,8 +1447,15 @@ static void ide_atapi_cmd(IDEState *s)
|
||||
switch(s->io_buffer[0]) {
|
||||
case GPCMD_TEST_UNIT_READY:
|
||||
if (bdrv_is_inserted(s->bs)) {
|
||||
|
Reference in New Issue
Block a user