All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 00/14] block: Remove "growable", add blk_new_open()
@ 2015-01-26 15:00 Max Reitz
  2015-01-26 15:00 ` [Qemu-devel] [PATCH v3 01/14] block: Lift some BDS functions to the BlockBackend Max Reitz
                   ` (15 more replies)
  0 siblings, 16 replies; 49+ messages in thread
From: Max Reitz @ 2015-01-26 15:00 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Max Reitz, Markus Armbruster, Stefan Hajnoczi,
	Stefano Stabellini

This series removes the "growable" field from the BlockDriverState
object. Its use was to clamp guest requests against the limits of the
BDS; however, this can now be done more easily by moving those checks
into the BlockBackend functions.

In a future series, "growable" may be reintroduced (maybe with a
different name); it will then signify whether a BDS is able to grow (in
contrast to the current "growable", which signifies whether it is
allowed to). Maybe I will add it to the BlockDriver instead of the BDS,
though.

To be able to remove that field, qemu-io needs to be converted to
BlockBackend, which is done by this series as well. While working on
that I decided to convert blk_new_with_bs()+bdrv_open() to
blk_new_open(). I was skeptical about that decision at first, but it
seems good now that I was able to replace nearly every blk_new_with_bs()
call by blk_new_open(). In a future series I may try to convert some
remaining bdrv_open() calls to blk_new_open() as well. (And, in fact, in
a future series I *will* replace the last remaining blk_new_with_bs()
outside of blk_new_open() by blk_new_open().)

Finally, the question needs to be asked: If, after this series, every
BDS is allowed to grow, are there any users which do not use BB, but
should still be disallowed from reading/writing beyond a BDS's limits?
The only users I could see were the block jobs. Some of them should
indeed be converted to BB; but none of them takes a user-supplied offset
or size, all work on the full BDS (or only on parts which have been
modified, etc.). Therefore, it is by design impossible for them to
exceed the BDS's limits, which makes making all BDS's growable safe.


