From: Peter Krempa Date: Wed, 6 Dec 2023 07:36:13 +0000 (+0100) Subject: virsh: migrate: Fix logic bug in interlock of --copy-storage-synchronous-writes flag X-Git-Tag: v10.0.0-rc1~115 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a2f98b6b8cedec086facff85afee0c94ad5b4571;p=thirdparty%2Flibvirt.git virsh: migrate: Fix logic bug in interlock of --copy-storage-synchronous-writes flag 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 Reviewed-by: Ján Tomko --- diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index afb8c401da..fa9d356e15 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -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; }