summaryrefslogtreecommitdiffstats
path: root/hw/ide/core.c
diff options
context:
space:
mode:
authorMarkus Armbruster2011-08-03 15:07:40 +0200
committerKevin Wolf2011-09-06 11:23:51 +0200
commitfa879d62eb51253d00b6920ce1d1d9d261370a49 (patch)
treef83542a0ae74fe8ef0078f90098ae6aa7e02a7d6 /hw/ide/core.c
parentasync: Allow nested qemu_bh_poll calls (diff)
downloadqemu-fa879d62eb51253d00b6920ce1d1d9d261370a49.tar.gz
qemu-fa879d62eb51253d00b6920ce1d1d9d261370a49.tar.xz
qemu-fa879d62eb51253d00b6920ce1d1d9d261370a49.zip
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/core.c')
-rw-r--r--hw/ide/core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 40abc1edd2..428f033876 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -1890,6 +1890,7 @@ void ide_init2_with_non_qdev_drives(IDEBus *bus, DriveInfo *hd0,
error_report("Can't set up IDE drive %s", dinfo->id);
exit(1);
}
+ bdrv_attach_dev_nofail(dinfo->bdrv, &bus->ifs[i]);
} else {
ide_reset(&bus->ifs[i]);
}