]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: migrate: Fix logic bug in interlock of --copy-storage-synchronous-writes flag
authorPeter Krempa <pkrempa@redhat.com>
Wed, 6 Dec 2023 07:36:13 +0000 (08:36 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 7 Dec 2023 15:42:32 +0000 (16:42 +0100)
As the error message states we want to check that one of
'--copy-storage-all' or '--copy-storage-inc' is used, but the condition
mentioned VIR_MIGRATE_NON_SHARED_DISK twice.

Fixes: 1c2bd205edd
Resolves: https://issues.redhat.com/browse/RHEL-17596
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tools/virsh-domain.c

index afb8c401da7848a5aab76a886d3739f4fe1ac2f2..fa9d356e15a7bbc033ff19e7b300c14d793a9e98 100644 (file)
@@ -11194,7 +11194,7 @@ doMigrate(void *opaque)
     }
 
     if (flags & VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES &&
-        !(flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_DISK))) {
+        !(flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC))) {
         vshError(ctl, "'--copy-storage-synchronous-writes' requires one of '--copy-storage-all', '--copy-storage-inc'");
         goto out;
     }