summary refs log tree commit diff stats
path: root/hw/ide/piix.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-09-08 09:05:14 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-09-08 09:05:14 -0500
commit220724ca4ada4e30bcfff326b62822a69c23e181 (patch)
treec0bb1bdd3ec41c5945000cf43620725d2e00ffd8 /hw/ide/piix.c
parentd8ac46d950451a722fd6b1d5d0768c72bee87d47 (diff)
parentcfc606da0ddcef1f7228317b9f7dfa6c94c6c64f (diff)
downloadfocaccia-qemu-220724ca4ada4e30bcfff326b62822a69c23e181.tar.gz
focaccia-qemu-220724ca4ada4e30bcfff326b62822a69c23e181.zip
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Diffstat (limited to 'hw/ide/piix.c')
-rw-r--r--hw/ide/piix.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index 8525336075..88d318127c 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -27,7 +27,6 @@
 #include <hw/pci.h>
 #include <hw/isa.h>
 #include "block.h"
-#include "block_int.h"
 #include "sysemu.h"
 #include "dma.h"
 
@@ -176,10 +175,10 @@ 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) {
-            DeviceState *ds = bdrv_get_attached(di->bdrv);
+        if (di != NULL && !di->media_cd) {
+            DeviceState *ds = bdrv_get_attached_dev(di->bdrv);
             if (ds) {
-                bdrv_detach(di->bdrv, ds);
+                bdrv_detach_dev(di->bdrv, ds);
             }
             bdrv_close(di->bdrv);
             pci_ide->bus[di->bus].ifs[di->unit].bs = NULL;