All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/8] scsi: clean up persistent reservation state after migration
@ 2026-10-13 18:17 Stefan Hajnoczi
  2026-10-13 18:17 ` [PATCH v2 1/8] pr-manager-helper: fix sense buffer overflow Stefan Hajnoczi
                   ` (8 more replies)
  0 siblings, 9 replies; 19+ messages in thread
From: Stefan Hajnoczi @ 2026-10-13 18:17 UTC (permalink / raw)
  To: qemu-devel
  Cc: Pierrick Bouvier, Marc-André Lureau, akalenyu, Kevin Wolf,
	eblake, Daniel P. Berrangé, Fam Zheng, Paolo Bonzini,
	qemu-block, Hanna Reitz, Benjamin Marzinski, Stefan Hajnoczi

v2:
- Explicitly reject PR_HELPER_CLEAN commands in scsi_req_new() because
  this is an internal command that guests must not be able to invoke
- Move cdb[0] check after copy from io_hdr in pr-manager-helper.c
- Add missing endianness conversion for protocol flags in pr-manager-helper.c
- Ignore PR_HELPER_CLEANUP commands when there is no pr-manager to avoid
  passing through this QEMU-internal vendor-specific command to the
  underlying SCSI device.
- Add missing "forget" in comment (typo)

When a guest using SCSI persistent reservations is migrated on a Linux host
using multipathd, some state is left behind and this can cause multipathd to
register the old key again in the future. One way this can be observed is when
migrating a guest back-and-forth between two hosts: the REGISTER command will
fail when migrating back to the first host if the LUN is detached and
re-attached between migrations (i.e. multipathd sees that a path has come up).

This patch series modifies qemu-pr-helper to send multipathd commands that
clear the state once migration has completed successfully. This is implemented
as a vendor-specific SCSI command called PR_HELPER_CLEANUP that QEMU sends to
qemu-pr-helper just like PERSISTENT RESERVE IN and PERSISTENT RESERVE OUT
commands.

Buglink: https://redhat.atlassian.net/browse/RHEL-274966

Stefan Hajnoczi (8):
  pr-manager-helper: fix sense buffer overflow
  scsi: increase sense buffer size in scsi_SG_IO()
  hw/scsi-disk: move MIG_EVENT_FAILED into a new function
  qemu-pr-helper: add PR_HELPER_CLEANUP for live migration
  pr-manager-helper: add PR_HELPER_CLEANUP command support
  file-posix: forward PR_HELPER_CLEANUP commands to pr-manager
  scsi: clean up persistent reservation state after migration
  scsi: use REGISTER AND IGNORE EXISTING KEY for robustness

 meson.build              |   2 +
 include/hw/scsi/scsi.h   |   1 +
 include/scsi/constants.h |   1 +
 scsi/pr-helper.h         |   3 +
 block/file-posix.c       |  18 +++--
 hw/scsi/scsi-bus.c       |  10 +++
 hw/scsi/scsi-disk.c      |  45 +++++++++---
 hw/scsi/scsi-generic.c   |  64 +++++++++++++----
 scsi/pr-manager-helper.c |  23 ++++--
 scsi/qemu-pr-helper.c    | 146 ++++++++++++++++++++++++++++++++++++---
 scsi/utils.c             |   3 +
 11 files changed, 273 insertions(+), 43 deletions(-)

-- 
2.56.0



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2026-10-14 19:10 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-13 18:17 [PATCH v2 0/8] scsi: clean up persistent reservation state after migration Stefan Hajnoczi
2026-10-13 18:17 ` [PATCH v2 1/8] pr-manager-helper: fix sense buffer overflow Stefan Hajnoczi
2026-10-13 18:17 ` [PATCH v2 2/8] scsi: increase sense buffer size in scsi_SG_IO() Stefan Hajnoczi
2026-10-13 18:17 ` [PATCH v2 3/8] hw/scsi-disk: move MIG_EVENT_FAILED into a new function Stefan Hajnoczi
2026-10-13 19:16   ` Eric Blake
2026-10-13 18:17 ` [PATCH v2 4/8] qemu-pr-helper: add PR_HELPER_CLEANUP for live migration Stefan Hajnoczi
2026-10-13 19:47   ` Eric Blake
2026-10-14 14:39     ` Stefan Hajnoczi
2026-10-13 19:47   ` Paolo Bonzini
2026-10-13 18:17 ` [PATCH v2 5/8] pr-manager-helper: add PR_HELPER_CLEANUP command support Stefan Hajnoczi
2026-10-13 19:49   ` Eric Blake
2026-10-13 18:17 ` [PATCH v2 6/8] file-posix: forward PR_HELPER_CLEANUP commands to pr-manager Stefan Hajnoczi
2026-10-13 19:51   ` Eric Blake
2026-10-13 18:17 ` [PATCH v2 7/8] scsi: clean up persistent reservation state after migration Stefan Hajnoczi
2026-10-13 20:04   ` Eric Blake
2026-10-13 18:17 ` [PATCH v2 8/8] scsi: use REGISTER AND IGNORE EXISTING KEY for robustness Stefan Hajnoczi
2026-10-13 20:05   ` Eric Blake
2026-10-14 14:28 ` [PATCH v2 9/8] scsi: document PR_HELPER_CLEANUP command Stefan Hajnoczi
2026-10-14 19:09   ` Eric Blake

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.