Message ID | 20170202155308.20348-1-wei.liu2@citrix.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Wei Liu writes ("[PATCH] xl: remove stale comment"): > Obvious the DISK_EJECT event is for ejecting removable media. The question is... > case LIBXL_EVENT_TYPE_DISK_EJECT: > - /* XXX what is this for? */ > libxl_cdrom_insert(ctx, domid, &event->u.disk_eject.disk, NULL); > break; ... why does xl respond to ejection of removeable media by calling libxl_cdrom_insert with an empty medium ? Ian.
On Thu, Feb 02, 2017 at 03:56:03PM +0000, Ian Jackson wrote: > Wei Liu writes ("[PATCH] xl: remove stale comment"): > > Obvious the DISK_EJECT event is for ejecting removable media. > > The question is... > > > case LIBXL_EVENT_TYPE_DISK_EJECT: > > - /* XXX what is this for? */ > > libxl_cdrom_insert(ctx, domid, &event->u.disk_eject.disk, NULL); > > break; > > ... why does xl respond to ejection of removeable media by calling > libxl_cdrom_insert with an empty medium ? Oh, so maybe early days there is only one type of removable medium -- the cdrom -- but things have changed now? Anyway, I don't know much about the history, just curious why this comment is here. Wei. > > Ian.
Wei Liu writes ("Re: [PATCH] xl: remove stale comment"): > On Thu, Feb 02, 2017 at 03:56:03PM +0000, Ian Jackson wrote: > > Wei Liu writes ("[PATCH] xl: remove stale comment"): > > > case LIBXL_EVENT_TYPE_DISK_EJECT: > > > - /* XXX what is this for? */ > > > libxl_cdrom_insert(ctx, domid, &event->u.disk_eject.disk, NULL); > > > break; > > > > ... why does xl respond to ejection of removeable media by calling > > libxl_cdrom_insert with an empty medium ? > > Oh, so maybe early days there is only one type of removable medium -- > the cdrom -- but things have changed now? No, that's not my point. > Anyway, I don't know much about the history, just curious why this > comment is here. The comment is there because I discovered when making libxl eventy that xl responded to disk eject events by re-ejecting the disk and didn't undrstand why. I still don't understand why. Ie, why does xl have this code at all ? Why is its handling of LIBXL_EVENT_TYPE_DISK_EJECT not to simply ignore it ? Why does it even bother listening for this event ? Ian.
On Thu, Feb 2, 2017 at 4:07 PM, Ian Jackson <ian.jackson@eu.citrix.com> wrote: > Wei Liu writes ("Re: [PATCH] xl: remove stale comment"): >> On Thu, Feb 02, 2017 at 03:56:03PM +0000, Ian Jackson wrote: >> > Wei Liu writes ("[PATCH] xl: remove stale comment"): >> > > case LIBXL_EVENT_TYPE_DISK_EJECT: >> > > - /* XXX what is this for? */ >> > > libxl_cdrom_insert(ctx, domid, &event->u.disk_eject.disk, NULL); >> > > break; >> > >> > ... why does xl respond to ejection of removeable media by calling >> > libxl_cdrom_insert with an empty medium ? >> >> Oh, so maybe early days there is only one type of removable medium -- >> the cdrom -- but things have changed now? > > No, that's not my point. > >> Anyway, I don't know much about the history, just curious why this >> comment is here. > > The comment is there because I discovered when making libxl eventy > that xl responded to disk eject events by re-ejecting the disk and > didn't undrstand why. I still don't understand why. > > Ie, why does xl have this code at all ? Why is its handling of > LIBXL_EVENT_TYPE_DISK_EJECT not to simply ignore it ? Why does it > even bother listening for this event ? Is it possible that this is a disk eject *request* event from the guest? I can't seem to figure out where these events come from. -George
George Dunlap writes ("Re: [Xen-devel] [PATCH] xl: remove stale comment"): > On Thu, Feb 2, 2017 at 4:07 PM, Ian Jackson <ian.jackson@eu.citrix.com> wrote: > > Ie, why does xl have this code at all ? Why is its handling of > > LIBXL_EVENT_TYPE_DISK_EJECT not to simply ignore it ? Why does it > > even bother listening for this event ? > > Is it possible that this is a disk eject *request* event from the guest? Perhaps so! Much of this protocol is not really documented. > I can't seem to figure out where these events come from. libxl_evenable_disk_eject sets up a xenstore watch on /local/domain/GUEST/device/vbd/DEVID/eject. Ian.
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 196b8a6851..9e63df9d27 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -3205,7 +3205,6 @@ start: goto out; case LIBXL_EVENT_TYPE_DISK_EJECT: - /* XXX what is this for? */ libxl_cdrom_insert(ctx, domid, &event->u.disk_eject.disk, NULL); break;
Obvious the DISK_EJECT event is for ejecting removable media. Signed-off-by: Wei Liu <wei.liu2@citrix.com> --- Cc: Ian Jackson <ian.jackson@eu.citrix.com> Ian, feel free to tell me that I'm wrong... --- tools/libxl/xl_cmdimpl.c | 1 - 1 file changed, 1 deletion(-)