From: Max Reitz <mreitz@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH 00/14] block: Remove "growable", add blk_new_open()
Date: Thu, 11 Dec 2014 14:20:39 +0100 [thread overview]
Message-ID: <1418304053-15140-1-git-send-email-mreitz@redhat.com> (raw)
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.
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.
This series depends on "[PATCH v3 0/3] iotests: Fix test 039".
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 | 213 ++++++++++++++++++++++++++++++++++++
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 | 24 ++---
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, 584 insertions(+), 501 deletions(-)
delete mode 100755 tests/qemu-iotests/016
delete mode 100644 tests/qemu-iotests/016.out
--
1.9.3
next reply other threads:[~2014-12-11 13:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-11 13:20 Max Reitz [this message]
2014-12-11 13:20 ` [Qemu-devel] [PATCH 01/14] block: Lift some BDS functions to the BlockBackend Max Reitz
2014-12-11 13:20 ` [Qemu-devel] [PATCH 02/14] block: Add blk_new_open() Max Reitz
2014-12-18 15:19 ` Kevin Wolf
2014-12-19 9:26 ` Max Reitz
2014-12-11 13:20 ` [Qemu-devel] [PATCH 03/14] blockdev: Use blk_new_open() in blockdev_init() Max Reitz
2014-12-11 13:20 ` [Qemu-devel] [PATCH 04/14] block/xen: Use blk_new_open() in blk_connect() Max Reitz
2014-12-11 13:20 ` [Qemu-devel] [PATCH 05/14] qemu-img: Use blk_new_open() in img_open() Max Reitz
2014-12-11 13:20 ` [Qemu-devel] [PATCH 06/14] qemu-img: Use blk_new_open() in img_rebase() Max Reitz
2014-12-11 13:20 ` [Qemu-devel] [PATCH 07/14] qemu-img: Use BlockBackend as far as possible Max Reitz
2014-12-11 13:20 ` [Qemu-devel] [PATCH 08/14] qemu-nbd: Use blk_new_open() in main() Max Reitz
2014-12-11 13:20 ` [Qemu-devel] [PATCH 09/14] qemu-io: Use blk_new_open() in openfile() Max Reitz
2014-12-11 13:20 ` [Qemu-devel] [PATCH 10/14] qemu-io: Remove "growable" option Max Reitz
2014-12-11 13:20 ` [Qemu-devel] [PATCH 11/14] qemu-io: Use BlockBackend Max Reitz
2014-12-11 13:20 ` [Qemu-devel] [PATCH 12/14] block: Clamp BlockBackend requests Max Reitz
2014-12-11 13:20 ` [Qemu-devel] [PATCH 13/14] block: Remove "growable" from BDS Max Reitz
2014-12-11 13:20 ` [Qemu-devel] [PATCH 14/14] block: Keep bdrv_check*_request()'s return value Max Reitz
2014-12-18 15:16 ` [Qemu-devel] [PATCH 00/14] block: Remove "growable", add blk_new_open() Kevin Wolf
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=1418304053-15140-1-git-send-email-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=armbru@redhat.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).