[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 1/2] block: allow blockdev-backup from any s

From: Eric Blake
Subject: Re: [Qemu-devel] [RFC PATCH 1/2] block: allow blockdev-backup from any source
Date: Tue, 26 Jun 2018 20:38:16 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

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:

Base (backing) <- Top (active)

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

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.

Signed-off-by: John Snow <address@hidden>
  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 <address@hidden>

      if (!bs) {
          return NULL;

Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]