All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/4] scsi: persistent reservation live migration
@ 2026-01-13 21:53 Stefan Hajnoczi
  2026-01-13 21:53 ` [RFC 1/4] scsi: track SCSI reservation state for " Stefan Hajnoczi
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2026-01-13 21:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Philippe Mathieu-Daudé, pkrempa, Hannes Reinecke,
	Yanan Wang, Kevin Wolf, Eduardo Habkost, Alberto Faria,
	Paolo Bonzini, Marcel Apfelbaum, qemu-block, Zhao Liu,
	Stefan Hajnoczi

Live migration does not work for SCSI Persistent Reservations acquired on
scsi-block devices. This patch series migrates the reservation key and
reservation type so that the destination QEMU can take over the persistent
reservation with the PREEMPT service action upon live migration.

The approach involves snooping PERSISTENT RESERVE OUT replies and tracking the
scsi-block device's current reservation key and reservation type. In most cases
this involves no additional SCSI commands. This approach isn't perfect: if
another machine modifies the reservation on the physical LUN, then QEMU's state
becomes stale. Persistent reservations are inherently cooperative, so this is
acceptable as long as real applications don't run into problems.

I am also working on a test suite called pr-tests that runs sg_persist(8)
commands across multiple machines in order to exercise various scenarios:
https://gitlab.com/stefanha/pr-tests

Stefan Hajnoczi (4):
  scsi: track SCSI reservation state for live migration
  scsi: generalize scsi_SG_IO_FROM_DEV() to scsi_SG_IO()
  scsi: add error reporting to scsi_SG_IO()
  scsi: save/load SCSI reservation state

 include/hw/scsi/scsi.h   |  15 +-
 include/scsi/constants.h |  21 +++
 hw/core/machine.c        |   4 +-
 hw/scsi/scsi-bus.c       |   3 +
 hw/scsi/scsi-disk.c      |  53 +++++++-
 hw/scsi/scsi-generic.c   | 286 +++++++++++++++++++++++++++++++++++++--
 hw/scsi/trace-events     |   2 +
 7 files changed, 369 insertions(+), 15 deletions(-)

-- 
2.52.0



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

end of thread, other threads:[~2026-01-15 18:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-13 21:53 [RFC 0/4] scsi: persistent reservation live migration Stefan Hajnoczi
2026-01-13 21:53 ` [RFC 1/4] scsi: track SCSI reservation state for " Stefan Hajnoczi
2026-01-13 21:53 ` [RFC 2/4] scsi: generalize scsi_SG_IO_FROM_DEV() to scsi_SG_IO() Stefan Hajnoczi
2026-01-13 21:53 ` [RFC 3/4] scsi: add error reporting " Stefan Hajnoczi
2026-01-13 21:53 ` [RFC 4/4] scsi: save/load SCSI reservation state Stefan Hajnoczi
2026-01-15 16:10 ` [RFC 0/4] scsi: persistent reservation live migration Peter Krempa
2026-01-15 17:11 ` Paolo Bonzini
2026-01-15 18:37   ` Stefan Hajnoczi

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.