From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0xiC-00023Q-9f for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:37:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R0xi3-0003mW-Ej for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:37:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0xi2-0003mK-UX for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:37:11 -0400 From: Kevin Wolf Date: Tue, 6 Sep 2011 17:39:31 +0200 Message-Id: <1315323586-23840-17-git-send-email-kwolf@redhat.com> In-Reply-To: <1315323586-23840-1-git-send-email-kwolf@redhat.com> References: <1315323586-23840-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 16/31] 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: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Markus Armbruster 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 Signed-off-by: Kevin Wolf --- 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 b9cdcd6..88d3181 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" @@ -176,7 +175,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