diff mbox

xl: remove stale comment

Message ID 20170202155308.20348-1-wei.liu2@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Liu Feb. 2, 2017, 3:53 p.m. UTC
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(-)

Comments

Ian Jackson Feb. 2, 2017, 3:56 p.m. UTC | #1
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.
Wei Liu Feb. 2, 2017, 4:04 p.m. UTC | #2
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.
Ian Jackson Feb. 2, 2017, 4:07 p.m. UTC | #3
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.
George Dunlap Feb. 6, 2017, 3:37 p.m. UTC | #4
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
Ian Jackson Feb. 6, 2017, 3:44 p.m. UTC | #5
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 mbox

Patch

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;