File 04597a70-postcopy-mig-flag.patch of Package libvirt.6159

commit 04597a7038482688fb2cc8b0b1869392f6f78016
Author: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
Date:   Fri Sep 2 07:52:13 2016 -0400

    Make --postcopy flag mandatory with --postcopy-after-precopy
    
    --postcopy-after-precopy is just an aditional flag for
    postcopy migration.
    
    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
@@ -10323,6 +10323,12 @@ 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,
Index: libvirt-2.0.0/tools/virsh.pod
===================================================================
--- libvirt-2.0.0.orig/tools/virsh.pod
+++ libvirt-2.0.0/tools/virsh.pod
@@ -1586,8 +1586,8 @@ migration. I<--postcopy> enables post-co
 actually start post-copy, i.e., migration is started in pre-copy mode.
 Once migration is running, the user may switch to post-copy using the
 B<migrate-postcopy> command sent from another virsh instance or use
-I<--postcopy-after-precopy> to let libvirt automatically switch to
-post-copy after the first pass of pre-copy is finished.
+I<--postcopy-after-precopy> along with I<--postcopy> to let libvirt
+automatically switch to post-copy after the first pass of pre-copy is finished.
 
 I<--auto-converge> forces convergence during live migration. The initial
 guest CPU throttling rate can be set with I<auto-converge-initial>. If the