From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTYE9-00050G-6M for qemu-devel@nongnu.org; Mon, 06 Jun 2011 07:44:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QTYE4-0001gV-Eq for qemu-devel@nongnu.org; Mon, 06 Jun 2011 07:44:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50951) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTYE3-0001gJ-W1 for qemu-devel@nongnu.org; Mon, 06 Jun 2011 07:44:08 -0400 Date: Mon, 6 Jun 2011 17:14:05 +0530 From: Amit Shah Message-ID: <20110606114404.GB8114@amit-x200.redhat.com> References: <1307127842-12102-1-git-send-email-lcapitulino@redhat.com> <1307127842-12102-8-git-send-email-lcapitulino@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1307127842-12102-8-git-send-email-lcapitulino@redhat.com> Subject: Re: [Qemu-devel] [RFC 07/10] QMP: Introduce the blockdev-media-insert command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: kwolf@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, armbru@redhat.com 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