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

Re: [libvirt] [PATCH] Report error when both live and offline flags are used for migration.



Hello All,

Any comments on this small patch?

Warm Regards,
Nitesh Konkar.

On Thu, Mar 3, 2016 at 4:38 PM, Nitesh Konkar <niteshkonkar libvirt gmail com> wrote:
---
 src/libvirt-domain.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 9491845..dc11945 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -3617,6 +3617,15 @@ virDomainMigrate(virDomainPtr domain,
                              error);

+    if (flags & VIR_MIGRATE_OFFLINE) {
+        if (flags & VIR_MIGRATE_LIVE) {
+            virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
+                           _("Live and offline migration flags 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)) {
             virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
@@ -3841,6 +3850,15 @@ virDomainMigrate2(virDomainPtr domain,
                              error);

+    if (flags & VIR_MIGRATE_OFFLINE) {
+        if (flags & VIR_MIGRATE_LIVE) {
+            virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
+                           _("Live and offline migration flags 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)) {
             virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
@@ -4014,6 +4032,15 @@ virDomainMigrate3(virDomainPtr domain,
                              VIR_MIGRATE_NON_SHARED_INC,
                              error);

+    if (flags & VIR_MIGRATE_OFFLINE) {
+        if (flags & VIR_MIGRATE_LIVE) {
+            virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
+                           _("Live and offline migration flags are "
+                             "mutually exclusive"));
+            goto error;
+        }
+    }
+
     if (flags & VIR_MIGRATE_PEER2PEER) {
         virReportInvalidArg(flags, "%s",
                             _("use virDomainMigrateToURI3 for peer-to-peer "
--
1.8.3.1



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