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 <pkre...@redhat.com>
---
 tools/virsh-domain.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 84bf62057b..e0776c991f 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -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,
-- 
2.41.0

Reply via email to