[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 15/23] hw: Convert from BlockDriverState to B
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v4 15/23] hw: Convert from BlockDriverState to BlockBackend, mostly |
Date: |
Thu, 02 Oct 2014 09:14:23 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Max Reitz <address@hidden> writes:
> On 30.09.2014 21:25, Markus Armbruster wrote:
>> 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 <address@hidden>
>> ---
>> block/block-backend.c | 262
>> +++++++++++++++++++++++++++++++
>> blockdev.c | 19 +--
>> dma-helpers.c | 59 +++----
>> hw/arm/collie.c | 5 +-
>> hw/arm/gumstix.c | 5 +-
>> hw/arm/highbank.c | 2 +-
>> hw/arm/mainstone.c | 2 +-
>> hw/arm/musicpal.c | 10 +-
>> hw/arm/nseries.c | 3 +-
>> hw/arm/omap1.c | 2 +-
>> hw/arm/omap2.c | 2 +-
>> hw/arm/omap_sx1.c | 5 +-
>> hw/arm/pxa2xx.c | 4 +-
>> hw/arm/realview.c | 2 +-
>> hw/arm/spitz.c | 4 +-
>> hw/arm/tosa.c | 3 +-
>> hw/arm/versatilepb.c | 3 +-
>> hw/arm/vexpress.c | 3 +-
>> hw/arm/virt.c | 2 +-
>> hw/arm/xilinx_zynq.c | 3 +-
>> hw/arm/z2.c | 3 +-
>> hw/block/block.c | 7 +-
>> hw/block/dataplane/virtio-blk.c | 24 +--
>> hw/block/fdc.c | 78 +++++----
>> hw/block/hd-geometry.c | 24 +--
>> hw/block/m25p80.c | 28 ++--
>> hw/block/nand.c | 50 +++---
>> hw/block/nvme.c | 19 +--
>> hw/block/onenand.c | 67 ++++----
>> hw/block/pflash_cfi01.c | 24 +--
>> hw/block/pflash_cfi02.c | 24 +--
>> hw/block/virtio-blk.c | 95 +++++------
>> hw/block/xen_disk.c | 83 +++++-----
>> hw/core/qdev-properties-system.c | 26 +--
>> hw/core/qdev-properties.c | 2 +-
>> hw/cris/axis_dev88.c | 3 +-
>> hw/display/tc6393xb.c | 2 +-
>> hw/i386/pc.c | 2 +-
>> hw/i386/pc_piix.c | 2 +-
>> hw/i386/pc_sysfw.c | 9 +-
>> hw/i386/xen/xen_platform.c | 5 +-
>> hw/ide/ahci.c | 31 ++--
>> hw/ide/atapi.c | 33 ++--
>> hw/ide/cmd646.c | 2 +-
>> hw/ide/core.c | 184 ++++++++++++----------
>> hw/ide/ich.c | 2 +-
>> hw/ide/internal.h | 6 +-
>> hw/ide/isa.c | 2 +-
>> hw/ide/macio.c | 50 +++---
>> hw/ide/microdrive.c | 4 +-
>> hw/ide/mmio.c | 2 +-
>> hw/ide/pci.c | 4 +-
>> hw/ide/piix.c | 9 +-
>> hw/ide/qdev.c | 11 +-
>> hw/ide/via.c | 2 +-
>> hw/isa/pc87312.c | 4 +-
>> hw/lm32/lm32_boards.c | 5 +-
>> hw/lm32/milkymist.c | 3 +-
>> hw/microblaze/petalogix_ml605_mmu.c | 3 +-
>> hw/microblaze/petalogix_s3adsp1800_mmu.c | 3 +-
>> hw/mips/mips_fulong2e.c | 2 +-
>> hw/mips/mips_jazz.c | 2 +-
>> hw/mips/mips_malta.c | 6 +-
>> hw/mips/mips_r4k.c | 3 +-
>> hw/nvram/spapr_nvram.c | 17 +-
>> hw/pci/pci-hotplug-old.c | 5 +-
>> hw/ppc/mac_newworld.c | 2 +-
>> hw/ppc/mac_oldworld.c | 2 +-
>> hw/ppc/ppc405_boards.c | 26 +--
>> hw/ppc/prep.c | 2 +-
>> hw/ppc/spapr.c | 4 +-
>> hw/ppc/virtex_ml507.c | 3 +-
>> hw/s390x/s390-virtio-bus.c | 2 +-
>> hw/s390x/s390-virtio.c | 2 +-
>> hw/s390x/virtio-ccw.c | 2 +-
>> hw/scsi/megasas.c | 15 +-
>> hw/scsi/scsi-bus.c | 8 +-
>> hw/scsi/scsi-disk.c | 186 +++++++++++-----------
>> hw/scsi/scsi-generic.c | 39 ++---
>> hw/sd/milkymist-memcard.c | 8 +-
>> hw/sd/omap_mmc.c | 8 +-
>> hw/sd/pl181.c | 2 +-
>> hw/sd/pxa2xx_mmci.c | 4 +-
>> hw/sd/sd.c | 60 +++----
>> hw/sd/sdhci.c | 2 +-
>> hw/sd/ssi-sd.c | 2 +-
>> hw/sh4/r2d.c | 3 +-
>> hw/sparc/sun4m.c | 2 +-
>> hw/sparc64/sun4u.c | 2 +-
>> hw/tpm/tpm_tis.c | 2 +-
>> hw/tricore/tricore_testboard.c | 2 +-
>> hw/usb/dev-storage.c | 17 +-
>> hw/virtio/virtio-pci.c | 2 +-
>> hw/xen/xen_devconfig.c | 1 +
>> hw/xenpv/xen_machine_pv.c | 2 +-
>> hw/xtensa/xtfpga.c | 3 +-
>> include/hw/arm/omap.h | 4 +-
>> include/hw/arm/pxa.h | 2 +-
>> include/hw/block/block.h | 6 +-
>> include/hw/block/flash.h | 6 +-
>> include/hw/qdev-properties.h | 8 +-
>> include/hw/scsi/scsi.h | 4 +-
>> include/hw/sd.h | 2 +-
>> include/hw/virtio/virtio-blk.h | 7 +-
>> include/qemu/typedefs.h | 1 +
>> include/sysemu/block-backend.h | 76 +++++++++
>> include/sysemu/blockdev.h | 5 +-
>> include/sysemu/dma.h | 20 +--
>> trace-events | 8 +-
>> 109 files changed, 1129 insertions(+), 807 deletions(-)
>
> [snip]
>
>> diff --git a/dma-helpers.c b/dma-helpers.c
>> index 026e567..6918572 100644
>> --- a/dma-helpers.c
>> +++ b/dma-helpers.c
>
> [snip]
>
>> @@ -209,25 +210,25 @@ BlockAIOCB *dma_bdrv_io(
>> dbs->io_func = io_func;
>> dbs->bh = NULL;
>> qemu_iovec_init(&dbs->iov, sg->nsg);
>> - dma_bdrv_cb(dbs, 0);
>> + dma_blk_cb(dbs, 0);
>> return &dbs->common;
>> }
>> -BlockAIOCB *dma_bdrv_read(BlockDriverState *bs,
>> - QEMUSGList *sg, uint64_t sector,
>> - void (*cb)(void *opaque, int ret), void
>> *opaque)
>> +BlockAIOCB *dma_blk_read(BlockBackend *blk,
>> + QEMUSGList *sg, uint64_t sector,
>> + void (*cb)(void *opaque, int ret), void *opaque)
>
> Thank you for pointing out another place where patch 11 broke the
> alignment. *g*
>
> So, if you decide to fix the alignment in patch 11 and 12, this patch
> has to be adjusted accordingly during rebase. My R-b for this patch
> stands both if you don't change 11, 12 and 15, and if you change 11
> and 12 and then change this patch to match the changes.
>
> Reviewed-by: Max Reitz <address@hidden>
All three cleaned up as per your review. Thanks!