v3:
- Rebased (onto Stefan's branch rebased onto master)
- Fixed patch 4 [Stefano]

v2:
- Rebased [Kevin]
- Patch 2: Added a TODO comment about removing @filename and @flags from
  blk_new_open() when possible [Kevin]


git-backport-diff against v2:

Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/14:[----] [--] 'block: Lift some BDS functions to the BlockBackend'
002/14:[----] [--] 'block: Add blk_new_open()'
003/14:[----] [--] 'blockdev: Use blk_new_open() in blockdev_init()'
004/14:[0004] [FC] 'block/xen: Use blk_new_open() in blk_connect()'
005/14:[----] [--] 'qemu-img: Use blk_new_open() in img_open()'
006/14:[----] [-C] 'qemu-img: Use blk_new_open() in img_rebase()'
007/14:[----] [-C] 'qemu-img: Use BlockBackend as far as possible'
008/14:[----] [--] 'qemu-nbd: Use blk_new_open() in main()'
009/14:[----] [--] 'qemu-io: Use blk_new_open() in openfile()'
010/14:[----] [--] 'qemu-io: Remove "growable" option'
011/14:[----] [--] 'qemu-io: Use BlockBackend'
012/14:[----] [--] 'block: Clamp BlockBackend requests'
013/14:[----] [--] 'block: Remove "growable" from BDS'
014/14:[----] [--] 'block: Keep bdrv_check*_request()'s return value'


git-backport-diff against v1:

Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/14:[----] [--] 'block: Lift some BDS functions to the BlockBackend'
002/14:[0006] [FC] 'block: Add blk_new_open()'
003/14:[----] [-C] 'blockdev: Use blk_new_open() in blockdev_init()'
004/14:[0004] [FC] 'block/xen: Use blk_new_open() in blk_connect()'
005/14:[----] [--] 'qemu-img: Use blk_new_open() in img_open()'
006/14:[----] [-C] 'qemu-img: Use blk_new_open() in img_rebase()'
007/14:[----] [-C] 'qemu-img: Use BlockBackend as far as possible'
008/14:[----] [--] 'qemu-nbd: Use blk_new_open() in main()'
009/14:[----] [--] 'qemu-io: Use blk_new_open() in openfile()'
010/14:[0002] [FC] 'qemu-io: Remove "growable" option'
011/14:[----] [--] 'qemu-io: Use BlockBackend'
012/14:[----] [--] 'block: Clamp BlockBackend requests'
013/14:[----] [--] 'block: Remove "growable" from BDS'
014/14:[----] [--] 'block: Keep bdrv_check*_request()'s return value'


Max Reitz (14):
  block: Lift some BDS functions to the BlockBackend
  block: Add blk_new_open()
  blockdev: Use blk_new_open() in blockdev_init()
  block/xen: Use blk_new_open() in blk_connect()
  qemu-img: Use blk_new_open() in img_open()
  qemu-img: Use blk_new_open() in img_rebase()
  qemu-img: Use BlockBackend as far as possible
  qemu-nbd: Use blk_new_open() in main()
  qemu-io: Use blk_new_open() in openfile()
  qemu-io: Remove "growable" option
  qemu-io: Use BlockBackend
  block: Clamp BlockBackend requests
  block: Remove "growable" from BDS
  block: Keep bdrv_check*_request()'s return value

 block.c                        |  59 +++++-----
 block/block-backend.c          | 219 +++++++++++++++++++++++++++++++++++++
 block/qcow2.c                  |   6 --
 block/raw-posix.c              |   2 +-
 block/raw-win32.c              |   2 +-
 block/sheepdog.c               |   2 +-
 blockdev.c                     |  92 ++++++++--------
 hmp.c                          |   9 +-
 hw/block/xen_disk.c            |  28 +++--
 include/block/block_int.h      |   3 -
 include/qemu-io.h              |   4 +-
 include/sysemu/block-backend.h |  12 +++
 qemu-img.c                     | 171 ++++++++++++++---------------
 qemu-io-cmds.c                 | 238 ++++++++++++++++++++++-------------------
 qemu-io.c                      |  58 ++++------
 qemu-nbd.c                     |  25 ++---
 tests/qemu-iotests/016         |  73 -------------
 tests/qemu-iotests/016.out     |  23 ----
 tests/qemu-iotests/051.out     |  60 +++++------
 tests/qemu-iotests/087.out     |   8 +-
 tests/qemu-iotests/group       |   1 -
 21 files changed, 592 insertions(+), 503 deletions(-)
 delete mode 100755 tests/qemu-iotests/016
 delete mode 100644 tests/qemu-iotests/016.out

-- 
2.1.0

^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2015-02-02 19:54 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-26 15:00 [Qemu-devel] [PATCH v3 00/14] block: Remove "growable", add blk_new_open() Max Reitz
2015-01-26 15:00 ` [Qemu-devel] [PATCH v3 01/14] block: Lift some BDS functions to the BlockBackend Max Reitz
2015-01-26 21:48   ` Eric Blake
2015-01-26 15:00 ` [Qemu-devel] [PATCH v3 02/14] block: Add blk_new_open() Max Reitz
2015-01-26 21:56   ` Eric Blake
2015-01-26 15:00 ` [Qemu-devel] [PATCH v3 03/14] blockdev: Use blk_new_open() in blockdev_init() Max Reitz
2015-01-26 22:37   ` Eric Blake
2015-01-27  2:08     ` Max Reitz
2015-01-26 15:00 ` [Qemu-devel] [PATCH v3 04/14] block/xen: Use blk_new_open() in blk_connect() Max Reitz
2015-01-26 22:46   ` Eric Blake
2015-02-02 18:27   ` Kevin Wolf
2015-02-02 19:41     ` Max Reitz
2015-01-26 15:00 ` [Qemu-devel] [PATCH v3 05/14] qemu-img: Use blk_new_open() in img_open() Max Reitz
2015-01-26 22:47   ` Eric Blake
2015-02-02 18:35   ` Kevin Wolf
2015-02-02 19:42     ` Max Reitz
2015-01-26 15:00 ` [Qemu-devel] [PATCH v3 06/14] qemu-img: Use blk_new_open() in img_rebase() Max Reitz
2015-01-27  3:05   ` Eric Blake
2015-01-27 15:01     ` Max Reitz
2015-02-02 19:00   ` Kevin Wolf
2015-02-02 19:47     ` Max Reitz
2015-01-26 15:00 ` [Qemu-devel] [PATCH v3 07/14] qemu-img: Use BlockBackend as far as possible Max Reitz
2015-01-27  3:38   ` Eric Blake
2015-01-27 15:07     ` Max Reitz
2015-01-26 15:00 ` [Qemu-devel] [PATCH v3 08/14] qemu-nbd: Use blk_new_open() in main() Max Reitz
2015-01-27  4:59   ` Eric Blake
2015-01-26 15:00 ` [Qemu-devel] [PATCH v3 09/14] qemu-io: Use blk_new_open() in openfile() Max Reitz
2015-01-27 16:23   ` Eric Blake
2015-02-02 19:34   ` Kevin Wolf
2015-02-02 19:51     ` Max Reitz
2015-01-26 15:00 ` [Qemu-devel] [PATCH v3 10/14] qemu-io: Remove "growable" option Max Reitz
2015-01-27 16:59   ` Eric Blake
2015-01-27 17:04     ` Max Reitz
2015-01-27 17:10       ` Eric Blake
2015-01-27 17:11         ` Max Reitz
2015-02-02 19:36           ` Kevin Wolf
2015-02-02 19:52             ` Max Reitz
2015-01-26 15:00 ` [Qemu-devel] [PATCH v3 11/14] qemu-io: Use BlockBackend Max Reitz
2015-01-27 17:08   ` Eric Blake
2015-01-26 15:00 ` [Qemu-devel] [PATCH v3 12/14] block: Clamp BlockBackend requests Max Reitz
2015-01-27 17:15   ` Eric Blake
2015-01-26 15:00 ` [Qemu-devel] [PATCH v3 13/14] block: Remove "growable" from BDS Max Reitz
2015-01-27 17:29   ` Eric Blake
2015-02-02 19:46   ` Kevin Wolf
2015-02-02 19:54     ` Max Reitz
2015-01-26 15:00 ` [Qemu-devel] [PATCH v3 14/14] block: Keep bdrv_check*_request()'s return value Max Reitz
2015-01-27 17:36   ` Eric Blake
2015-01-26 15:49 ` [Qemu-devel] [PATCH v3 00/14] block: Remove "growable", add blk_new_open() Stefano Stabellini
2015-02-02 19:50 ` Kevin Wolf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.