From nobody Mon Feb 9 15:16:53 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1509353552391646.817471466084; Mon, 30 Oct 2017 01:52:32 -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 A510EC050047; Mon, 30 Oct 2017 08:52:30 +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 83EAB90F58; Mon, 30 Oct 2017 08:52:30 +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 4D74D1804486; Mon, 30 Oct 2017 08:52:30 +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 v9U8qCXo000992 for ; Mon, 30 Oct 2017 04:52:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4639D7E38D; Mon, 30 Oct 2017 08:52:12 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C8D098CBAB for ; Mon, 30 Oct 2017 08:52:09 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DF2E7796FD for ; Mon, 30 Oct 2017 08:52:08 +0000 (UTC) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9U8nvOl133477 for ; Mon, 30 Oct 2017 04:52:08 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0b-001b2d01.pphosted.com with ESMTP id 2dx03ujn0p-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 30 Oct 2017 04:52:08 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Oct 2017 08:52:06 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 30 Oct 2017 08:52:04 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9U8q4nF27787290; Mon, 30 Oct 2017 08:52:04 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8487252043; Mon, 30 Oct 2017 07:46:07 +0000 (GMT) Received: from powerkvmpok002.pok.stglabs.ibm.com (unknown [9.114.13.10]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 0D1285204D; Mon, 30 Oct 2017 07:46:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A510EC050047 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A510EC050047 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DF2E7796FD Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=kmp@linux.vnet.ibm.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com DF2E7796FD From: Kothapally Madhu Pavan To: libvir-list@redhat.com Date: Mon, 30 Oct 2017 14:21:50 +0530 In-Reply-To: <1509353516-52208-1-git-send-email-kmp@linux.vnet.ibm.com> References: <1509353516-52208-1-git-send-email-kmp@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17103008-0040-0000-0000-00000408587E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17103008-0041-0000-0000-000020AAD68C Message-Id: <1509353516-52208-2-git-send-email-kmp@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-10-30_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710300126 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 205 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 30 Oct 2017 08:52:09 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 30 Oct 2017 08:52:09 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'kmp@linux.vnet.ibm.com' RCPT:'' X-RedHat-Spam-Score: -3.5 (RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Kothapally Madhu Pavan , jdenemar@redhat.com Subject: [libvirt] [PATCH 1/7] qemu: Store inactive domain configuration in snapshot 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: , MIME-Version: 1.0 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.31]); Mon, 30 Oct 2017 08:52:31 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Inorder to capture the exact state of domain, inactive configuration is needed along with active configuration. This patch stores inactive domain configuration when creating snapshot of a running domain. It also captures the inactive snapshot configuration when a snapshot is redefined. Signed-off-by: Kothapally Madhu Pavan --- src/conf/snapshot_conf.c | 13 +++++++++++++ src/conf/snapshot_conf.h | 1 + src/qemu/qemu_driver.c | 10 ++++++++++ 3 files changed, 24 insertions(+) diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index f0e852c..bfe3d6c 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -102,6 +102,7 @@ void virDomainSnapshotDefFree(virDomainSnapshotDefPtr d= ef) virDomainSnapshotDiskDefClear(&def->disks[i]); VIR_FREE(def->disks); virDomainDefFree(def->dom); + virDomainDefFree(def->newDom); virObjectUnref(def->cookie); VIR_FREE(def); } @@ -1336,6 +1337,18 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain, } } =20 + if (other->def->newDom) { + if (def->newDom) { + if (!virDomainDefCheckABIStability(other->def->newDom, + def->newDom, xmlopt)) + goto cleanup; + } else { + /* Transfer the inactive domain def */ + def->newDom =3D other->def->newDom; + other->def->newDom =3D NULL; + } + } + if (other =3D=3D vm->current_snapshot) { *update_current =3D true; vm->current_snapshot =3D NULL; diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h index 1d663c7..0bc915f 100644 --- a/src/conf/snapshot_conf.h +++ b/src/conf/snapshot_conf.h @@ -75,6 +75,7 @@ struct _virDomainSnapshotDef { virDomainSnapshotDiskDef *disks; =20 virDomainDefPtr dom; + virDomainDefPtr newDom; =20 virObjectPtr cookie; =20 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 74fdfdb..4ffec70 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15035,6 +15035,16 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, VIR_DOMAIN_DEF_PARSE_SKIP= _VALIDATE))) goto endjob; =20 + if (vm->newDef) { + if (!(xml =3D qemuDomainDefFormatLive(driver, vm->newDef, priv= ->origCPU, + true, true)) || + !(def->newDom =3D virDomainDefParseString(xml, caps, drive= r->xmlopt, NULL, + VIR_DOMAIN_DEF_PAR= SE_INACTIVE | + VIR_DOMAIN_DEF_PAR= SE_SKIP_VALIDATE))) + goto endjob; + } + + if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY) { align_location =3D VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL; align_match =3D false; --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list