Browse Source
Andrey Drobyshev's qemugdb script improvements and my --device scsi-block,migrate-pr=on|off live migration support for SCSI Persistent Reservations. -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmmJ8t0ACgkQnKSrs4Gr c8goXggAgx8Fehp5q1e1xUulb/WwnHw14lfl2+O4Or3FxK9TDWSUjT0Htk0+QwAf W+7Q7MTnSzLTDYKbsPj+4RxZ+Pth/ra2rhIS3YWMQLNAjFKAIWKvQdD0krOlJ8t+ i3DkERhaw/ke2ImR7GSr7SZjJjhHaxTaC+R/DEPWVxgK1j4mLt/pwAhigWxlvVLT SInnZAvfy7+OspFu3AcBtwDEe0MvIQKdTgxZS7wSf/tWS/9WZqsM8pSL/1+ozPGg hWjHevhGI6LS4QfRqdF6+dq/XaGT81hFNosCL2o9YWbLuipk/9TyUSX7uevo1IFz SpXwxFltCyPicaGJcufX4MjASJqjrg== =DKtL -----END PGP SIGNATURE----- Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging Pull request Andrey Drobyshev's qemugdb script improvements and my --device scsi-block,migrate-pr=on|off live migration support for SCSI Persistent Reservations. # -----BEGIN PGP SIGNATURE----- # # iQEzBAABCgAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmmJ8t0ACgkQnKSrs4Gr # c8goXggAgx8Fehp5q1e1xUulb/WwnHw14lfl2+O4Or3FxK9TDWSUjT0Htk0+QwAf # W+7Q7MTnSzLTDYKbsPj+4RxZ+Pth/ra2rhIS3YWMQLNAjFKAIWKvQdD0krOlJ8t+ # i3DkERhaw/ke2ImR7GSr7SZjJjhHaxTaC+R/DEPWVxgK1j4mLt/pwAhigWxlvVLT # SInnZAvfy7+OspFu3AcBtwDEe0MvIQKdTgxZS7wSf/tWS/9WZqsM8pSL/1+ozPGg # hWjHevhGI6LS4QfRqdF6+dq/XaGT81hFNosCL2o9YWbLuipk/9TyUSX7uevo1IFz # SpXwxFltCyPicaGJcufX4MjASJqjrg== # =DKtL # -----END PGP SIGNATURE----- # gpg: Signature made Mon Feb 9 14:44:45 2026 GMT # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full] # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * tag 'block-pull-request' of https://gitlab.com/stefanha/qemu: docs: add SCSI migrate-pr documentation scsi: save/load SCSI reservation state scsi: track SCSI reservation state for live migration scsi: add error reporting to scsi_SG_IO() scsi: generalize scsi_SG_IO_FROM_DEV() to scsi_SG_IO() scripts/qemugdb: coroutine: Add option for obtaining detailed trace in coredump scripts/qemugdb: timers: Improve 'qemu timers' command readability scripts/qemugdb: timers: Fix KeyError in 'qemu timers' command scripts/qemugdb: mtree: Fix OverflowError in mtree with 128-bit addresses Signed-off-by: Peter Maydell <peter.maydell@linaro.org>pull/319/head
13 changed files with 765 additions and 39 deletions
@ -0,0 +1,10 @@ |
|||
SCSI Devices |
|||
============ |
|||
|
|||
Several SCSI devices are available in QEMU. They are primarily used for block |
|||
storage. |
|||
|
|||
.. toctree:: |
|||
:maxdepth: 1 |
|||
|
|||
migrate-pr.rst |
|||
@ -0,0 +1,54 @@ |
|||
.. |
|||
SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
.. _scsi_migrate_pr: |
|||
|
|||
SCSI Persistent Reservation Live Migration |
|||
========================================== |
|||
|
|||
This document explains how to live migrate SCSI Persistent Reservations. |
|||
|
|||
The ``scsi-block`` device migrates SCSI Persistent Reservations when the |
|||
``migrate-pr=on`` parameter is given. Migration is enabled by default in |
|||
versioned machine types since QEMU 11.0. It is disabled by default on older |
|||
machine types and needs to be explicitly enabled with ``--device |
|||
scsi-block,migrate-pr=on,...``. |
|||
|
|||
When migration is enabled, QEMU snoops PERSISTENT RESERVATION OUT commands and |
|||
tracks the reservation key registered by the guest as well as reservations that |
|||
the guest acquires. This information is migrated along with the guest and the |
|||
destination QEMU submits a PERSISTENT RESERVATION OUT command with the PREEMPT |
|||
service action to atomically transfer the reservation to the destination before |
|||
the guest starts running on the destination. |
|||
|
|||
The following persistent reservation capabilities reported by the PERSISTENT |
|||
RESERVATION IN command with the REPORT CAPABILITIES service action are masked |
|||
from the guest by QEMU when migration is enabled: |
|||
|
|||
* Specify Initiator Ports Capable (SIP_C) |
|||
* All Target Ports Capable (ATC_C) |
|||
|
|||
When migration is disabled, the ``scsi-block`` device is live migrated but |
|||
reservations remain in place on the source. Usually this is not the intended |
|||
behavior unless there is another mechanism to update reservations during |
|||
migration. The PERSISTENT RESERVATION IN command also does not mask |
|||
capabilities reported to the guest when migration is disabled. |
|||
|
|||
Limitations |
|||
----------- |
|||
|
|||
QEMU does not remember snooped reservation details across restart, so software |
|||
inside the guest must acquire the reservation after boot in order for live |
|||
migration to work. Similarly, if the reservation is acquired outside the guest |
|||
then it will not live migrate along with the guest. |
|||
|
|||
Snooping only considers the PERSISTENT RESERVATION OUT commands from the guest |
|||
and does not track reservation changes made by other SCSI initiators. QEMU's |
|||
snooped reservation details can become stale if another SCSI initiator |
|||
makes changes to the reservation. |
|||
|
|||
Guests running on the same host share a single SCSI initiator identity unless |
|||
Fibre Channel N_Port ID Virtualization is configured. As a consequence, |
|||
multiple guests on the same hosts may observe unexpected behavior if they use |
|||
the same physical LUN. From the LUN's perspective all guests are the same |
|||
initiator and there is no way to distinguish between guests. |
|||
Loading…
Reference in new issue