From nobody Sun Feb 8 12:57:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1553277712166393.88673419272914; Fri, 22 Mar 2019 11:01:52 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5F8CE88AA0; Fri, 22 Mar 2019 18:01:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2BE2616D34; Fri, 22 Mar 2019 18:01:50 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D1B193F5CF; Fri, 22 Mar 2019 18:01:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2MI1auV009056 for ; Fri, 22 Mar 2019 14:01:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 40C5F5D9D6; Fri, 22 Mar 2019 18:01:36 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id BDAFD5D9D2 for ; Fri, 22 Mar 2019 18:01:35 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 22 Mar 2019 19:01:04 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 28/29] conf: Parse and format 'backingStore' for disk X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 22 Mar 2019 18:01:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" When the block copy operation is started with a reused external file in incremental mode libvirt will need to open and insert the backing chain for that file into qemu (in -blockdev mode). This means that we'll need to track the backing chain and metadata such as node names for the full chain of . This patch invokes the full backing chain formatter and parser for so that the chain can be kept with . Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 5 +++++ tests/qemustatusxml2xmldata/blockjob-mirror-in.xml | 13 +++++++++++++ tests/qemuxml2argvdata/disk-mirror.xml | 6 ++++++ tests/qemuxml2xmloutdata/disk-mirror-active.xml | 6 ++++++ 5 files changed, 31 insertions(+) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 1828e0795b..623ef28719 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5676,6 +5676,7 @@ + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 2514c60744..0970d48045 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9351,6 +9351,8 @@ virDomainDiskDefMirrorParse(virDomainDiskDefPtr def, if (mirrorType) { if (virDomainStorageSourceParse(NULL, ctxt, def->mirror, flags, xm= lopt) < 0) return -1; + if (virDomainDiskBackingStoreParse(ctxt, def->mirror, flags, xmlop= t) < 0) + return -1; } else { /* For back-compat reasons, we handle a file name encoded as * attributes, even though we prefer modern output in the style of @@ -24033,6 +24035,9 @@ virDomainDiskDefFormatMirror(virBufferPtr buf, if (virDomainDiskSourceFormat(&childBuf, disk->mirror, 0, false, flags= , xmlopt) < 0) return -1; + if (virDomainDiskBackingStoreFormat(&childBuf, disk->mirror, xmlopt, f= lags) < 0) + return -1; + if (virXMLFormatElement(buf, "mirror", &attrBuf, &childBuf) < 0) return -1; diff --git a/tests/qemustatusxml2xmldata/blockjob-mirror-in.xml b/tests/qem= ustatusxml2xmldata/blockjob-mirror-in.xml index 32bde1ba66..df23ac00aa 100644 --- a/tests/qemustatusxml2xmldata/blockjob-mirror-in.xml +++ b/tests/qemustatusxml2xmldata/blockjob-mirror-in.xml @@ -65,6 +65,7 @@ +
@@ -76,6 +77,18 @@ + + + + + + + + + + + +
diff --git a/tests/qemuxml2argvdata/disk-mirror.xml b/tests/qemuxml2argvdat= a/disk-mirror.xml index e89eee47ed..c1e6e94e33 100644 --- a/tests/qemuxml2argvdata/disk-mirror.xml +++ b/tests/qemuxml2argvdata/disk-mirror.xml @@ -36,6 +36,7 @@ + @@ -45,6 +46,11 @@ + + + + + diff --git a/tests/qemuxml2xmloutdata/disk-mirror-active.xml b/tests/qemuxm= l2xmloutdata/disk-mirror-active.xml index d689eac6b8..32ffc647be 100644 --- a/tests/qemuxml2xmloutdata/disk-mirror-active.xml +++ b/tests/qemuxml2xmloutdata/disk-mirror-active.xml @@ -40,6 +40,7 @@ +
@@ -51,6 +52,11 @@ + + + + +
--=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list