From: Max Reitz <mreitz@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 9/9] block: Remove BlockDriverState.blk
Date: Tue, 29 Mar 2016 20:59:56 +0200 [thread overview]
Message-ID: <56FAD0AC.8090900@redhat.com> (raw)
In-Reply-To: <1458675397-24956-10-git-send-email-kwolf@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 3135 bytes --]
On 22.03.2016 20:36, Kevin Wolf wrote:
> This patch removes the remaining users of bs->blk, which will allow us
> to have multiple BBs on top of a single BDS. All checks that are
> currently in place to prevent the user from creating such setups.
I think this sentence is missing a word or two.
> Future patches can allow them and e.g. enable users to mirror to a block
> device that already has a BlockBackend on it.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> block.c | 8 --------
> block/block-backend.c | 8 --------
> block/mirror.c | 4 ++--
> blockdev.c | 19 ++++++++-----------
> include/block/block_int.h | 2 --
> tests/qemu-iotests/085.out | 6 +++---
> 6 files changed, 13 insertions(+), 34 deletions(-)
[...]
> diff --git a/blockdev.c b/blockdev.c
> index c59cf3e..a658869 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -1774,9 +1774,8 @@ static void external_snapshot_prepare(BlkActionState *common,
> return;
> }
>
> - if (state->new_bs->blk != NULL) {
> - error_setg(errp, "The snapshot is already in use by %s",
> - blk_name(state->new_bs->blk));
> + if (bdrv_has_blk(state->new_bs)) {
> + error_setg(errp, "The snapshot is already in use");
You did add bdrv_get_parent_name(), so you could use it here...
> return;
> }
>
> @@ -2492,9 +2491,8 @@ void qmp_x_blockdev_insert_medium(const char *device, const char *node_name,
> return;
> }
>
> - if (bs->blk) {
> - error_setg(errp, "Node '%s' is already in use by '%s'", node_name,
> - blk_name(bs->blk));
> + if (bdrv_has_blk(bs)) {
> + error_setg(errp, "Node '%s' is already in use", node_name);
...and here...
> return;
> }
>
> @@ -3439,7 +3437,7 @@ static void blockdev_mirror_common(BlockDriverState *bs,
> if (bdrv_op_is_blocked(target, BLOCK_OP_TYPE_MIRROR_TARGET, errp)) {
> return;
> }
> - if (target->blk) {
> + if (bdrv_has_blk(target)) {
> error_setg(errp, "Cannot mirror to an attached block device");
> return;
> }
> @@ -4023,15 +4021,14 @@ void qmp_x_blockdev_del(bool has_id, const char *id,
> bs = blk_bs(blk);
> aio_context = blk_get_aio_context(blk);
> } else {
> + blk = NULL;
> bs = bdrv_find_node(node_name);
> if (!bs) {
> error_setg(errp, "Cannot find node %s", node_name);
> return;
> }
> - blk = bs->blk;
> - if (blk) {
> - error_setg(errp, "Node %s is in use by %s",
> - node_name, blk_name(blk));
> + if (bdrv_has_blk(bs)) {
> + error_setg(errp, "Node %s is in use", node_name);
...and here.
If you consciously decide not to use it there, and after you have fixed
the commit message:
Reviewed-by: Max Reitz <mreitz@redhat.com>
> return;
> }
> aio_context = bdrv_get_aio_context(bs);
[...]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2016-03-29 19:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-22 19:36 [Qemu-devel] [PATCH 0/9] block: Remove BlockDriverState.blk Kevin Wolf
2016-03-22 19:36 ` [Qemu-devel] [PATCH 1/9] block: Use BdrvChild callbacks for change_media/resize Kevin Wolf
2016-03-29 17:36 ` Max Reitz
2016-03-22 19:36 ` [Qemu-devel] [PATCH 2/9] block: User BdrvChild callback for device name Kevin Wolf
2016-03-29 17:43 ` Max Reitz
2016-03-22 19:36 ` [Qemu-devel] [PATCH 3/9] block jobs: Use BdrvChild callbacks for iostatus operations Kevin Wolf
2016-03-29 18:15 ` Max Reitz
2016-03-22 19:36 ` [Qemu-devel] [PATCH 4/9] block: Remove bdrv_aio_multiwrite() Kevin Wolf
2016-03-29 18:22 ` Max Reitz
2016-03-22 19:36 ` [Qemu-devel] [PATCH 5/9] block: Avoid BDS.blk in bdrv_next() Kevin Wolf
2016-03-29 18:26 ` Max Reitz
2016-03-22 19:36 ` [Qemu-devel] [PATCH 6/9] block: Remove bdrv_move_feature_fields() Kevin Wolf
2016-03-29 18:28 ` Max Reitz
2016-03-22 19:36 ` [Qemu-devel] [PATCH 7/9] block: Avoid bs->blk in bdrv_next() Kevin Wolf
2016-03-29 18:50 ` Max Reitz
2016-03-22 19:36 ` [Qemu-devel] [PATCH 8/9] block: Don't return throttling info in query-named-block-nodes Kevin Wolf
2016-03-29 18:53 ` Max Reitz
2016-03-22 19:36 ` [Qemu-devel] [PATCH 9/9] block: Remove BlockDriverState.blk Kevin Wolf
2016-03-29 18:59 ` Max Reitz [this message]
2016-03-22 21:34 ` [Qemu-devel] [PATCH 0/9] " Paolo Bonzini
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=56FAD0AC.8090900@redhat.com \
--to=mreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).