[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 05/10] QMP: Introduce the blockdev-tray-open comma
From: |
Luiz Capitulino |
Subject: |
Re: [Qemu-devel] [RFC 05/10] QMP: Introduce the blockdev-tray-open command |
Date: |
Mon, 6 Jun 2011 11:38:03 -0300 |
On Mon, 6 Jun 2011 17:10:32 +0530
Amit Shah <address@hidden> wrote:
> On (Fri) 03 Jun 2011 [16:03:57], Luiz Capitulino wrote:
>
> > +static int tray_open(const char *device, int remove, int force)
> > +{
> > + BlockDriverState *bs;
> > +
> > + bs = bdrv_removable_find(device);
> > + if (!bs) {
> > + return -1;
> > + }
> > +
> > + if (bdrv_eject(bs, 1, force) < 0) {
> > + /* FIXME: will report undefined error in QMP */
> > + return -1;
> > + }
> > +
> > + if (remove) {
> > + bdrv_close(bs);
> > + }
> > +
> > + return 0;
> > +}
>
> What's the reason to tie the 'remove' with tray open?
In my first try I had a command called 'blockdev-media-remove', but then
I had the impression that I was going too far as the only reason a client
would ever want to open the tray is to remove the media.
> Won't it be
> simpler to have it separated out, perhaps a 'change' event instead of
> 'insert' that can accept NULL which means just remove medium?
You meant 'command' instead of 'event', right?
I don't think a change command makes sense, because it's just a shortcut
to open/remove/insert/close.
[Qemu-devel] [RFC 08/10] QMP: Introduce the BLOCK_TRAY_OPEN and BLOCK_TRAY_CLOSE events, Luiz Capitulino, 2011/06/03
[Qemu-devel] [RFC 09/10] QMP/HMP: eject: Use blockdev-tray-open, Luiz Capitulino, 2011/06/03
[Qemu-devel] [RFC 10/10] QMP/HMP: change: Use QMP tray commands, Luiz Capitulino, 2011/06/03
Re: [Qemu-devel] [RFC 00/10]: QMP/HMP: Introduce tray handling commands, Markus Armbruster, 2011/06/06