block: Attach non-qdev devices as well
authorMarkus Armbruster <armbru@redhat.com>
Wed, 3 Aug 2011 13:07:40 +0000 (15:07 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 6 Sep 2011 09:23:51 +0000 (11:23 +0200)
commitfa879d62eb51253d00b6920ce1d1d9d261370a49
treef83542a0ae74fe8ef0078f90098ae6aa7e02a7d6
parent648fb0ea5e9d7f32c80ec23c3ece4321403dfecd
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>
12 files changed:
block.c
block.h
block_int.h
blockdev.c
hw/ide/core.c
hw/ide/piix.c
hw/pflash_cfi01.c
hw/pflash_cfi02.c
hw/qdev-properties.c
hw/sd.c
hw/usb-msd.c
hw/xen_disk.c