From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbXO3-00065l-7h for qemu-devel@nongnu.org; Tue, 07 Oct 2014 12:13:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XbXNe-0001nh-0t for qemu-devel@nongnu.org; Tue, 07 Oct 2014 12:13:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbXNd-0001mX-Qs for qemu-devel@nongnu.org; Tue, 07 Oct 2014 12:12:53 -0400 Message-ID: <5434105C.7070205@redhat.com> Date: Tue, 07 Oct 2014 18:10:04 +0200 From: Max Reitz MIME-Version: 1.0 References: <1412683166-4934-1-git-send-email-armbru@redhat.com> <1412683166-4934-17-git-send-email-armbru@redhat.com> In-Reply-To: <1412683166-4934-17-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 16/24] hw: Convert from BlockDriverState to BlockBackend, mostly List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: kwolf@redhat.com, benoit.canet@nodalink.com, stefanha@redhat.com On 07.10.2014 13:59, 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 > --- > block/block-backend.c | 262 +++++++++++++++++++++++++++++++ > blockdev.c | 12 +- > dma-helpers.c | 61 +++---- > 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 | 8 +- > 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 | 12 +- > hw/scsi/scsi-disk.c | 182 ++++++++++----------- > hw/scsi/scsi-generic.c | 35 +++-- > hw/scsi/virtio-scsi-dataplane.c | 3 +- > hw/scsi/virtio-scsi.c | 15 +- > 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 +- > 111 files changed, 1137 insertions(+), 807 deletions(-) Reviewed-by: Max Reitz