[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 07/10] QMP: Introduce the blockdev-media-insert co
From: |
Amit Shah |
Subject: |
Re: [Qemu-devel] [RFC 07/10] QMP: Introduce the blockdev-media-insert command |
Date: |
Mon, 6 Jun 2011 17:14:05 +0530 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On (Fri) 03 Jun 2011 [16:03:59], Luiz Capitulino wrote:
>
> +static int media_insert(const char *device, const char *mediafile,
> + const char *format)
> +{
> + BlockDriver *drv = NULL;
> + BlockDriverState *bs;
> + int bdrv_flags;
> +
> + bs = bdrv_removable_find(device);
> + if (!bs) {
> + return -1;
> + }
> +
> + if (bdrv_is_locked(bs)) {
> + qerror_report(QERR_DEVICE_LOCKED, bdrv_get_device_name(bs));
> + return -1;
> + }
> +
> + if (bdrv_is_inserted(bs)) {
> + /* FIXME: will report undefined error in QMP */
> + return -1;
> + }
> +
> + if (!bs->tray_open) {
> + /* FIXME: will report undefined error in QMP */
> + return 1;
> + }
Yes, these should be fixed.
Amit
- [Qemu-devel] [RFC 00/10]: QMP/HMP: Introduce tray handling commands, Luiz Capitulino, 2011/06/03
- [Qemu-devel] [RFC 01/10] block: bdrv_eject(): Add 'force' parameter, Luiz Capitulino, 2011/06/03
- [Qemu-devel] [RFC 02/10] block: Rename bdrv_mon_event(), Luiz Capitulino, 2011/06/03
- [Qemu-devel] [RFC 03/10] QMP: query-block: Add the 'tray-open' key, Luiz Capitulino, 2011/06/03
- [Qemu-devel] [RFC 04/10] HMP: info block: Print the 'tray-open' key, Luiz Capitulino, 2011/06/03
- [Qemu-devel] [RFC 06/10] QMP: Introduce the blockdev-tray-close command, Luiz Capitulino, 2011/06/03
- [Qemu-devel] [RFC 07/10] QMP: Introduce the blockdev-media-insert command, Luiz Capitulino, 2011/06/03
- [Qemu-devel] [RFC 05/10] QMP: Introduce the blockdev-tray-open command, Luiz Capitulino, 2011/06/03
- Re: [Qemu-devel] [RFC 05/10] QMP: Introduce the blockdev-tray-open command, Markus Armbruster, 2011/06/06
[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