From: Luiz Capitulino <lcapitulino@redhat.com>
To: Amit Shah <amit.shah@redhat.com>
Cc: kwolf@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org,
armbru@redhat.com
Subject: Re: [Qemu-devel] [RFC 05/10] QMP: Introduce the blockdev-tray-open command
Date: Tue, 7 Jun 2011 10:53:01 -0300 [thread overview]
Message-ID: <20110607105301.35833b32@doriath> (raw)
In-Reply-To: <20110607132912.GG11606@amit-x200.redhat.com>
On Tue, 7 Jun 2011 18:59:12 +0530
Amit Shah <amit.shah@redhat.com> wrote:
> On (Mon) 06 Jun 2011 [11:38:03], Luiz Capitulino wrote:
> > On Mon, 6 Jun 2011 17:10:32 +0530
> > Amit Shah <amit.shah@redhat.com> 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.
>
> Not necessary -- CD/DVD writers eject and reload trays after erasing
> media -- at least they used to.
But that's not done by the VM's user/client.
I think I'll add it anyway, as it's what people seem to expect from an
API like this.
> > > 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.
>
> Yes, command, sorry.
>
> And by 'change' I don't mean the current monitor change command --
> that's a badly-named one.
>
> By change I mean just that -- replace the media. And that should
> succeed only if tray is open. And tray remains open after the change.
The same thing can be done with blockdev-media-remove and
blockdev-media-insert, so I don't think this adds value.
next prev parent reply other threads:[~2011-06-07 13:53 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-03 19:03 [Qemu-devel] [RFC 00/10]: QMP/HMP: Introduce tray handling commands Luiz Capitulino
2011-06-03 19:03 ` [Qemu-devel] [RFC 01/10] block: bdrv_eject(): Add 'force' parameter Luiz Capitulino
2011-06-03 19:03 ` [Qemu-devel] [RFC 02/10] block: Rename bdrv_mon_event() Luiz Capitulino
2011-06-03 19:03 ` [Qemu-devel] [RFC 03/10] QMP: query-block: Add the 'tray-open' key Luiz Capitulino
2011-06-03 19:03 ` [Qemu-devel] [RFC 04/10] HMP: info block: Print " Luiz Capitulino
2011-06-06 13:19 ` Markus Armbruster
2011-06-06 14:46 ` Luiz Capitulino
2011-06-03 19:03 ` [Qemu-devel] [RFC 05/10] QMP: Introduce the blockdev-tray-open command Luiz Capitulino
2011-06-06 11:40 ` Amit Shah
2011-06-06 14:38 ` Luiz Capitulino
2011-06-07 13:29 ` Amit Shah
2011-06-07 13:53 ` Luiz Capitulino [this message]
2011-06-06 13:35 ` Markus Armbruster
2011-06-03 19:03 ` [Qemu-devel] [RFC 06/10] QMP: Introduce the blockdev-tray-close command Luiz Capitulino
2011-06-03 19:03 ` [Qemu-devel] [RFC 07/10] QMP: Introduce the blockdev-media-insert command Luiz Capitulino
2011-06-06 11:44 ` Amit Shah
2011-06-06 13:40 ` Markus Armbruster
2011-06-06 14:58 ` Luiz Capitulino
2011-06-03 19:04 ` [Qemu-devel] [RFC 08/10] QMP: Introduce the BLOCK_TRAY_OPEN and BLOCK_TRAY_CLOSE events Luiz Capitulino
2011-06-03 19:04 ` [Qemu-devel] [RFC 09/10] QMP/HMP: eject: Use blockdev-tray-open Luiz Capitulino
2011-06-03 19:04 ` [Qemu-devel] [RFC 10/10] QMP/HMP: change: Use QMP tray commands Luiz Capitulino
2011-06-06 11:48 ` Amit Shah
2011-06-06 14:45 ` Luiz Capitulino
2011-06-07 13:32 ` Amit Shah
2011-06-06 13:31 ` [Qemu-devel] [RFC 00/10]: QMP/HMP: Introduce tray handling commands Markus Armbruster
2011-06-06 14:56 ` Luiz Capitulino
2011-12-20 6:49 ` Osier Yang
2012-01-03 19:28 ` Luiz Capitulino
2012-01-11 7:34 ` Osier Yang
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=20110607105301.35833b32@doriath \
--to=lcapitulino@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=amit.shah@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.