From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH v2 3/4] libxl: only allow guests with a device model to use cd-{eject/insert}
Date: Fri, 8 Apr 2016 18:13:38 +0200 [thread overview]
Message-ID: <1460132019-23719-4-git-send-email-roger.pau@citrix.com> (raw)
In-Reply-To: <1460132019-23719-1-git-send-email-roger.pau@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
Changes since v1:
- Remove HVM from the error message.
---
tools/libxl/libxl.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 9d785a4..e6c3d11 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2909,6 +2909,12 @@ int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk,
goto out;
}
+ if (dm_ver == LIBXL_DEVICE_MODEL_VERSION_NONE) {
+ LOG(ERROR, "Guests without a device model cannot use cd-insert");
+ rc = ERROR_FAIL;
+ goto out;
+ }
+
disks = libxl_device_disk_list(ctx, domid, &num);
for (i = 0; i < num; i++) {
if (disks[i].is_cdrom && !strcmp(disk->vdev, disks[i].vdev))
--
2.6.4 (Apple Git-63)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-04-08 16:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-08 16:13 [PATCH v2 0/4] libxl: fix CDROM issues Roger Pau Monne
2016-04-08 16:13 ` [PATCH v2 1/4] libxl: set the device model version earlier in xenstore Roger Pau Monne
2016-04-08 16:13 ` [PATCH v2 2/4] libxl: set the backend type to Qdisk for CDROM devices on DM HVM guests Roger Pau Monne
2016-04-08 16:13 ` Roger Pau Monne [this message]
2016-04-08 16:13 ` [PATCH v2 4/4] libxl: remove code added to use the 'phy' backend with CDROM devices Roger Pau Monne
2016-04-08 16:24 ` Wei Liu
2016-04-08 16:23 ` [PATCH v2 0/4] libxl: fix CDROM issues George Dunlap
2016-04-08 16:37 ` Roger Pau Monné
2016-04-08 16:55 ` Roger Pau Monné
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=1460132019-23719-4-git-send-email-roger.pau@citrix.com \
--to=roger.pau@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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).