mirror_qemu/include
Stefano Garzarella 9472083e64 scsi: fetch unit attention when creating the request
Commit 1880ad4f4e ("virtio-scsi: Batched prepare for cmd reqs") split
calls to scsi_req_new() and scsi_req_enqueue() in the virtio-scsi device.
No ill effects were observed until commit 8cc5583abe ("virtio-scsi: Send
"REPORTED LUNS CHANGED" sense data upon disk hotplug events") added a
unit attention that was easy to trigger with device hotplug and
hot-unplug.

Because the two calls were separated, all requests in the batch were
prepared calling scsi_req_new() to report a sense.  The first one
submitted would report the right sense and reset it to NO_SENSE, while
the others reported CHECK_CONDITION with no sense data.  This caused
SCSI errors in Linux.

To solve this issue, let's fetch the unit attention as early as possible
when we prepare the request, so that only the first request in the batch
will use the unit attention SCSIReqOps and the others will not report
CHECK CONDITION.

Fixes: 1880ad4f4e ("virtio-scsi: Batched prepare for cmd reqs")
Fixes: 8cc5583abe ("virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events")
Reported-by: Thomas Huth <thuth@redhat.com>
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2176702
Co-developed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-ID: <20230712134352.118655-2-sgarzare@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2023-07-14 11:10:58 +02:00
..
authz Prefer 'on' | 'off' over 'yes' | 'no' for bool options 2021-01-29 17:07:53 +00:00
block block: use bdrv_co_debug_event in coroutine context 2023-06-28 09:46:34 +02:00
chardev chardev: src buffer const for write functions 2022-09-29 14:38:05 +04:00
crypto crypto: Unexport AES_*_rot, AES_TeN, AES_TdN 2023-07-09 13:48:23 +01:00
disas disas: Change type of disassemble_info.target_info to pointer 2023-06-13 17:25:47 +10:00
exec plugins: force slow path when plugins instrument memory ops 2023-07-03 12:51:58 +01:00
fpu fpu: Add float64_to_int{32,64}_modulo 2023-07-01 08:26:54 +02:00
gdbstub gdbstub: Remove gdb_do_syscallv 2023-03-07 20:44:09 +00:00
hw scsi: fetch unit attention when creating the request 2023-07-14 11:10:58 +02:00
io nbd/server: Fix drained_poll to wake coroutine in right AioContext 2023-05-19 19:16:53 +02:00
libdecnumber Replace config-time define HOST_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
migration migration/ram: Expose ramblock_is_ignored() as migrate_ram_is_ignored() 2023-07-12 09:25:37 +02:00
monitor monitor: add more *_locked() functions 2023-05-25 10:18:33 +02:00
net igb: Strip the second VLAN tag for extended VLAN 2023-05-23 15:20:15 +08:00
qapi monitor: mark mixed functions that can suspend 2023-04-20 11:17:35 +02:00
qemu accel: Rename HAX 'struct hax_vcpu_state' -> AccelCPUState 2023-06-28 13:55:35 +02:00
qom qom/object: Remove circular include dependency 2022-06-28 10:53:32 +02:00
scsi coroutine: Clean up superfluous inclusion of qemu/coroutine.h 2023-01-19 10:18:28 +01:00
semihosting semihosting: Allow optional use of semihosting from userspace 2022-09-13 17:18:21 +01:00
standard-headers linux-headers: update to v6.5-rc1 2023-07-10 09:52:52 +02:00
sysemu accel/kvm: Re-include "exec/memattrs.h" header 2023-06-28 14:14:22 +02:00
tcg tcg: Reduce tcg_assert_listed_vecop() scope 2023-07-01 08:26:54 +02:00
ui ui: add optional d3d texture pointer to scanout texture 2023-06-27 17:08:56 +02:00
user *-user: remove the guest_user_syscall tracepoints 2023-06-01 11:03:55 -04:00
elf.h replace TABs with spaces 2023-03-20 12:43:50 +01:00
glib-compat.h compiler.h: replace QEMU_NORETURN with G_NORETURN 2022-04-21 17:03:51 +04:00
qemu-io.h
qemu-main.h ui/cocoa: Run qemu_init in the main thread 2022-09-23 14:36:33 +02:00