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

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.

I considered adding a separate interface or more complex qemu-pr-helper
protocol extension that does not reuse SCSI commands because that would be
cleaner. Since the command does not have security implications (it's a variant
of REGISTER AND IGNORE EXISTING KEYS), I went with this approach for
simplicity. Let me know if you prefer a different interface and what that it
should look like.

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       |   3 +-
 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 +
 10 files changed, 251 insertions(+), 40 deletions(-)

-- 
2.56.0



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

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

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-09 15:30 [PATCH 0/8] scsi: clean up persistent reservation state after migration Stefan Hajnoczi
2026-10-09 15:30 ` [PATCH 1/8] pr-manager-helper: fix sense buffer overflow Stefan Hajnoczi
2026-10-13 14:50   ` Eric Blake
2026-10-09 15:30 ` [PATCH 2/8] scsi: increase sense buffer size in scsi_SG_IO() Stefan Hajnoczi
2026-10-13 14:52   ` Eric Blake
2026-10-09 15:30 ` [PATCH 3/8] hw/scsi-disk: move MIG_EVENT_FAILED into a new function Stefan Hajnoczi
2026-10-13 15:00   ` Eric Blake
2026-10-13 18:05     ` Stefan Hajnoczi
2026-10-13 19:12       ` Eric Blake
2026-10-09 15:30 ` [PATCH 4/8] qemu-pr-helper: add PR_HELPER_CLEANUP for live migration Stefan Hajnoczi
2026-10-13 18:32   ` Eric Blake
2026-10-09 15:30 ` [PATCH 5/8] pr-manager-helper: add PR_HELPER_CLEANUP command support Stefan Hajnoczi
2026-10-13 16:25   ` Paolo Bonzini
2026-10-13 17:57     ` Stefan Hajnoczi
2026-10-09 15:30 ` [PATCH 6/8] file-posix: forward PR_HELPER_CLEANUP commands to pr-manager Stefan Hajnoczi
2026-10-09 15:30 ` [PATCH 7/8] scsi: clean up persistent reservation state after migration Stefan Hajnoczi
2026-10-09 15:30 ` [PATCH 8/8] scsi: use REGISTER AND IGNORE EXISTING KEY for robustness Stefan Hajnoczi
2026-10-13 18:40   ` 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.