]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix error message when TUNNELLED flag is used in non-p2p migration
authorJiri Denemark <jdenemar@redhat.com>
Thu, 22 May 2014 11:18:21 +0000 (13:18 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 23 May 2014 07:05:39 +0000 (09:05 +0200)
The current error message is

    error: use virDomainMigrateToURI3 for peer-to-peer migration

which is correct but a bit misleading because the client did not specify
VIR_MIGRATE_PEER2PEER flag. This patch changes the error message to

    error: cannot perform tunnelled migration without using peer2peer
    flag

which is consistent with the error reported by older migration APIs.

Reported by Rich Jones in
https://bugzilla.redhat.com/show_bug.cgi?id=1095924

src/libvirt.c

index 19fa18bd0cdf011b6476d2460422221cfca3212d..72a9f6d28aca51911975348143f2f34687bb85ae 100644 (file)
@@ -5723,12 +5723,18 @@ virDomainMigrate3(virDomainPtr domain,
                             __FUNCTION__);
         goto error;
     }
-    if (flags & (VIR_MIGRATE_PEER2PEER | VIR_MIGRATE_TUNNELLED)) {
+    if (flags & VIR_MIGRATE_PEER2PEER) {
         virReportInvalidArg(flags, "%s",
                             _("use virDomainMigrateToURI3 for peer-to-peer "
                               "migration"));
         goto error;
     }
+    if (flags & VIR_MIGRATE_TUNNELLED) {
+        virReportInvalidArg(flags, "%s",
+                            _("cannot perform tunnelled migration "
+                              "without using peer2peer flag"));
+        goto error;
+    }
 
     if (flags & VIR_MIGRATE_OFFLINE) {
         if (!VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,