qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] [PATCH 00/17] block: Convert common I/O path to BdrvChild


From: Kevin Wolf
Subject: [Qemu-block] [PATCH 00/17] block: Convert common I/O path to BdrvChild
Date: Tue, 21 Jun 2016 11:21:17 +0200

This series converts all I/O function in the core block layer up to
bdrv_co_preadv/pwritev() to taking a BdrvChild as their first parameter
instead of a BlockDriverState.

The original motivation for this change were op blockers, where one of
the biggest problems is making sure that every user of block devices
actually registers correctly with the op blockers system. If the I/O
functions know which parent a request comes from (BdrvChild basically
corresponds to an edge in our block device graph), it can use assertions
to make sure that that parent has actually registered its activities and
thereby ensured that it doesn't conflict with other users.

There are, however, more benefits we get from this change. The most
important one is probably that it enforces important aspects of the
block layer design like that external users go through a BlockBackend
and request are internally routed along the edges of the graph. Accesses
to random BDSes are no longer possible, you need to own an actual child
reference so you can make a request.

The work on this series already led to a few cleanups and BlockBackend
conversions in master, and this series contains a few more.

As a bonus, all the block drivers using bs->file->bs everywhere can now
go back to bs->file, which is a little nicer to read.

Kevin Wolf (17):
  vvfat: Use BdrvChild for s->qcow
  blkreplay: Convert to byte-based I/O
  vhdx: Some more BlockBackend use in vhdx_create()
  block: Convert bdrv_co_readv() to BdrvChild
  block: Convert bdrv_co_writev() to BdrvChild
  block: Convert bdrv_aio_readv() to BdrvChild
  block: Convert bdrv_aio_writev() to BdrvChild
  block: Convert bdrv_co_do_readv/writev to BdrvChild
  block: Move bdrv_commit() to block/commit.c
  block: Use BlockBackend for I/O in bdrv_commit()
  block: Convert bdrv_read() to BdrvChild
  block: Convert bdrv_write() to BdrvChild
  block: Convert bdrv_pread(v) to BdrvChild
  block: Convert bdrv_pwrite(v/_sync) to BdrvChild
  block: Convert bdrv_pwrite_zeroes() to BdrvChild
  block: Convert bdrv_prwv_co() to BdrvChild
  block: Convert bdrv_co_preadv/pwritev to BdrvChild

 block.c                        | 117 ++----------------------------------
 block/Makefile.objs            |   3 +-
 block/blkdebug.c               |   4 +-
 block/blkreplay.c              |  18 +++---
 block/blkverify.c              |   8 +--
 block/block-backend.c          |   9 ++-
 block/bochs.c                  |   8 +--
 block/cloop.c                  |   8 +--
 block/commit.c                 | 121 +++++++++++++++++++++++++++++++++++++
 block/crypto.c                 |   6 +-
 block/dmg.c                    |  21 +++----
 block/io.c                     | 132 ++++++++++++++++++++++-------------------
 block/parallels.c              |  16 ++---
 block/qcow.c                   |  41 +++++++------
 block/qcow2-cache.c            |   4 +-
 block/qcow2-cluster.c          |  18 +++---
 block/qcow2-refcount.c         |  36 +++++------
 block/qcow2-snapshot.c         |  26 ++++----
 block/qcow2.c                  |  50 +++++++++-------
 block/qed-table.c              |   4 +-
 block/qed.c                    |  22 +++----
 block/quorum.c                 |   8 +--
 block/raw_bsd.c                |   6 +-
 block/vdi.c                    |  14 ++---
 block/vhdx-log.c               |  12 ++--
 block/vhdx.c                   |  85 ++++++++++++++------------
 block/vmdk.c                   |  54 ++++++++---------
 block/vpc.c                    |  24 ++++----
 block/vvfat.c                  |  61 ++++++++++++-------
 include/block/block.h          |  38 ++++++------
 include/block/block_int.h      |   4 +-
 include/sysemu/block-backend.h |   1 +
 qemu-img.c                     |   2 +-
 33 files changed, 522 insertions(+), 459 deletions(-)

-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]