[PATCH 0/9] Support persistent reservation operations

Changqi Lu posted 9 patches 6 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240508093629.441057-1-luchangqi.123@bytedance.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Fam Zheng <fam@euphon.net>, Ronnie Sahlberg <ronniesahlberg@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, Peter Lieven <pl@dlhnet.de>, Keith Busch <kbusch@kernel.org>, Klaus Jensen <its@irrelevant.dk>, Jesper Devantier <foss@defmacro.it>, "Philippe Mathieu-Daudé" <philmd@linaro.org>
There is a newer version of this series
block/block-backend.c             | 386 +++++++++++++++++++++++++++++
block/io.c                        | 161 ++++++++++++
block/iscsi.c                     | 390 ++++++++++++++++++++++++++++++
block/raw-format.c                |  55 +++++
hw/nvme/ctrl.c                    | 304 ++++++++++++++++++++++-
hw/nvme/nvme.h                    |  44 ++++
hw/scsi/scsi-disk.c               | 302 +++++++++++++++++++++++
include/block/block-common.h      |   9 +
include/block/block-io.h          |  19 ++
include/block/block_int-common.h  |  31 +++
include/block/nvme.h              |  67 +++++
include/scsi/constants.h          |  29 +++
include/scsi/utils.h              |   5 +
include/sysemu/block-backend-io.h |  22 ++
scsi/utils.c                      |  40 +++
15 files changed, 1863 insertions(+), 1 deletion(-)
[PATCH 0/9] Support persistent reservation operations
Posted by Changqi Lu 6 months, 2 weeks ago
Hi,

I am going to introduce persistent reservation for QEMU block.
There are three parts in this series:

Firstly, at the block layer, the commit abstracts seven APIs related to
the persistent reservation command. These APIs including reading keys,
reading reservations, registering, reserving, releasing, clearing and preempting.

Next, the commit implements the necessary pr-related operation APIs for both the
SCSI protocol and NVMe protocol at the device layer. This ensures that the necessary
functionality is available for handling persistent reservations in these protocols.

Finally, the commit includes adaptations to the iscsi driver at the driver layer
to verify the correct implementation and functionality of the changes.

With these changes, GFS works fine in the guest. Also, sg-utils(for SCSI block) and
nvme-cli(for NVMe block) work fine too.

Changqi Lu (9):
  block: add persistent reservation in/out api
  block/raw: add persistent reservation in/out driver
  scsi/constant: add persistent reservation in/out protocol constants
  scsi/util: add helper functions for persistent reservation types
    conversion
  hw/scsi: add persistent reservation in/out api for scsi device
  block/nvme: add reservation command protocol constants
  hw/nvme: add helper functions for converting reservation types
  hw/nvme: add reservation protocal command
  block/iscsi: add persistent reservation in/out driver

 block/block-backend.c             | 386 +++++++++++++++++++++++++++++
 block/io.c                        | 161 ++++++++++++
 block/iscsi.c                     | 390 ++++++++++++++++++++++++++++++
 block/raw-format.c                |  55 +++++
 hw/nvme/ctrl.c                    | 304 ++++++++++++++++++++++-
 hw/nvme/nvme.h                    |  44 ++++
 hw/scsi/scsi-disk.c               | 302 +++++++++++++++++++++++
 include/block/block-common.h      |   9 +
 include/block/block-io.h          |  19 ++
 include/block/block_int-common.h  |  31 +++
 include/block/nvme.h              |  67 +++++
 include/scsi/constants.h          |  29 +++
 include/scsi/utils.h              |   5 +
 include/sysemu/block-backend-io.h |  22 ++
 scsi/utils.c                      |  40 +++
 15 files changed, 1863 insertions(+), 1 deletion(-)

-- 
2.20.1
Re: [PATCH 0/9] Support persistent reservation operations
Posted by Stefan Hajnoczi 6 months, 2 weeks ago
On Wed, May 08, 2024 at 05:36:20PM +0800, Changqi Lu wrote:
> Hi,
> 
> I am going to introduce persistent reservation for QEMU block.
> There are three parts in this series:
> 
> Firstly, at the block layer, the commit abstracts seven APIs related to
> the persistent reservation command. These APIs including reading keys,
> reading reservations, registering, reserving, releasing, clearing and preempting.
> 
> Next, the commit implements the necessary pr-related operation APIs for both the
> SCSI protocol and NVMe protocol at the device layer. This ensures that the necessary
> functionality is available for handling persistent reservations in these protocols.
> 
> Finally, the commit includes adaptations to the iscsi driver at the driver layer
> to verify the correct implementation and functionality of the changes.
> 
> With these changes, GFS works fine in the guest. Also, sg-utils(for SCSI block) and
> nvme-cli(for NVMe block) work fine too.

What is the relationship to the existing PRManager functionality
(docs/interop/pr-helper.rst) where block/file-posix.c interprets SCSI
ioctls and sends persistent reservation requests to an external helper
process?

I wonder if block/file-posix.c can implement the new block driver
callbacks using pr_mgr (while keeping the existing scsi-generic
support).

Stefan