[PATCH 2/2] snapshots: allow snapshot-edit to ignore validation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This allows users to actively ignore validadtion if needed e.g. when
changing metadata intentionally that does not pass the ABI checker.

It is utilizing EDIT_RELAX of virsh-edit.c to set the
VIR_DOMAIN_SNAPSHOT_CREATE_NOCHECK flag defined in the former patch.

Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1802944

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@xxxxxxxxxxxxx>
---
 tools/virsh-snapshot.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c
index a680d2b410..6177fc282d 100644
--- a/tools/virsh-snapshot.c
+++ b/tools/virsh-snapshot.c
@@ -563,7 +563,12 @@ cmdSnapshotEdit(vshControl *ctl, const vshCmd *cmd)
     (strstr(doc, "<state>disk-snapshot</state>") ? \
     define_flags |= VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY : 0), \
     edited = virDomainSnapshotCreateXML(dom, doc_edited, define_flags)
+#define EDIT_RELAX \
+    do { \
+        define_flags |= VIR_DOMAIN_SNAPSHOT_CREATE_NOCHECK; \
+    } while (0);
 #include "virsh-edit.c"
+#undef EDIT_RELAX
 
     edited_name = virDomainSnapshotGetName(edited);
     if (STREQ(name, edited_name)) {
-- 
2.17.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux