From patchwork Wed Jun 26 03:59:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 254565 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id F03E32C0082 for ; Wed, 26 Jun 2013 14:05:36 +1000 (EST) Received: from localhost ([::1]:45092 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Urgz8-0004ux-Mj for incoming@patchwork.ozlabs.org; Wed, 26 Jun 2013 00:05:34 -0400 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 Received: from t430s.nay.redhat.com ([10.66.7.14]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r5Q44bbS003751; Wed, 26 Jun 2013 00:04:55 -0400 From: Fam Zheng To: qemu-devel@nongnu.org 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> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 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 Subject: [Qemu-devel] [RFC PATCH 2/3] block: assign backing relationship in drive-backup X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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) {