[PATCH 7/9] conf: snapshot: check domain name on redefine

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

 



Renaming domain which has snapshots is prohibited. Also reverting
to ABI compatible active domain with a different name can have
issues later I guess. So let's prohibit changing domain name on snapshot
metadata redefine as well.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>
---
 src/conf/snapshot_conf.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
index 34fcf64..fa1cd6b 100644
--- a/src/conf/snapshot_conf.c
+++ b/src/conf/snapshot_conf.c
@@ -1307,6 +1307,14 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain,
         goto cleanup;
     }
 
+    if (def->dom &&
+        STRNEQ(def->dom->name, domain->name)) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                       _("definition for snapshot %s must use name %s"),
+                       def->name, domain->name);
+        goto cleanup;
+    }
+
     other = virDomainSnapshotFindByName(vm->snapshots, def->name);
     if (other) {
         if ((other->def->state == VIR_DOMAIN_RUNNING ||
-- 
1.8.3.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