From: Anthony PERARD <anthony.perard@citrix.com>
To: Xen Devel <xen-devel@lists.xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>,
Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH 3/3] libxl: Fix cd-insert with qemu-xen.
Date: Fri, 27 Jul 2012 18:17:31 +0100 [thread overview]
Message-ID: <1343409451-30136-4-git-send-email-anthony.perard@citrix.com> (raw)
In-Reply-To: <1343409451-30136-1-git-send-email-anthony.perard@citrix.com>
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>
---
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 00ddc0e..ed89929 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2167,12 +2167,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++) {
@@ -2196,6 +2190,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(4, 1);
--
Anthony PERARD
next prev parent reply other threads:[~2012-07-27 17:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-27 17:17 [PATCH 0/3] libxl cd-insert/eject with qemu-xen Anthony PERARD
2012-07-27 17:17 ` [PATCH 1/3] libxl_qmp, Introduce libxl__qmp_insert_cdrom Anthony PERARD
2012-07-31 12:44 ` Ian Jackson
2012-07-27 17:17 ` [PATCH 2/3] libxl_dm: Set an id to cdrom drives with qemuu Anthony PERARD
2012-07-31 12:45 ` Ian Jackson
2012-07-27 17:17 ` Anthony PERARD [this message]
2012-07-31 12:47 ` [PATCH 3/3] libxl: Fix cd-insert with qemu-xen Ian Jackson
2012-07-27 17:22 ` [PATCH 0/3] libxl cd-insert/eject " Anthony PERARD
2012-07-31 12:47 ` Ian Jackson
2012-07-31 12:39 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1343409451-30136-4-git-send-email-anthony.perard@citrix.com \
--to=anthony.perard@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).