Received: from eggs.gnu.org ([2001:4830:134:3::10]:34209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Urgyf-0004m0-P7 for qemu-devel@nongnu.org; Wed, 26 Jun 2013 00:05:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Urgyd-0003Db-Ac for qemu-devel@nongnu.org; Wed, 26 Jun 2013 00:05:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38841) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Urgyd-0003BS-3j for qemu-devel@nongnu.org; Wed, 26 Jun 2013 00:05:03 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5Q452Cc011340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 26 Jun 2013 00:05:02 -0400 From: Fam Zheng Date: Wed, 26 Jun 2013 11:59:20 +0800 Message-Id: <1372219161-12209-3-git-send-email-famz@redhat.com> In-Reply-To: <1372219161-12209-1-git-send-email-famz@redhat.com> References: <1372219161-12209-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [RFC PATCH 2/3] block: assign backing relationship in drive-backup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, obarenbo@redhat.com, roliveri@redhat.com, hbrock@redhat.com, rjones@redhat.com, armbru@redhat.com, pmyers@redhat.com, imain@redhat.com, stefanha@redhat.com, pbonzini@redhat.com 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 --- 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