From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: vsementsov@virtuozzo.com, jsnow@redhat.com,
qemu-stable@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
Max Reitz <mreitz@redhat.com>,
"open list:Network Block Dev..." <qemu-block@nongnu.org>
Subject: [Qemu-devel] [PATCH 2/3] nbd/client: Make x-dirty-bitmap more reliable
Date: Thu, 29 Nov 2018 20:32:31 -0600 [thread overview]
Message-ID: <20181130023232.3079982-3-eblake@redhat.com> (raw)
In-Reply-To: <20181130023232.3079982-1-eblake@redhat.com>
The implementation of x-dirty-bitmap in qemu 3.0 silently
falls back to treating the server as not supporting
NBD_CMD_BLOCK_STATUS if a requested meta_context name was not
negotiated, which in turn means treating the _entire_ image as
data. Since our hack relied on using 'qemu-img map' to view
which portions of the image were dirty by seeing what the
redirected bdrv_block_status() treats as holes, this means
that our fallback treats the entire image as clean. Better
would have been to treat the entire image as dirty, or to fail
to connect because the user's request for a specific context
could not be honored. This patch goes with the latter.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
block/nbd-client.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/block/nbd-client.c b/block/nbd-client.c
index 76e9ca3abeb..e6e27dafa6a 100644
--- a/block/nbd-client.c
+++ b/block/nbd-client.c
@@ -992,6 +992,11 @@ int nbd_client_init(BlockDriverState *bs,
logout("Failed to negotiate with the NBD server\n");
return ret;
}
+ if (x_dirty_bitmap && !client->info.base_allocation) {
+ error_setg(errp, "requested x-dirty-bitmap %s not found",
+ x_dirty_bitmap);
+ return -EINVAL;
+ }
if (client->info.flags & NBD_FLAG_READ_ONLY) {
ret = bdrv_apply_auto_read_only(bs, "NBD export is read-only", errp);
if (ret < 0) {
--
2.17.2
next prev parent reply other threads:[~2018-11-30 2:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-30 2:32 [Qemu-devel] [PATCH for-3.1? 0/3] NBD dirty bitmap cleanups Eric Blake
2018-11-30 2:32 ` [Qemu-devel] [PATCH 1/3] nbd/server: Advertise all contexts in response to bare LIST Eric Blake
2018-11-30 8:02 ` Vladimir Sementsov-Ogievskiy
2018-11-30 2:32 ` Eric Blake [this message]
2018-11-30 8:21 ` [Qemu-devel] [PATCH 2/3] nbd/client: Make x-dirty-bitmap more reliable Vladimir Sementsov-Ogievskiy
2018-11-30 2:32 ` [Qemu-devel] [PATCH 3/3] nbd/client: Send NBD_CMD_DISC if open fails after connect Eric Blake
2018-11-30 8:29 ` Vladimir Sementsov-Ogievskiy
2018-11-30 15:25 ` [Qemu-devel] [PATCH for-3.1? 0/3] NBD dirty bitmap cleanups Eric Blake
2018-12-03 15:03 ` Peter Maydell
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=20181130023232.3079982-3-eblake@redhat.com \
--to=eblake@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=vsementsov@virtuozzo.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).