summaryrefslogtreecommitdiff
path: root/hw/ide/piix.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2011-08-03 15:07:40 +0200
committerKevin Wolf <kwolf@redhat.com>2011-09-06 11:23:51 +0200
commitfa879d62eb51253d00b6920ce1d1d9d261370a49 (patch)
treef83542a0ae74fe8ef0078f90098ae6aa7e02a7d6 /hw/ide/piix.c
parent648fb0ea5e9d7f32c80ec23c3ece4321403dfecd (diff)
downloadqemu-fa879d62eb51253d00b6920ce1d1d9d261370a49.tar.gz
block: Attach non-qdev devices as well
For now, this just protects against programming errors like having the same drive back multiple non-qdev devices, or untimely bdrv_delete(). Later commits will add other interesting uses. While there, rename BlockDriverState member peer to dev, bdrv_attach() to bdrv_attach_dev(), bdrv_detach() to bdrv_detach_dev(), and bdrv_get_attached() to bdrv_get_attached_dev(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/ide/piix.c')
-rw-r--r--hw/ide/piix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index 8525336075..b9cdcd6b75 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -177,9 +177,9 @@ 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);
+ 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;