From nobody Mon Feb 9 00:06:59 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 ARC-Seal: i=1; a=rsa-sha256; t=1563883749; cv=none; d=zoho.com; s=zohoarc; b=DcJMCmSrmiYPUIv1x09t85Yfokf6pkY8ADVzlFYdbpk3i8ecyLCkbu5L012jAwD+GtNyerISE7l5JGDuWbL+DwIF16NPQsbRjcC6VPE9PivfNFW5iq2opOEaNOYjjI1Go9KVWx4ys7/nFBgJS7PZQoGswRQ227e7yDCyc1DXz+8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563883749; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=4xmTPhxaPL7kASnLF+PzDyEnSkK6T+8l79YdPZy9iQA=; b=SnOPEikMxMmrkPDzYS11/1KBTVqF+hNoPwPdHGCxppeXtK7nYI+w3iZqKW9ZtaMnsfzDJNhetFJjjJiLkikwk5na7zOHEsIQ+Ywpk74XkRNj4XEncYIv5oARgnqD6bIz0RSr6sPzpbIapLwL9DhqsD56jvI9KqLHi5552rB6HNY= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563883749332131.5613091964981; Tue, 23 Jul 2019 05:09:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EDA023071D7E; Tue, 23 Jul 2019 12:09:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CAEA6173BB; Tue, 23 Jul 2019 12:09:07 +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 905C7180020B; Tue, 23 Jul 2019 12:09:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6NC8xkh009449 for ; Tue, 23 Jul 2019 08:08:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id D66525D704; Tue, 23 Jul 2019 12:08:59 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 621B95B685 for ; Tue, 23 Jul 2019 12:08:59 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 23 Jul 2019 14:08:50 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/7] qemu: snapshot: Initialize data for inactive config of snapshot earlier 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.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 23 Jul 2019 12:09:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" qemuDomainSnapshotDiskDataCollect copies the source of the disk from the live config into the inactive config. Move this operation earlier so that if we initialize it for use for the particular instance the run-time-only data is not copied. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 042efae49f..69327c148a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15114,6 +15114,22 @@ qemuDomainSnapshotDiskDataCollect(virQEMUDriverPtr= driver, if (virStorageSourceInitChainElement(dd->src, dd->disk->src, false= ) < 0) goto cleanup; + /* Note that it's unsafe to assume that the disks in the persistent + * definition match up with the disks in the live definition just = by + * checking that the target name is the same. We've done that + * historically this way though. */ + if (vm->newDef && + (dd->persistdisk =3D virDomainDiskByName(vm->newDef, dd->disk-= >dst, + false))) { + + if (!(dd->persistsrc =3D virStorageSourceCopy(dd->src, false))) + goto cleanup; + + if (virStorageSourceInitChainElement(dd->persistsrc, + dd->persistdisk->src, fal= se) < 0) + goto cleanup; + } + if (qemuDomainStorageFileInit(driver, vm, dd->src, NULL) < 0) goto cleanup; @@ -15131,22 +15147,6 @@ qemuDomainSnapshotDiskDataCollect(virQEMUDriverPtr= driver, VIR_FREE(backingStoreStr); } } - - /* Note that it's unsafe to assume that the disks in the persistent - * definition match up with the disks in the live definition just = by - * checking that the target name is the same. We've done that - * historically this way though. */ - if (vm->newDef && - (dd->persistdisk =3D virDomainDiskByName(vm->newDef, dd->disk-= >dst, - false))) { - - if (!(dd->persistsrc =3D virStorageSourceCopy(dd->src, false))) - goto cleanup; - - if (virStorageSourceInitChainElement(dd->persistsrc, - dd->persistdisk->src, fal= se) < 0) - goto cleanup; - } } VIR_STEAL_PTR(*rdata, data); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list