]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: doMigrate: Require --copy-storage-(all|inc) with --migrate-disks
authorPeter Krempa <pkrempa@redhat.com>
Wed, 9 Aug 2023 13:14:35 +0000 (15:14 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 10 Aug 2023 12:53:27 +0000 (14:53 +0200)
Users need to enable non-shared-storage migration, otherwise the disks
specified via '--migrate-disks' will be ignored.

Add an error message to inform the users of their wrong config.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tools/virsh-domain.c

index 84bf62057b66bb82b0d564e62b86d2e3f9ea14e7..e0776c991f157651e3d6ccd7660050c57f750f41 100644 (file)
@@ -11204,6 +11204,11 @@ doMigrate(void *opaque)
     if (opt) {
         g_autofree char **val = NULL;
 
+        if (!(flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC))) {
+            vshError(ctl, "'--migrate-disks' requires one of '--copy-storage-all', '--copy-storage-inc'");
+            goto out;
+        }
+
         val = g_strsplit(opt, ",", 0);
 
         if (virTypedParamsAddStringList(&params,