From: Peter Krempa Date: Wed, 9 Aug 2023 13:14:35 +0000 (+0200) Subject: virsh: doMigrate: Require --copy-storage-(all|inc) with --migrate-disks X-Git-Tag: v9.7.0-rc1~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85688f475f949eb08074343ca936bf513210f505;p=thirdparty%2Flibvirt.git virsh: doMigrate: Require --copy-storage-(all|inc) with --migrate-disks 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 Reviewed-by: Ján Tomko --- 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(¶ms,