qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Eric Blake <eblake@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: Max Reitz <mreitz@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Kevin Wolf <kwolf@redhat.com>
Subject: Re: [Qemu-devel] [RFC PATCH 1/2] block: allow blockdev-backup from any source
Date: Wed, 27 Jun 2018 02:00:57 -0400	[thread overview]
Message-ID: <12876318-b3e4-d498-ed99-d75326efd4f3@redhat.com> (raw)
In-Reply-To: <67381f57-d8a6-b8e2-ac70-9e0fa10cbd94@redhat.com>



On 06/26/2018 09:38 PM, Eric Blake wrote:
> On 06/26/2018 05:22 PM, John Snow wrote:
>> In the case of image fleecing, the node we choose as the source
>> for a blockdev-backup is going to be both a root node AND the
>> backing node for the exported image. It does not qualify as a root
>> image in this case.
>>
>> Loosen the restriction.
> 
> Did we regress (and if so, when), or has this never worked?  But you are
> right: visually, we are starting with:

It's actually a regression, because I had a variant of this test in my
local files that used to work. We never really advertised or tested this
feature, though, so ...

> 
>                   Device
> Base (backing) <- Top (active)
> 
> then want to add nodes for an NBD export:
>                   Device    NBD
> Base (backing) <- Top    <- Tmp

          [device] --> [active]
                          ^
[nbd] --> [fleecing]------'


So active here has two parents: the device root, and the temporary
fleecing node. This disqualifies it from being the source in
blockdev_backup, but there's no real reason to.

If the caller of blockdev_backup chooses a dumb source node they'll get
dumb data. GIGO.

> 
> with a blockdev-backup "sync":"none" from Top to Tmp (any writes from
> the Device first copy the old data to Tmp; the NBD export sees a
> read-only view of Tmp that is unchanging from the time the backup job
> started, regardless of what the Device does in the meantime).
> 
> Then when the fleece job ends, the NBD export is stopped, the
> blockdev-backup job is canceled, and Tmp is thrown away as unneeded.
> 

Yup, highlighted a little better in the next patch.

>>
>> Signed-off-by: John Snow <jsnow@redhat.com>
>> ---
>>   blockdev.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/blockdev.c b/blockdev.c
>> index 58d7570932..526f8b60be 100644
>> --- a/blockdev.c
>> +++ b/blockdev.c
>> @@ -3517,7 +3517,7 @@ BlockJob *do_blockdev_backup(BlockdevBackup
>> *backup, JobTxn *txn,
>>           backup->compress = false;
>>       }
>>   -    bs = qmp_get_root_bs(backup->device, errp);
>> +    bs = bdrv_lookup_bs(backup->device, backup->device, errp);
> 
> Reviewed-by: Eric Blake <eblake@redhat.com>
> 
>>       if (!bs) {
>>           return NULL;
>>       }
>>
> 

  reply	other threads:[~2018-06-27  6:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-26 22:22 [Qemu-devel] [RFC PATCH 0/2] iotests: fleecing test John Snow
2018-06-26 22:22 ` [Qemu-devel] [RFC PATCH 1/2] block: allow blockdev-backup from any source John Snow
2018-06-27  1:38   ` Eric Blake
2018-06-27  6:00     ` John Snow [this message]
2018-06-26 22:22 ` [Qemu-devel] [RFC PATCH 2/2] iotests: add 222 to test basic fleecing John Snow
2018-06-27  1:49   ` Eric Blake
2018-06-27  5:51     ` John Snow
2018-06-27 12:28       ` [Qemu-devel] [Qemu-block] " Kashyap Chamarthy

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=12876318-b3e4-d498-ed99-d75326efd4f3@redhat.com \
    --to=jsnow@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@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).