File 01193545-postcopy-mig-fixup.patch of Package libvirt.8364

commit 011935457a3b5d911e10dc60c681778e78c8fdf9
Author: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
Date:   Tue Oct 18 13:33:11 2016 -0400

    vsh: Using VSH_REQUIRE_OPTION rather than virReportError
    
    Correcting the error reporting method by using VSH_REQUIRE_OPTION
    instead of virReportError
    
    Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com>

Index: libvirt-2.0.0/tools/virsh-domain.c
===================================================================
--- libvirt-2.0.0.orig/tools/virsh-domain.c
+++ libvirt-2.0.0/tools/virsh-domain.c
@@ -10292,6 +10292,7 @@ cmdMigrate(vshControl *ctl, const vshCmd
 
     VSH_EXCLUSIVE_OPTIONS("live", "offline");
     VSH_EXCLUSIVE_OPTIONS("timeout-suspend", "timeout-postcopy");
+    VSH_REQUIRE_OPTION("postcopy-after-precopy", "postcopy");
 
     if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
         return false;
@@ -10323,12 +10324,6 @@ cmdMigrate(vshControl *ctl, const vshCmd
     }
 
     if (vshCommandOptBool(cmd, "postcopy-after-precopy")) {
-        if (!vshCommandOptBool(cmd, "postcopy")) {
-            virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
-                           _("--postcopy-after-precopy can only be used with "
-                             "--postcopy"));
-            goto cleanup;
-        }
         iterEvent = virConnectDomainEventRegisterAny(
                             priv->conn, dom,
                             VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION,
openSUSE Build Service is sponsored by