qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [RFC PATCH 2/3] block: assign backing relationship in drive


From: Fam Zheng
Subject: [Qemu-devel] [RFC PATCH 2/3] block: assign backing relationship in drive-backup
Date: Wed, 26 Jun 2013 11:59:20 +0800

Assign source image as the backing hd of target bs, so reading target bs
gets the point-in-time copy of data from source image.

Signed-off-by: Fam Zheng <address@hidden>
---
 blockdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/blockdev.c b/blockdev.c
index 5e694f3..a1d816e 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1504,6 +1504,10 @@ void qmp_drive_backup(const char *device, const char 
*target,
         return;
     }
 
+    target_bs->backing_hd = bs;
+    pstrcpy(target_bs->backing_file, sizeof(target_bs->backing_file),
+            bs->filename);
+
     backup_start(bs, target_bs, speed, on_source_error, on_target_error,
                  block_job_cb, bs, &local_err);
     if (local_err != NULL) {
-- 
1.8.3.1




reply via email to

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