From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QobHi-0005Nb-Lj for qemu-devel@nongnu.org; Wed, 03 Aug 2011 09:14:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QobHf-0002WP-J1 for qemu-devel@nongnu.org; Wed, 03 Aug 2011 09:14:54 -0400 Received: from oxygen.pond.sub.org ([78.46.104.156]:36904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QobHf-0002Vx-EK for qemu-devel@nongnu.org; Wed, 03 Aug 2011 09:14:51 -0400 From: Markus Armbruster Date: Wed, 3 Aug 2011 15:08:12 +0200 Message-Id: <1312376904-16115-34-git-send-email-armbru@redhat.com> In-Reply-To: <1312376904-16115-1-git-send-email-armbru@redhat.com> References: <1312376904-16115-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH v2 33/45] xen: Clean up pci_piix3_xen_ide_unplug()'s test for "not a CD" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, quintela@redhat.com, stefano.stabellini@eu.citrix.com, lcapitulino@redhat.com, hare@suse.de, amit.shah@redhat.com, hch@lst.de pci_piix3_xen_ide_unplug() unplugs only disks, not CD-ROMs. It peeks into the DriveInfo's BlockDriverState to distinguish between the two. Unclean; use DriveInfo member media_cd, like xen_config_dev_blk(). Signed-off-by: Markus Armbruster --- hw/ide/piix.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 00fb683..0430c1e 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -27,7 +27,6 @@ #include #include #include "block.h" -#include "block_int.h" #include "sysemu.h" #include "dma.h" @@ -161,7 +160,7 @@ static int pci_piix3_xen_ide_unplug(DeviceState *dev) for (; i < 3; i++) { di = drive_get_by_index(IF_IDE, i); - if (di != NULL && di->bdrv != NULL && !di->bdrv->removable) { + if (di != NULL && !di->media_cd) { DeviceState *ds = bdrv_get_attached_dev(di->bdrv); if (ds) { bdrv_detach_dev(di->bdrv, ds); -- 1.7.6