qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, benoit.canet@nodalink.com, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4 15/23] hw: Convert from BlockDriverState to BlockBackend, mostly
Date: Wed, 01 Oct 2014 19:09:01 +0200	[thread overview]
Message-ID: <542C352D.1070509@redhat.com> (raw)
In-Reply-To: <1412105144-532-16-git-send-email-armbru@redhat.com>

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 <armbru@redhat.com>
> ---
>   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 <mreitz@redhat.com>

  reply	other threads:[~2014-10-01 17:09 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-30 19:25 [Qemu-devel] [PATCH v4 00/23] Split BlockBackend off BDS with an axe Markus Armbruster
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 01/23] block: Split bdrv_new_root() off bdrv_new() Markus Armbruster
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 02/23] block: New BlockBackend Markus Armbruster
2014-10-01 15:27   ` Max Reitz
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 03/23] block: Connect BlockBackend to BlockDriverState Markus Armbruster
2014-10-01 15:34   ` Max Reitz
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 04/23] block: Connect BlockBackend and DriveInfo Markus Armbruster
2014-10-01 15:52   ` Max Reitz
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 05/23] block: Code motion to get rid of stubs/blockdev.c Markus Armbruster
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 06/23] block: Make BlockBackend own its BlockDriverState Markus Armbruster
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 07/23] block: Eliminate bdrv_iterate(), use bdrv_next() Markus Armbruster
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 08/23] block: Eliminate BlockDriverState member device_name[] Markus Armbruster
2014-10-01 16:19   ` Max Reitz
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 09/23] block: Merge BlockBackend and BlockDriverState name spaces Markus Armbruster
2014-10-01 16:20   ` Max Reitz
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 10/23] block: Eliminate DriveInfo member bdrv, use blk_by_legacy_dinfo() Markus Armbruster
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 11/23] block: Rename BlockDriverAIOCB* to BlockAIOCB* Markus Armbruster
2014-10-01 16:50   ` Max Reitz
2014-10-02  7:03     ` Markus Armbruster
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 12/23] block: Rename BlockDriverCompletionFunc to BlockCompletionFunc Markus Armbruster
2014-10-01 16:55   ` Max Reitz
2014-10-02  7:12     ` Markus Armbruster
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 13/23] virtio-blk: Drop redundant VirtIOBlock member conf Markus Armbruster
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 14/23] virtio-blk: Rename VirtIOBlkConf variables to conf Markus Armbruster
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 15/23] hw: Convert from BlockDriverState to BlockBackend, mostly Markus Armbruster
2014-10-01 17:09   ` Max Reitz [this message]
2014-10-02  7:14     ` Markus Armbruster
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 16/23] ide: Complete conversion from BlockDriverState to BlockBackend Markus Armbruster
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 17/23] pc87312: Drop unused members of PC87312State Markus Armbruster
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 18/23] blockdev: Drop superfluous DriveInfo member id Markus Armbruster
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 19/23] blockdev: Fix blockdev-add not to create DriveInfo Markus Armbruster
2014-10-01 17:21   ` Max Reitz
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 20/23] block/qapi: Convert qmp_query_block() to BlockBackend Markus Armbruster
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 21/23] blockdev: Convert qmp_eject(), qmp_change_blockdev() " Markus Armbruster
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 22/23] block: Lift device model API into BlockBackend Markus Armbruster
2014-09-30 19:25 ` [Qemu-devel] [PATCH v4 23/23] block: Make device model's references to BlockBackend strong Markus Armbruster
2014-10-01 17:22   ` Max Reitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=542C352D.1070509@redhat.com \
    --to=mreitz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=benoit.canet@nodalink.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).