From nobody Sun May 19 16:58:46 2024 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 From nobody Sun May 19 16:58:46 2024 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 1509353537688457.73346043357583; Mon, 30 Oct 2017 01:52:17 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D33B57EA95; Mon, 30 Oct 2017 08:52:15 +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 7D73C889F8; Mon, 30 Oct 2017 08:52:15 +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 43E416EF21; Mon, 30 Oct 2017 08:52:15 +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 v9U8qEZE001016 for ; Mon, 30 Oct 2017 04:52:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2E4C48CB9E; Mon, 30 Oct 2017 08:52:14 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 258BA8CBAF for ; Mon, 30 Oct 2017 08:52:14 +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 7117D267E0 for ; Mon, 30 Oct 2017 08:52:12 +0000 (UTC) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9U8nUKq120757 for ; Mon, 30 Oct 2017 04:52:11 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2dwyk5m07b-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 30 Oct 2017 04:52:11 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Oct 2017 08:52:09 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 30 Oct 2017 08:52:07 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9U8q67522872250; Mon, 30 Oct 2017 08:52:06 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E2BB52047; Mon, 30 Oct 2017 07:46:10 +0000 (GMT) Received: from powerkvmpok002.pok.stglabs.ibm.com (unknown [9.114.13.10]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id EF86652045; Mon, 30 Oct 2017 07:46:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D33B57EA95 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx04.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 D33B57EA95 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7117D267E0 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx06.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 7117D267E0 From: Kothapally Madhu Pavan To: libvir-list@redhat.com Date: Mon, 30 Oct 2017 14:21:51 +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-0020-0000-0000-000003C65410 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17103008-0021-0000-0000-0000425B42C9 Message-Id: <1509353516-52208-3-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=1 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.30]); Mon, 30 Oct 2017 08:52:12 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 30 Oct 2017 08:52:12 +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.30 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 2/7] qemu: Use active and inactive snapshot configuration on restore 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 30 Oct 2017 08:52:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" By default, active and inactive XMl snapshot configurations are assigned to domain definition. This will make sure that all the non-persistent configurations of the snapshot are restored back as it is. This patch will also make sure that user has a choice to choose of using active XML configuration of snapshot as both active and inactive XML configurations of the restoring domain. Signed-off-by: Kothapally Madhu Pavan --- include/libvirt/libvirt-domain-snapshot.h | 10 +++++++--- src/qemu/qemu_driver.c | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/include/libvirt/libvirt-domain-snapshot.h b/include/libvirt/li= bvirt-domain-snapshot.h index 0f73f24..67ccb59 100644 --- a/include/libvirt/libvirt-domain-snapshot.h +++ b/include/libvirt/libvirt-domain-snapshot.h @@ -184,9 +184,13 @@ int virDomainSnapshotHasMetadata(virDomainSnapshotPtr = snapshot, unsigned int flags); =20 typedef enum { - VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING =3D 1 << 0, /* Run after revert */ - VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED =3D 1 << 1, /* Pause after revert */ - VIR_DOMAIN_SNAPSHOT_REVERT_FORCE =3D 1 << 2, /* Allow risky reverts = */ + VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING =3D 1 << 0, /* Run after reve= rt */ + VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED =3D 1 << 1, /* Pause after re= vert */ + VIR_DOMAIN_SNAPSHOT_REVERT_FORCE =3D 1 << 2, /* Allow risky re= verts */ + VIR_DOMAIN_SNAPSHOT_REVERT_ACTIVE_ONLY =3D 1 << 3, /* Use active sna= pshot + configurations a= s both + active and inact= ive + domain configura= tions*/ } virDomainSnapshotRevertFlags; =20 /* Revert the domain to a point-in-time snapshot. The diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 4ffec70..aecfcff 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15577,6 +15577,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sna= pshot, qemuDomainObjPrivatePtr priv; int rc; virDomainDefPtr config =3D NULL; + virDomainDefPtr newConfig =3D NULL; virQEMUDriverConfigPtr cfg =3D NULL; virCapsPtr caps =3D NULL; bool was_running =3D false; @@ -15586,7 +15587,8 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sna= pshot, =20 virCheckFlags(VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING | VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED | - VIR_DOMAIN_SNAPSHOT_REVERT_FORCE, -1); + VIR_DOMAIN_SNAPSHOT_REVERT_FORCE | + VIR_DOMAIN_SNAPSHOT_REVERT_ACTIVE_ONLY, -1); =20 /* We have the following transitions, which create the following event= s: * 1. inactive -> inactive: none @@ -15688,6 +15690,16 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sn= apshot, goto endjob; } =20 + /* Prepare to copy snapshot inactive xml as inactive configuration + * of this domain unless user exclusively specify not to copy it */ + if (!(flags & VIR_DOMAIN_SNAPSHOT_REVERT_ACTIVE_ONLY) && + snap->def->newDom) { + newConfig =3D virDomainDefCopy(snap->def->newDom, caps, + driver->xmlopt, NULL, true); + if (!newConfig) + goto endjob; + } + cookie =3D (qemuDomainSaveCookiePtr) snap->def->cookie; =20 switch ((virDomainState) snap->def->state) { @@ -15785,12 +15797,16 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr s= napshot, virCPUDefFree(priv->origCPU); VIR_STEAL_PTR(priv->origCPU, origCPU); } + if (newConfig) + vm->newDef =3D newConfig; } else { /* Transitions 2, 3 */ load: was_stopped =3D true; if (config) virDomainObjAssignDef(vm, config, false, NULL); + if (newConfig) + vm->newDef =3D newConfig; =20 /* No cookie means libvirt which saved the domain was too old = to * mess up the CPU definitions. @@ -15884,6 +15900,8 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sna= pshot, } if (config) virDomainObjAssignDef(vm, config, false, NULL); + if (newConfig) + vm->newDef =3D newConfig; =20 if (flags & (VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING | VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED)) { --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 19 16:58:46 2024 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 1509353559148479.9066014615307; Mon, 30 Oct 2017 01:52:39 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6A9C761D1A; Mon, 30 Oct 2017 08:52:37 +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 451E798E42; Mon, 30 Oct 2017 08:52:37 +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 0E5B91805961; Mon, 30 Oct 2017 08:52:37 +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 v9U8qH6J001029 for ; Mon, 30 Oct 2017 04:52:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 842157E38D; Mon, 30 Oct 2017 08:52:17 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7D76E8CBB0 for ; Mon, 30 Oct 2017 08:52:17 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 AA6D049010 for ; Mon, 30 Oct 2017 08:52:16 +0000 (UTC) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9U8nSEN133343 for ; Mon, 30 Oct 2017 04:52:16 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2dwwk1s2w0-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 30 Oct 2017 04:52:16 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Oct 2017 08:52:13 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 30 Oct 2017 08:52:10 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9U8qAmj20512944; Mon, 30 Oct 2017 08:52:10 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E337D5204C; Mon, 30 Oct 2017 07:46:13 +0000 (GMT) Received: from powerkvmpok002.pok.stglabs.ibm.com (unknown [9.114.13.10]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 6D06952043; Mon, 30 Oct 2017 07:46:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6A9C761D1A Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx10.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 6A9C761D1A DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AA6D049010 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx09.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 AA6D049010 From: Kothapally Madhu Pavan To: libvir-list@redhat.com Date: Mon, 30 Oct 2017 14:21:52 +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-0016-0000-0000-000004FB57D3 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17103008-0017-0000-0000-00002836DA33 Message-Id: <1509353516-52208-4-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.38]); Mon, 30 Oct 2017 08:52:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 30 Oct 2017 08:52:16 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-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.156.1 mx0a-001b2d01.pphosted.com 148.163.156.1 mx0a-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 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 3/7] conf: Allow editing inactive snapshot configuration 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 30 Oct 2017 08:52:38 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch will allow user to edit the inactive XML snapshot configuration when it is available in the snapshot. Signed-off-by: Kothapally Madhu Pavan --- include/libvirt/libvirt-domain.h | 1 + src/conf/domain_conf.c | 6 ++++-- src/conf/domain_conf.h | 2 ++ src/conf/snapshot_conf.c | 35 ++++++++++++++++++++++++++++++++++- src/qemu/qemu_driver.c | 3 ++- 5 files changed, 43 insertions(+), 4 deletions(-) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index 4048acf..e70c664 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -1546,6 +1546,7 @@ typedef enum { VIR_DOMAIN_XML_INACTIVE =3D (1 << 1), /* dump inactive domain info= rmation */ VIR_DOMAIN_XML_UPDATE_CPU =3D (1 << 2), /* update guest CPU requirem= ents according to host CPU */ VIR_DOMAIN_XML_MIGRATABLE =3D (1 << 3), /* dump XML suitable for mig= ration */ + VIR_DOMAIN_XML_ACTIVE_ONLY =3D (1 << 4), /* dump active XML and avoid= inactive XML in snapshot */ } virDomainXMLFlags; =20 char * virDomainGetXMLDesc (virDomainPtr domain, diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 77c20c6..36cebe5 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -25687,8 +25687,8 @@ virDomainDefFormatInternal(virDomainDefPtr def, VIR_DOMAIN_DEF_FORMAT_STATUS | VIR_DOMAIN_DEF_FORMAT_ACTUAL_NET | VIR_DOMAIN_DEF_FORMAT_PCI_ORIG_STATES | - VIR_DOMAIN_DEF_FORMAT_CLOCK_ADJUST, - -1); + VIR_DOMAIN_DEF_FORMAT_CLOCK_ADJUST | + VIR_DOMAIN_DEF_FORMAT_ACTIVE_ONLY, -1); =20 if (!(type =3D virDomainVirtTypeToString(def->virtType))) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -26472,6 +26472,8 @@ unsigned int virDomainDefFormatConvertXMLFlags(unsi= gned int flags) formatFlags |=3D VIR_DOMAIN_DEF_FORMAT_INACTIVE; if (flags & VIR_DOMAIN_XML_MIGRATABLE) formatFlags |=3D VIR_DOMAIN_DEF_FORMAT_MIGRATABLE; + if (flags & VIR_DOMAIN_XML_ACTIVE_ONLY) + formatFlags |=3D VIR_DOMAIN_DEF_FORMAT_ACTIVE_ONLY; =20 return formatFlags; } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 38de70b..0659220 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2853,6 +2853,8 @@ typedef enum { VIR_DOMAIN_DEF_FORMAT_ALLOW_ROM =3D 1 << 6, VIR_DOMAIN_DEF_FORMAT_ALLOW_BOOT =3D 1 << 7, VIR_DOMAIN_DEF_FORMAT_CLOCK_ADJUST =3D 1 << 8, + /* format active XML and avoid inactive XML */ + VIR_DOMAIN_DEF_FORMAT_ACTIVE_ONLY =3D 1 << 9, } virDomainDefFormatFlags; =20 /* Use these flags to skip specific domain ABI consistency checks done diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index bfe3d6c..3cb7cd4 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -290,6 +290,29 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt, } else { VIR_WARN("parsing older snapshot that lacks domain"); } + + /* Older snapshots were created without inactive domain configurat= ion. + * In that case, leave the newDom NULL. */ + if ((tmp =3D virXPathString("string(./inactiveDomain/domain/@type)= ", ctxt))) { + int domainflags =3D VIR_DOMAIN_DEF_PARSE_INACTIVE | + VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE; + if (flags & VIR_DOMAIN_SNAPSHOT_PARSE_INTERNAL) + domainflags |=3D VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS; + xmlNodePtr domainNode =3D virXPathNode("./inactiveDomain/domai= n", ctxt); + + VIR_FREE(tmp); + if (domainNode) { + def->newDom =3D virDomainDefParseNode(ctxt->node->doc, dom= ainNode, + caps, xmlopt, NULL, do= mainflags); + if (!def->newDom) + goto cleanup; + } else { + VIR_WARN("missing inactive domain in snapshot"); + } + } else { + VIR_WARN("parsing older snapshot that lacks inactive domain"); + } + } else { def->creationTime =3D tv.tv_sec; } @@ -705,7 +728,8 @@ virDomainSnapshotDefFormat(const char *domain_uuid, virBuffer buf =3D VIR_BUFFER_INITIALIZER; size_t i; =20 - virCheckFlags(VIR_DOMAIN_DEF_FORMAT_SECURE, NULL); + virCheckFlags(VIR_DOMAIN_DEF_FORMAT_SECURE | + VIR_DOMAIN_DEF_FORMAT_ACTIVE_ONLY, NULL); =20 flags |=3D VIR_DOMAIN_DEF_FORMAT_INACTIVE; =20 @@ -757,6 +781,15 @@ virDomainSnapshotDefFormat(const char *domain_uuid, virBufferAddLit(&buf, "\n"); } =20 + if (def->newDom && !(flags & VIR_DOMAIN_DEF_FORMAT_ACTIVE_ONLY)) { + virBufferAddLit(&buf, "\n"); + virBufferAdjustIndent(&buf, 2); + if (virDomainDefFormatInternal(def->newDom, caps, flags, &buf) < 0) + goto error; + virBufferAdjustIndent(&buf, -2); + virBufferAddLit(&buf, "\n"); + } + if (virSaveCookieFormatBuf(&buf, def->cookie, virDomainXMLOptionGetSaveCookie(xmlopt)) < = 0) goto error; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index aecfcff..a0a4384 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15469,7 +15469,8 @@ qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr s= napshot, virDomainSnapshotObjPtr snap =3D NULL; char uuidstr[VIR_UUID_STRING_BUFLEN]; =20 - virCheckFlags(VIR_DOMAIN_XML_SECURE, NULL); + virCheckFlags(VIR_DOMAIN_XML_SECURE | + VIR_DOMAIN_XML_ACTIVE_ONLY, NULL); =20 if (!(vm =3D qemuDomObjFromSnapshot(snapshot))) return NULL; --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 19 16:58:46 2024 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 1509353551954922.5540404466939; Mon, 30 Oct 2017 01:52:31 -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 324295D3; Mon, 30 Oct 2017 08:52:30 +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 12F6490F5D; 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 CE4146EF24; Mon, 30 Oct 2017 08:52:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9U8qLAb001047 for ; Mon, 30 Oct 2017 04:52:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7C6008B6DD; Mon, 30 Oct 2017 08:52:21 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 758718B6DC for ; Mon, 30 Oct 2017 08:52:18 +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 1C18A356D4 for ; Mon, 30 Oct 2017 08:52:17 +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 v9U8ns7P133345 for ; Mon, 30 Oct 2017 04:52:16 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 2dx03ujn61-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 30 Oct 2017 04:52:15 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Oct 2017 08:52:14 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 30 Oct 2017 08:52:13 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9U8qDG730933234; Mon, 30 Oct 2017 08:52:13 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 87A3252041; Mon, 30 Oct 2017 07:46:16 +0000 (GMT) Received: from powerkvmpok002.pok.stglabs.ibm.com (unknown [9.114.13.10]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 234015203F; Mon, 30 Oct 2017 07:46:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 324295D3 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx05.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 324295D3 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1C18A356D4 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx06.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 1C18A356D4 From: Kothapally Madhu Pavan To: libvir-list@redhat.com Date: Mon, 30 Oct 2017 14:21:53 +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-000003E855DE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17103008-0041-0000-0000-000025EAD2B3 Message-Id: <1509353516-52208-5-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=1 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.30]); Mon, 30 Oct 2017 08:52:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 30 Oct 2017 08:52:17 +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.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Kothapally Madhu Pavan , jdenemar@redhat.com Subject: [libvirt] [PATCH 4/7] virsh: Dump inactive XML configuration of snapshot using snapshot-dumpxml 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.29]); Mon, 30 Oct 2017 08:52:30 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Now, snapshot-dumpxml will display inactive XML configuration of snapshot along with active XML configuration. When --active-only flag is used the inactive XML configuration will not be displayed. Signed-off-by: Kothapally Madhu Pavan --- tools/virsh-snapshot.c | 7 +++++++ tools/virsh.pod | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index 24cd4ab..4b0a18d 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -1667,6 +1667,10 @@ static const vshCmdOptDef opts_snapshot_dumpxml[] = =3D { .type =3D VSH_OT_BOOL, .help =3D N_("include security sensitive information in XML dump") }, + {.name =3D "active-only", + .type =3D VSH_OT_BOOL, + .help =3D N_("dump only active XML configuration and avoid inactive X= ML") + }, {.name =3D NULL} }; =20 @@ -1683,6 +1687,9 @@ cmdSnapshotDumpXML(vshControl *ctl, const vshCmd *cmd) if (vshCommandOptBool(cmd, "security-info")) flags |=3D VIR_DOMAIN_XML_SECURE; =20 + if (vshCommandOptBool(cmd, "active-only")) + flags |=3D VIR_DOMAIN_XML_ACTIVE_ONLY; + if (vshCommandOptStringReq(ctl, cmd, "snapshotname", &name) < 0) return false; =20 diff --git a/tools/virsh.pod b/tools/virsh.pod index 69cc423..f899da7 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -4489,11 +4489,31 @@ is specified, the list will be filtered to snapshot= s that use external files for disk images or memory state. =20 =3Ditem B I I [I<--security-info>] +[I<--active-only>] =20 Output the snapshot XML for the domain's snapshot named I. Using I<--security-info> will also include security sensitive information. Use B to easily access the XML of the current snapshot. =20 +If I<--active-only> is specified, only active XML configuration of the +snapshot is displayed. Otherwise, both active and inactive XML +configuration of the snapshot will be displayed. + +When both active and inactive XML snapshot configurations are displayed, +as inactive XML configuration will have same structure as active XML +it is embedded within tag as shown below: + + + .... + .... + + + .... + .... + + + + =3Ditem B I {I | I<--current>} =20 Output the name of the parent snapshot, if any, for the given --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 19 16:58:46 2024 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 1509353555371326.0091725481291; Mon, 30 Oct 2017 01:52:35 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 929B12C975C; Mon, 30 Oct 2017 08:52:33 +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 64E009827C; Mon, 30 Oct 2017 08:52:33 +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 2943E1804488; Mon, 30 Oct 2017 08:52:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9U8qKsI001039 for ; Mon, 30 Oct 2017 04:52:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 739BA91E8B; Mon, 30 Oct 2017 08:52:20 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6C86491E86 for ; Mon, 30 Oct 2017 08:52:20 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 A21F67EA8E for ; Mon, 30 Oct 2017 08:52:19 +0000 (UTC) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9U8pSOk087408 for ; Mon, 30 Oct 2017 04:52:19 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2dx0vrg5v6-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 30 Oct 2017 04:52:19 -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:16 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) 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:16 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9U8qFLW21299248; Mon, 30 Oct 2017 08:52:15 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 292505203F; Mon, 30 Oct 2017 07:46:19 +0000 (GMT) Received: from powerkvmpok002.pok.stglabs.ibm.com (unknown [9.114.13.10]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id B8EA152047; Mon, 30 Oct 2017 07:46:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 929B12C975C Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx05.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 929B12C975C DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A21F67EA8E Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx04.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 A21F67EA8E From: Kothapally Madhu Pavan To: libvir-list@redhat.com Date: Mon, 30 Oct 2017 14:21:54 +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-000004085882 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17103008-0041-0000-0000-000020AAD68F Message-Id: <1509353516-52208-6-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=1 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.28]); Mon, 30 Oct 2017 08:52:19 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 30 Oct 2017 08:52:19 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-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.156.1 mx0a-001b2d01.pphosted.com 148.163.156.1 mx0a-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Kothapally Madhu Pavan , jdenemar@redhat.com Subject: [libvirt] [PATCH 5/7] virsh: Edit inactive XML configuration of snapshot using snapshot-edit 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 30 Oct 2017 08:52:34 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Now, snapshot-edit will allow editing inactive XML configuration of snapshot along with active XML configuration. When --active-only flag is used the inactive XML will not be displayed and will be removed from snapshot. --active-only flag is used when user doesn't what any non-persistent configuration in domain after restoring the snapshot. Signed-off-by: Kothapally Madhu Pavan --- tools/virsh-snapshot.c | 7 +++++++ tools/virsh.pod | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index 4b0a18d..48fc034 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -522,6 +522,10 @@ static const vshCmdOptDef opts_snapshot_edit[] =3D { .type =3D VSH_OT_BOOL, .help =3D N_("allow cloning to new name") }, + {.name =3D "active-only", + .type =3D VSH_OT_BOOL, + .help =3D N_("allow editing active XML configuration and remove inact= ive XML") + }, {.name =3D NULL} }; =20 @@ -545,6 +549,9 @@ cmdSnapshotEdit(vshControl *ctl, const vshCmd *cmd) vshCommandOptBool(cmd, "snapshotname")) define_flags |=3D VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT; =20 + if (vshCommandOptBool(cmd, "active-only")) + getxml_flags |=3D VIR_DOMAIN_XML_ACTIVE_ONLY; + if (!(dom =3D virshCommandOptDomain(ctl, cmd, NULL))) return false; =20 diff --git a/tools/virsh.pod b/tools/virsh.pod index f899da7..0578f8f 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -4400,7 +4400,7 @@ With I, this is a request to make the e= xisting named snapshot become the current snapshot, without reverting the domain. =20 =3Ditem B I [I] [I<--current>] -{[I<--rename>] | [I<--clone>]} +{[I<--rename>] | [I<--clone>]} [I<--active-only>] =20 Edit the XML configuration file for I of a domain. If both I and I<--current> are specified, also force the @@ -4427,6 +4427,12 @@ a snapshot name must be done with care, since the co= ntents of some snapshots, such as internal snapshots within a single qcow2 file, are accessible only from the original name. =20 +If I<--active-only> is specified, only active XML configuration of the +snapshot is displayed to edit. Otherwise, both active and inactive XML +configuration of the snapshot will be displayed to edit. When domain +snapshot is edited with I<--active-only> flag, inactive XML configuration +will be removed from snapshot.=20 + =3Ditem B I {I | I<--current>} =20 Output basic information about a named , or the current snapshot --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 19 16:58:46 2024 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 1509353561605813.7316211917284; Mon, 30 Oct 2017 01:52:41 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0482A1FAFF; Mon, 30 Oct 2017 08:52:40 +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 D592791E88; Mon, 30 Oct 2017 08:52:39 +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 9F3D76EF27; Mon, 30 Oct 2017 08:52:39 +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 v9U8qNtK001059 for ; Mon, 30 Oct 2017 04:52:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9EC908CBAE; Mon, 30 Oct 2017 08:52:23 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9911D7E38D for ; Mon, 30 Oct 2017 08:52:23 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 E63BAB649 for ; Mon, 30 Oct 2017 08:52:22 +0000 (UTC) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9U8phuk009085 for ; Mon, 30 Oct 2017 04:52:22 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2dwvrctkh6-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 30 Oct 2017 04:52:22 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Oct 2017 08:52:20 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 30 Oct 2017 08:52:18 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9U8qIAr31850706; Mon, 30 Oct 2017 08:52:18 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9AB505203F; Mon, 30 Oct 2017 07:46:21 +0000 (GMT) Received: from powerkvmpok002.pok.stglabs.ibm.com (unknown [9.114.13.10]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 37C1E52043; Mon, 30 Oct 2017 07:46:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0482A1FAFF 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=fail smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0482A1FAFF DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E63BAB649 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx09.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 E63BAB649 From: Kothapally Madhu Pavan To: libvir-list@redhat.com Date: Mon, 30 Oct 2017 14:21:55 +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-0020-0000-0000-000003C65413 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17103008-0021-0000-0000-0000425B42CD Message-Id: <1509353516-52208-7-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=1 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.38]); Mon, 30 Oct 2017 08:52:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 30 Oct 2017 08:52:23 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-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.156.1 mx0a-001b2d01.pphosted.com 148.163.156.1 mx0a-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 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 6/7] virsh: Allow restoring snapshot with non-persistent configuration 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 30 Oct 2017 08:52:40 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Now, snapshot-restore will allow restoring snapshots with non-persistent configuration as both active and inactive XML configurations are saved in snapshot. User can discard non-persistent configuratin of a domain using --active-only flag. When --active-only flag is used, active XML configuration of the snapshot is used as both the active and inactive XML configuration of the domain after restore. Signed-off-by: Kothapally Madhu Pavan --- tools/virsh-snapshot.c | 6 ++++++ tools/virsh.pod | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index 48fc034..7f6a231 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -1811,6 +1811,10 @@ static const vshCmdOptDef opts_snapshot_revert[] =3D= { .type =3D VSH_OT_BOOL, .help =3D N_("try harder on risky reverts") }, + {.name =3D "active-only", + .type =3D VSH_OT_BOOL, + .help =3D N_("use only active snapshot configuration when restoring") + }, {.name =3D NULL} }; =20 @@ -1835,6 +1839,8 @@ cmdDomainSnapshotRevert(vshControl *ctl, const vshCmd= *cmd) * when the error says it will make a difference. */ if (vshCommandOptBool(cmd, "force")) force =3D true; + if (vshCommandOptBool(cmd, "active-only")) + flags |=3D VIR_DOMAIN_SNAPSHOT_REVERT_ACTIVE_ONLY; =20 dom =3D virshCommandOptDomain(ctl, cmd, NULL); if (dom =3D=3D NULL) diff --git a/tools/virsh.pod b/tools/virsh.pod index 0578f8f..791014e 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -4526,7 +4526,7 @@ Output the name of the parent snapshot, if any, for t= he given I, or for the current snapshot with I<--current>. =20 =3Ditem B I {I | I<--current>} -[{I<--running> | I<--paused>}] [I<--force>] +[{I<--running> | I<--paused>}] [I<--force>] [I<--active-only>] =20 Revert the given domain to the snapshot specified by I, or to the current snapshot with I<--current>. Be aware @@ -4559,6 +4559,13 @@ snapshot that uses a provably incompatible configura= tion, as well as with an inactive snapshot that is combined with the I<--start> or I<--pause> flag. =20 +When inactive XML configuration of a snapshot is available along with +active XML configuration both the inactive and active XMl configurations +are used to restore the snapshot. This will keep the non-persistent +configuration alive after restoring a snapshot. User can kill the +non-persistent configuration by issuing I<--active-only> flag. This will +use active XML configuraton alone to revert the snapshot. + =3Ditem B I {I | I<--current>} [I<--met= adata>] [{I<--children> | I<--children-only>}] =20 --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 19 16:58:46 2024 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 150935355877510.412261968655457; Mon, 30 Oct 2017 01:52:38 -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 34A9AC0272E9; Mon, 30 Oct 2017 08:52:37 +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 1124390F5D; Mon, 30 Oct 2017 08:52:37 +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 CF1DE6EF25; Mon, 30 Oct 2017 08:52:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9U8qTlZ001070 for ; Mon, 30 Oct 2017 04:52:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8BE4188A03; Mon, 30 Oct 2017 08:52:29 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 86C6E88A01 for ; Mon, 30 Oct 2017 08:52:27 +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 BF34AC04AC72 for ; Mon, 30 Oct 2017 08:52:26 +0000 (UTC) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9U8npE7044369 for ; Mon, 30 Oct 2017 04:52:26 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 2dwxcufc5n-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 30 Oct 2017 04:52:25 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Oct 2017 08:52:24 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 30 Oct 2017 08:52:21 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9U8qKSf15204486; Mon, 30 Oct 2017 08:52:20 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2610D5203F; Mon, 30 Oct 2017 07:46:24 +0000 (GMT) Received: from powerkvmpok002.pok.stglabs.ibm.com (unknown [9.114.13.10]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id B62EE5204C; Mon, 30 Oct 2017 07:46:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 34A9AC0272E9 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 34A9AC0272E9 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BF34AC04AC72 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=none smtp.mailfrom=kmp@linux.vnet.ibm.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BF34AC04AC72 From: Kothapally Madhu Pavan To: libvir-list@redhat.com Date: Mon, 30 Oct 2017 14:21:56 +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-000003E855E2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17103008-0041-0000-0000-000025EAD2B8 Message-Id: <1509353516-52208-8-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=1 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.31]); Mon, 30 Oct 2017 08:52:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 30 Oct 2017 08:52:27 +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.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Kothapally Madhu Pavan , jdenemar@redhat.com Subject: [libvirt] [PATCH 7/7] tests: docs: Add schema and testcase for domainsnapshot 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:37 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Alter the schema of domainsnapshot to add inactive XML of a snapshot. As, snapshot already has active XML configuration of domain, the inactive XMl is embedded in tags. Sample XML is: .... .... Alter the domainsnapshotxml2xmltest to validate the format. Signed-off-by: Kothapally Madhu Pavan --- docs/schemas/domainsnapshot.rng | 19 +++++ .../full_domain_withinactive.xml | 83 ++++++++++++++++++= ++++ tests/domainsnapshotxml2xmltest.c | 1 + 3 files changed, 103 insertions(+) create mode 100644 tests/domainsnapshotxml2xmlout/full_domain_withinactive= .xml diff --git a/docs/schemas/domainsnapshot.rng b/docs/schemas/domainsnapshot.= rng index 2680887..2a58a84 100644 --- a/docs/schemas/domainsnapshot.rng +++ b/docs/schemas/domainsnapshot.rng @@ -84,6 +84,25 @@ + + + + + + + + + + + + + + + + + diff --git a/tests/domainsnapshotxml2xmlout/full_domain_withinactive.xml b/= tests/domainsnapshotxml2xmlout/full_domain_withinactive.xml new file mode 100644 index 0000000..d6d1b39 --- /dev/null +++ b/tests/domainsnapshotxml2xmlout/full_domain_withinactive.xml @@ -0,0 +1,83 @@ + + my snap name + !@#$%^ + running + + earlier_snap + + 1272917631 + + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + +
+ + +
+ + +
+ + + + + +
+ + + + + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + +
+ + +
+ + +
+ + + + + +
+ + + + + 1 + diff --git a/tests/domainsnapshotxml2xmltest.c b/tests/domainsnapshotxml2xm= ltest.c index 3a6f86b..ebec2de 100644 --- a/tests/domainsnapshotxml2xmltest.c +++ b/tests/domainsnapshotxml2xmltest.c @@ -205,6 +205,7 @@ mymain(void) DO_TEST_OUT("all_parameters", "9d37b878-a7cc-9f9a-b78f-49b3abad25a8", = true); DO_TEST_OUT("disk_snapshot_redefine", "c7a5fdbd-edaf-9455-926a-d65c16d= b1809", true); DO_TEST_OUT("full_domain", "c7a5fdbd-edaf-9455-926a-d65c16db1809", tru= e); + DO_TEST_OUT("full_domain_withinactive", "c7a5fdbd-edaf-9455-926a-d65c1= 6db1809", true); DO_TEST_OUT("noparent_nodescription_noactive", NULL, false); DO_TEST_OUT("noparent_nodescription", NULL, true); DO_TEST_OUT("noparent", "9d37b878-a7cc-9f9a-b78f-49b3abad25a8", false); --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list