diff options
author | Markus Armbruster <armbru@redhat.com> | 2014-10-07 13:59:18 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2014-10-20 14:02:25 +0200 |
commit | 4be746345f13e99e468c60acbd3a355e8183e3ce (patch) | |
tree | 16509218f940129beb113cf3b1be158c3501ec1d /hw/mips | |
parent | 2a30307f709e6a395d23cf94837e9aae15f8e8fa (diff) |
hw: Convert from BlockDriverState to BlockBackend, mostly
Device models should access their block backends only through the
block-backend.h API. Convert them, and drop direct includes of
inappropriate headers.
Just four uses of BlockDriverState are left:
* The Xen paravirtual block device backend (xen_disk.c) opens images
itself when set up via xenbus, bypassing blockdev.c. I figure it
should go through qmp_blockdev_add() instead.
* Device model "usb-storage" prompts for keys. No other device model
does, and this one probably shouldn't do it, either.
* ide_issue_trim_cb() uses bdrv_aio_discard() instead of
blk_aio_discard() because it fishes its backend out of a BlockAIOCB,
which has only the BlockDriverState.
* PC87312State has an unused BlockDriverState[] member.
The next two commits take care of the latter two.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/mips')
-rw-r--r-- | hw/mips/mips_fulong2e.c | 2 | ||||
-rw-r--r-- | hw/mips/mips_jazz.c | 2 | ||||
-rw-r--r-- | hw/mips/mips_malta.c | 6 | ||||
-rw-r--r-- | hw/mips/mips_r4k.c | 3 |
4 files changed, 6 insertions, 7 deletions
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index 29cd708e07..6a9ebfa911 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -25,7 +25,7 @@ #include "net/net.h" #include "hw/boards.h" #include "hw/i2c/smbus.h" -#include "block/block.h" +#include "sysemu/block-backend.h" #include "hw/block/flash.h" #include "hw/mips/mips.h" #include "hw/mips/cpudevs.h" diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index 6c31cb8fe9..3f33093fd9 100644 --- a/hw/mips/mips_jazz.c +++ b/hw/mips/mips_jazz.c @@ -39,7 +39,7 @@ #include "hw/timer/mc146818rtc.h" #include "hw/timer/i8254.h" #include "hw/audio/pcspk.h" -#include "sysemu/blockdev.h" +#include "sysemu/block-backend.h" #include "hw/sysbus.h" #include "exec/address-spaces.h" #include "sysemu/qtest.h" diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 59020ec176..514f06ccc4 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -29,7 +29,7 @@ #include "net/net.h" #include "hw/boards.h" #include "hw/i2c/smbus.h" -#include "block/block.h" +#include "sysemu/block-backend.h" #include "hw/block/flash.h" #include "hw/mips/mips.h" #include "hw/mips/cpudevs.h" @@ -1033,12 +1033,12 @@ void mips_malta_init(MachineState *machine) printf("Register parallel flash %d size " TARGET_FMT_lx " at " "addr %08llx '%s' %x\n", fl_idx, bios_size, FLASH_ADDRESS, - bdrv_get_device_name(dinfo->bdrv), fl_sectors); + blk_name(dinfo->bdrv), fl_sectors); } #endif fl = pflash_cfi01_register(FLASH_ADDRESS, NULL, "mips_malta.bios", BIOS_SIZE, - dinfo ? blk_bs(blk_by_legacy_dinfo(dinfo)) : NULL, + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, 65536, fl_sectors, 4, 0x0000, 0x0000, 0x0000, 0x0000, be); bios = pflash_cfi01_get_memory(fl); diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index e966a1bb1c..a7fe0ceadf 100644 --- a/hw/mips/mips_r4k.c +++ b/hw/mips/mips_r4k.c @@ -25,7 +25,6 @@ #include "hw/timer/mc146818rtc.h" #include "hw/timer/i8254.h" #include "sysemu/block-backend.h" -#include "sysemu/blockdev.h" #include "exec/address-spaces.h" #include "sysemu/qtest.h" @@ -242,7 +241,7 @@ void mips_r4k_init(MachineState *machine) } else if ((dinfo = drive_get(IF_PFLASH, 0, 0)) != NULL) { uint32_t mips_rom = 0x00400000; if (!pflash_cfi01_register(0x1fc00000, NULL, "mips_r4k.bios", mips_rom, - blk_bs(blk_by_legacy_dinfo(dinfo)), + blk_by_legacy_dinfo(dinfo), sector_len, mips_rom / sector_len, 4, 0, 0, 0, 0, be)) { fprintf(stderr, "qemu: Error registering flash memory.\n"); |