diff options
author | Anthony PERARD <anthony.perard@citrix.com> | 2012-10-09 11:08:21 +0100 |
---|---|---|
committer | Anthony PERARD <anthony.perard@citrix.com> | 2012-10-09 11:08:21 +0100 |
commit | c4b92d46aa7d32c4d07143b1d1e10d8c1f785362 (patch) | |
tree | dd918732ed851ee01e2a80e328ca0d88bb7b4159 /tools/libxl/libxl.c | |
parent | 57b80eb6196c475277e706d46a09088a9ba4e86d (diff) | |
download | xen-c4b92d46aa7d32c4d07143b1d1e10d8c1f785362.tar.gz xen-c4b92d46aa7d32c4d07143b1d1e10d8c1f785362.tar.bz2 xen-c4b92d46aa7d32c4d07143b1d1e10d8c1f785362.zip |
libxl: Fix cd-insert with qemu-xen.
If qemu-xen is used as a device model, the command to insert, change or eject a
cdrom will go through QMP. XenStore is still updated even if QEMU will not read
from it.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxl/libxl.c')
-rw-r--r-- | tools/libxl/libxl.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 0cf4768b5f..3366ccfc66 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -2141,12 +2141,6 @@ int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk, rc = ERROR_FAIL; goto out; } - if (dm_ver != LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL) { - LOG(ERROR, "cdrom-insert does not work with %s", - libxl_device_model_version_to_string(dm_ver)); - rc = ERROR_INVAL; - goto out; - } disks = libxl_device_disk_list(ctx, domid, &num); for (i = 0; i < num; i++) { @@ -2170,6 +2164,12 @@ int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk, rc = libxl__device_from_disk(gc, domid, disk, &device); if (rc) goto out; + + if (dm_ver == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { + rc = libxl__qmp_insert_cdrom(gc, domid, disk); + if (rc) goto out; + } + path = libxl__device_backend_path(gc, &device); insert = flexarray_make(gc, 4, 1); |