From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: xen-devel@lists.xenproject.org,
"Ian Jackson" <ian.jackson@eu.citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH 3/4] libxl: only allow guests with a device model to use cd-{eject/insert}
Date: Fri, 8 Apr 2016 16:51:05 +0200 [thread overview]
Message-ID: <alpine.OSX.2.20.1604081649020.18723@mac> (raw)
In-Reply-To: <20160408144748.GP32191@citrix.com>
[-- Attachment #1: Type: text/plain, Size: 2698 bytes --]
On Fri, 8 Apr 2016, Wei Liu wrote:
> On Fri, Apr 08, 2016 at 04:35:22PM +0200, Roger Pau Monné wrote:
> > On Fri, 8 Apr 2016, Wei Liu wrote:
> > > On Fri, Apr 08, 2016 at 04:17:55PM +0200, Roger Pau Monné wrote:
> > > > On Fri, 8 Apr 2016, Wei Liu wrote:
> > > > > On Thu, Apr 07, 2016 at 07:45:28PM +0200, Roger Pau Monne wrote:
> > > > > > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > > > > > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > > > > > Cc: Wei Liu <wei.liu2@citrix.com>
> > > > > > ---
> > > > > > tools/libxl/libxl.c | 6 ++++++
> > > > > > 1 file changed, 6 insertions(+)
> > > > > >
> > > > > > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> > > > > > index 9d785a4..232e2c1 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, "HVM guests without a device model cannot use cd-insert");
> > > > >
> > > > > It's not specific to HVM, right?
> > > >
> > > > It's specific to guests with a device model (those are the only ones that
> > > > can have an emulated CDROM device), and the only guests that can have a
> > > > device model are HVM (although not all of them).
> > > >
> > >
> > > Remind me again: how does PV guest CDROM work? ISTR it will also go
> > > through this function? My memory is vague though...
> >
> > No, AFAICT PV guests use block-attach/detach in order to manage CDROMs,
> > the usage of the cd-eject/insert commands is already limited to HVM
> > guests, my check is only further limiting it to HVM guests with a device
> > model (so it's not used for PVH guests).
> >
> > A little above of the check that I've added:
> >
> > libxl_domain_type type = libxl__domain_type(gc, domid);
> > if (type == LIBXL_DOMAIN_TYPE_INVALID) {
> > rc = ERROR_FAIL;
> > goto out;
> > }
> > if (type != LIBXL_DOMAIN_TYPE_HVM) {
> > LOG(ERROR, "cdrom-insert requires an HVM domain");
> > rc = ERROR_INVAL;
> > goto out;
> > }
>
> Right. Thanks for checking. I realise quibbling over an error message
> seems counter-productive.
>
> Acked-by: Wei Liu <wei.liu2@citrix.com>
Thanks, I don't mind changing the message to "Guests without a device
model cannot use cd-insert", I just felt that adding HVM would make it
clearer, but it might not. If you or the committer prefer to change the
message that's fine for me (and I can send a new version if requested).
Roger.
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-04-08 14:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-07 17:45 [PATCH 0/4] libxl: fix CDROM issues Roger Pau Monne
2016-04-07 17:45 ` [PATCH 1/4] libxl: set the device model version earlier in xenstore Roger Pau Monne
2016-04-08 13:14 ` Wei Liu
2016-04-08 14:16 ` Roger Pau Monné
2016-04-08 14:24 ` Wei Liu
2016-04-07 17:45 ` [PATCH 2/4] libxl: set the backend type to Qdisk for CDROM devices on DM HVM guests Roger Pau Monne
2016-04-08 13:29 ` Wei Liu
2016-04-07 17:45 ` [PATCH 3/4] libxl: only allow guests with a device model to use cd-{eject/insert} Roger Pau Monne
2016-04-08 13:21 ` Wei Liu
2016-04-08 14:17 ` Roger Pau Monné
2016-04-08 14:25 ` Wei Liu
2016-04-08 14:34 ` Ian Jackson
2016-04-08 14:35 ` Roger Pau Monné
2016-04-08 14:47 ` Wei Liu
2016-04-08 14:51 ` Roger Pau Monné [this message]
2016-04-08 14:59 ` Andrew Cooper
2016-04-08 15:06 ` George Dunlap
2016-04-08 15:07 ` Wei Liu
2016-04-07 17:45 ` [PATCH 4/4] libxl: remove code added to use the 'phy' backend with CDROM devices Roger Pau Monne
2016-04-08 13:30 ` Wei Liu
2016-04-08 15:07 ` 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=alpine.OSX.2.20.1604081649020.18723@mac \
--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).