From nobody Mon Feb 9 17:25:15 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1769456975; cv=none; d=zohomail.com; s=zohoarc; b=BjcS/ILDyUsDp+29Tx8Kzcc06zK2QC/YQt7zXa614+S0Zbl/b9fztlF3h23EgeIFGzLdApsn0UChvQbmVqb74b7MImRO2l6BXa79epH/8fmXx/8Gb6rkP/eE3cyeY5KpjTePUTuA77wjHL00crY7yKi4XoaSX77hvm7UAeFFSpI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769456975; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HssO8XaU3aOzfMrJOnBdsvEsYFflmJgynuuBcKjEJ5A=; b=R4KoN1iGazD+sm2WzoDYidL31gaPOfTDCi7NYb0ZntVaDkghTT5ZPpiyzxYhOp/MdhqHeN1I80NkuSjwStqO1Iz3YRMrWZDeyIoF0D8t6QEHeMbZn7uA8WLzhPw3Xuo63gXT6Bm1fYEIiLutLsf9WmCbx1uy8n2cxum45jmpKBI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769456975634184.06384954239195; Mon, 26 Jan 2026 11:49:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkSZQ-0005h4-Ek; Mon, 26 Jan 2026 14:48:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vkSZA-0005cw-8V for qemu-devel@nongnu.org; Mon, 26 Jan 2026 14:48:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vkSZ8-0007N8-Lx for qemu-devel@nongnu.org; Mon, 26 Jan 2026 14:48:04 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-319-dEkSRpupP5GyW6lnwaPvqg-1; Mon, 26 Jan 2026 14:47:58 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 53EC5180047F; Mon, 26 Jan 2026 19:47:56 +0000 (UTC) Received: from localhost (unknown [10.2.17.0]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7275D19560B2; Mon, 26 Jan 2026 19:47:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769456882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HssO8XaU3aOzfMrJOnBdsvEsYFflmJgynuuBcKjEJ5A=; b=f7WVVkypB1VqlFPdyb6q3DkUKO/eawj0eAfU6BxJo6pmem8uf+GRsMktdQ1hCfeI5KGU8z 6UGndsvpYz3EWIwXkm0eysr+zjisjW+UmuVWg6Nn3XEZ7/SMlOX3GtDvaxV0u+0fw5Vhj8 LDOFMBIIOTy4ce9plVi27Ce5LiO6exk= X-MC-Unique: dEkSRpupP5GyW6lnwaPvqg-1 X-Mimecast-MFC-AGG-ID: dEkSRpupP5GyW6lnwaPvqg_1769456876 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: pkrempa@redhat.com, Paolo Bonzini , Alberto Faria , Hannes Reinecke , Zhao Liu , Kevin Wolf , qemu-block@nongnu.org, Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Qing Wang , Yanan Wang , Marcel Apfelbaum , Stefan Hajnoczi Subject: [PATCH v2 5/5] docs: add SCSI migrate-pr documentation Date: Mon, 26 Jan 2026 14:47:35 -0500 Message-ID: <20260126194735.46167-6-stefanha@redhat.com> In-Reply-To: <20260126194735.46167-1-stefanha@redhat.com> References: <20260126194735.46167-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1769456976539158500 Content-Type: text/plain; charset="utf-8" Suggested-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- docs/system/device-emulation.rst | 1 + docs/system/devices/scsi/index.rst | 10 +++++ docs/system/devices/scsi/migrate-pr.rst | 54 +++++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 docs/system/devices/scsi/index.rst create mode 100644 docs/system/devices/scsi/migrate-pr.rst diff --git a/docs/system/device-emulation.rst b/docs/system/device-emulatio= n.rst index 971325527a..40054bb7df 100644 --- a/docs/system/device-emulation.rst +++ b/docs/system/device-emulation.rst @@ -95,6 +95,7 @@ Emulated Devices devices/keyboard.rst devices/net.rst devices/nvme.rst + devices/scsi/index.rst devices/usb-u2f.rst devices/usb.rst devices/vfio-user.rst diff --git a/docs/system/devices/scsi/index.rst b/docs/system/devices/scsi/= index.rst new file mode 100644 index 0000000000..4f0929b0ca --- /dev/null +++ b/docs/system/devices/scsi/index.rst @@ -0,0 +1,10 @@ +SCSI Devices +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Several SCSI devices are available in QEMU. They are primarily used for bl= ock +storage. + +.. toctree:: + :maxdepth: 1 + + migrate-pr.rst diff --git a/docs/system/devices/scsi/migrate-pr.rst b/docs/system/devices/= scsi/migrate-pr.rst new file mode 100644 index 0000000000..a8f2790a86 --- /dev/null +++ b/docs/system/devices/scsi/migrate-pr.rst @@ -0,0 +1,54 @@ +.. + SPDX-License-Identifier: GPL-2.0-or-later + +.. _scsi_migrate_pr: + +SCSI Persistent Reservation Live Migration +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +This document explains how to live migrate SCSI Persistent Reservations. + +The ``scsi-block`` device migrates SCSI Persistent Reservations when the +``migrate-pr=3Don`` 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=3Don,...``. + +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 PRE= EMPT +service action to atomically transfer the reservation to the destination b= efore +the guest starts running on the destination. + +The following persistent reservation capabilities reported by the PERSISTE= NT +RESERVATION IN command with the REPORT CAPABILITIES service action are mas= ked +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 intend= ed +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 soft= ware +inside the guest must acquire the reservation after boot in order for live +migration to work. Similarly, if the reservation is acquired outside the g= uest +then it will not live migrate along with the guest. + +Snooping only considers the PERSISTENT RESERVATION OUT commands from the g= uest +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 unl= ess +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. --=20 2.52.0