Re: [Qemu-devel] [RFC 05/10] QMP: Introduce the blockdev-tray-open command

2011-06-07 Thread Luiz Capitulino
On Tue, 7 Jun 2011 18:59:12 +0530 Amit Shah wrote: > On (Mon) 06 Jun 2011 [11:38:03], Luiz Capitulino wrote: > > On Mon, 6 Jun 2011 17:10:32 +0530 > > Amit Shah wrote: > > > > > On (Fri) 03 Jun 2011 [16:03:57], Luiz Capitulino wrote: > > > > > > > +static int tray_open(const char *device, int

Re: [Qemu-devel] [RFC 05/10] QMP: Introduce the blockdev-tray-open command

2011-06-07 Thread Amit Shah
On (Mon) 06 Jun 2011 [11:38:03], Luiz Capitulino wrote: > On Mon, 6 Jun 2011 17:10:32 +0530 > Amit Shah 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; > > >

Re: [Qemu-devel] [RFC 05/10] QMP: Introduce the blockdev-tray-open command

2011-06-06 Thread Luiz Capitulino
On Mon, 6 Jun 2011 17:10:32 +0530 Amit Shah 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) { > > +

Re: [Qemu-devel] [RFC 05/10] QMP: Introduce the blockdev-tray-open command

2011-06-06 Thread Markus Armbruster
Luiz Capitulino writes: > This command opens a removable media drive's tray. It's only available > in QMP. > > The do_tray_open() function is split into two smaller functions because > next commits will also use them. > > Please, check the command's documentation (being introduced in this > commi

Re: [Qemu-devel] [RFC 05/10] QMP: Introduce the blockdev-tray-open command

2011-06-06 Thread Amit Shah
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) {

[Qemu-devel] [RFC 05/10] QMP: Introduce the blockdev-tray-open command

2011-06-03 Thread Luiz Capitulino
This command opens a removable media drive's tray. It's only available in QMP. The do_tray_open() function is split into two smaller functions because next commits will also use them. Please, check the command's documentation (being introduced in this commit) for a detailed description. XXX: Sho