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 <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2023-08-09 15:14:35 +02:00
parent 1c2bd205ed
commit 85688f475f

View 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,