[PATCH] Reject migration with both --live and --offline when migration requested from other clients/API.

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

 



---
 src/libvirt-domain.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 9491845..6a5034e 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -3616,6 +3616,13 @@ virDomainMigrate(virDomainPtr domain,
                              VIR_MIGRATE_NON_SHARED_INC,
                              error);
 
+    if ((flags & VIR_MIGRATE_OFFLINE) && (flags & VIR_MIGRATE_LIVE)) {
+            virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
+                           _("Options --live and --offline are "
+                             "mutually exclusive"));
+            goto error;
+    }
+
     if (flags & VIR_MIGRATE_OFFLINE) {
         if (!VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
                                       VIR_DRV_FEATURE_MIGRATION_OFFLINE)) {
@@ -3840,6 +3847,13 @@ virDomainMigrate2(virDomainPtr domain,
                              VIR_MIGRATE_NON_SHARED_INC,
                              error);
 
+    if ((flags & VIR_MIGRATE_OFFLINE) && (flags & VIR_MIGRATE_LIVE)) {
+            virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
+                           _("Options --live and --offline are "
+                             "mutually exclusive"));
+            goto error;
+    }
+
     if (flags & VIR_MIGRATE_OFFLINE) {
         if (!VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
                                       VIR_DRV_FEATURE_MIGRATION_OFFLINE)) {
@@ -4014,6 +4028,13 @@ virDomainMigrate3(virDomainPtr domain,
                              VIR_MIGRATE_NON_SHARED_INC,
                              error);
 
+    if ((flags & VIR_MIGRATE_OFFLINE) && (flags & VIR_MIGRATE_LIVE)) {
+            virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
+                           _("Options --live and --offline are "
+                             "mutually exclusive"));
+            goto error;
+    }
+
     if (flags & VIR_MIGRATE_PEER2PEER) {
         virReportInvalidArg(flags, "%s",
                             _("use virDomainMigrateToURI3 for peer-to-peer "
-- 
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]