]> git.ipfire.org Git - thirdparty/qemu.git/commit
scsi-disk: Always report RESERVATION_CONFLICT to guest
authorKevin Wolf <kwolf@redhat.com>
Wed, 31 Jul 2024 12:32:07 +0000 (14:32 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 10 Apr 2025 13:30:22 +0000 (16:30 +0300)
commit2870b84a298e5821d24304ae593485db14d91b4d
tree325269cff24b31dba66003be3a8dcdcfc2fe503e
parent9da48f6f0fce18642e77498c592655669c1332e2
scsi-disk: Always report RESERVATION_CONFLICT to guest

In the case of scsi-block, RESERVATION_CONFLICT is not a backend error,
but indicates that the guest tried to make a request that it isn't
allowed to execute. Pass the error to the guest so that it can decide
what to do with it.

Without this, if we stop the VM in response to a RESERVATION_CONFLICT
(as is the default policy in management software such as oVirt or
KubeVirt), it can happen that the VM cannot be resumed any more because
every attempt to resume it immediately runs into the same error and
stops the VM again.

One case that expects RESERVATION_CONFLICT errors to be visible in the
guest is running the validation tests in Windows 2019's Failover Cluster
Manager, which intentionally tries to execute invalid requests to see if
they are properly rejected.

Buglink: https://issues.redhat.com/browse/RHEL-50000
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20240731123207.27636-5-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 9da6bd39f92434f55573acd017841b195c60188f)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/scsi/scsi-disk.c