[libvirt] [PATCH 00/14] Basic implementation of persistent reservations

Michal Privoznik posted 14 patches 6 years, 3 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1516290874.git.mprivozn@redhat.com
There is a newer version of this series
docs/formatdomain.html.in                          |  25 +-
docs/schemas/domaincommon.rng                      |  19 +-
docs/schemas/storagecommon.rng                     |  34 ++
m4/virt-driver-qemu.m4                             |   5 +
src/conf/domain_conf.c                             |  36 ++
src/libvirt_private.syms                           |   4 +
src/qemu/libvirtd_qemu.aug                         |   1 +
src/qemu/qemu.conf                                 |   4 +
src/qemu/qemu_capabilities.c                       |   2 +
src/qemu/qemu_capabilities.h                       |   1 +
src/qemu/qemu_command.c                            |  59 +++
src/qemu/qemu_conf.c                               |   7 +-
src/qemu/qemu_conf.h                               |   1 +
src/qemu/qemu_domain.c                             | 435 ++++++++++++++++++++-
src/qemu/qemu_domain.h                             |  29 ++
src/qemu/qemu_hotplug.c                            | 110 ++++++
src/qemu/qemu_process.c                            | 160 ++++++++
src/qemu/qemu_process.h                            |   4 +
src/qemu/test_libvirtd_qemu.aug.in                 |   1 +
src/util/virstoragefile.c                          | 166 ++++++++
src/util/virstoragefile.h                          |  17 +
.../disk-virtio-scsi-reservations-not-managed.args |  28 ++
.../disk-virtio-scsi-reservations-not-managed.xml  |  40 ++
.../disk-virtio-scsi-reservations.args             |  29 ++
.../disk-virtio-scsi-reservations.xml              |  38 ++
tests/qemuxml2argvtest.c                           |   8 +
.../disk-virtio-scsi-reservations-not-managed.xml  |   1 +
.../disk-virtio-scsi-reservations.xml              |   1 +
tests/qemuxml2xmltest.c                            |   4 +
29 files changed, 1250 insertions(+), 19 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-virtio-scsi-reservations-not-managed.args
create mode 100644 tests/qemuxml2argvdata/disk-virtio-scsi-reservations-not-managed.xml
create mode 100644 tests/qemuxml2argvdata/disk-virtio-scsi-reservations.args
create mode 100644 tests/qemuxml2argvdata/disk-virtio-scsi-reservations.xml
create mode 120000 tests/qemuxml2xmloutdata/disk-virtio-scsi-reservations-not-managed.xml
create mode 120000 tests/qemuxml2xmloutdata/disk-virtio-scsi-reservations.xml
[libvirt] [PATCH 00/14] Basic implementation of persistent reservations
Posted by Michal Privoznik 6 years, 3 months ago
QEMU added support for SCSI persistent reservations. The way QEMU
implemented that makes it slightly harder for libvirt to adapt to - it's
a small binary that needs to start before qemu so that it can connect to
it. Basically, what libvirt does is:

1) start qemu-pr-helper (the small binary from above),
2) records its PID for tracking purposes
3) start qemu

and when shutting down a domain the process is reversed:

1) shut down qemu process,
2) kill qemu-pr-helper (PID was saved earlier).

Now, here also lies the last missing piece to he puzzle - what if
qemu-pr-helper dies while qemu is running? After some discussion with
Paolo it was agreed that qemu will emit an event for libvirt so that we
can respawn the process. Anyway, that shouldn't be a show stopper for
these patches (if it was the patch set might get too big).

Please test, review and comment.

As usual, you can find the patches on my github too:

https://github.com/zippy2/libvirt/tree/pr

Michal Privoznik (14):
  virstoragefile: Introduce virStoragePRDef
  qemuDomainDiskChangeSupported: Deny changing reservations
  qemu: Introduce pr-manager-helper capability
  qemu_domain: Introduce qemuDomainDiskPRObject
  qemu: Generate alias for pr-helper
  qemu: Store prAlias and prPath in status XML
  qemu: Generate cmd line at startup
  qemu: Introduce pr_helper to qemu.conf
  qemu: Start PR daemons on domain startup
  qemu: Track PR daemons PIDs in status XML
  qemu_domain: Introduce qemuDomainGetPRUsageCount
  qemu_process.c: Introduce qemuProcessSetupPRDaemon
  qemu_hotplug: Hotplug of reservations
  qemu_hotplug: Hotunplug of reservations

 docs/formatdomain.html.in                          |  25 +-
 docs/schemas/domaincommon.rng                      |  19 +-
 docs/schemas/storagecommon.rng                     |  34 ++
 m4/virt-driver-qemu.m4                             |   5 +
 src/conf/domain_conf.c                             |  36 ++
 src/libvirt_private.syms                           |   4 +
 src/qemu/libvirtd_qemu.aug                         |   1 +
 src/qemu/qemu.conf                                 |   4 +
 src/qemu/qemu_capabilities.c                       |   2 +
 src/qemu/qemu_capabilities.h                       |   1 +
 src/qemu/qemu_command.c                            |  59 +++
 src/qemu/qemu_conf.c                               |   7 +-
 src/qemu/qemu_conf.h                               |   1 +
 src/qemu/qemu_domain.c                             | 435 ++++++++++++++++++++-
 src/qemu/qemu_domain.h                             |  29 ++
 src/qemu/qemu_hotplug.c                            | 110 ++++++
 src/qemu/qemu_process.c                            | 160 ++++++++
 src/qemu/qemu_process.h                            |   4 +
 src/qemu/test_libvirtd_qemu.aug.in                 |   1 +
 src/util/virstoragefile.c                          | 166 ++++++++
 src/util/virstoragefile.h                          |  17 +
 .../disk-virtio-scsi-reservations-not-managed.args |  28 ++
 .../disk-virtio-scsi-reservations-not-managed.xml  |  40 ++
 .../disk-virtio-scsi-reservations.args             |  29 ++
 .../disk-virtio-scsi-reservations.xml              |  38 ++
 tests/qemuxml2argvtest.c                           |   8 +
 .../disk-virtio-scsi-reservations-not-managed.xml  |   1 +
 .../disk-virtio-scsi-reservations.xml              |   1 +
 tests/qemuxml2xmltest.c                            |   4 +
 29 files changed, 1250 insertions(+), 19 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/disk-virtio-scsi-reservations-not-managed.args
 create mode 100644 tests/qemuxml2argvdata/disk-virtio-scsi-reservations-not-managed.xml
 create mode 100644 tests/qemuxml2argvdata/disk-virtio-scsi-reservations.args
 create mode 100644 tests/qemuxml2argvdata/disk-virtio-scsi-reservations.xml
 create mode 120000 tests/qemuxml2xmloutdata/disk-virtio-scsi-reservations-not-managed.xml
 create mode 120000 tests/qemuxml2xmloutdata/disk-virtio-scsi-reservations.xml

-- 
2.13.6

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 00/14] Basic implementation of persistent reservations
Posted by Michal Privoznik 6 years, 2 months ago
On 01/18/2018 05:04 PM, Michal Privoznik wrote:
>

Ping?

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 00/14] Basic implementation of persistent reservations
Posted by Peter Krempa 6 years, 2 months ago
On Thu, Jan 18, 2018 at 17:04:32 +0100, Michal Privoznik wrote:
> QEMU added support for SCSI persistent reservations. The way QEMU
> implemented that makes it slightly harder for libvirt to adapt to - it's
> a small binary that needs to start before qemu so that it can connect to
> it. Basically, what libvirt does is:
> 
> 1) start qemu-pr-helper (the small binary from above),
> 2) records its PID for tracking purposes
> 3) start qemu
> 
> and when shutting down a domain the process is reversed:
> 
> 1) shut down qemu process,
> 2) kill qemu-pr-helper (PID was saved earlier).
> 
> Now, here also lies the last missing piece to he puzzle - what if
> qemu-pr-helper dies while qemu is running? After some discussion with
> Paolo it was agreed that qemu will emit an event for libvirt so that we
> can respawn the process. Anyway, that shouldn't be a show stopper for
> these patches (if it was the patch set might get too big).

Well, in general we should not allow these patches without that
sub-feature so that we don't have a version of libvirt out there which
will not handle that part.

> 
> Please test, review and comment.
> 
> As usual, you can find the patches on my github too:
> 
> https://github.com/zippy2/libvirt/tree/pr
> 
> Michal Privoznik (14):
>   virstoragefile: Introduce virStoragePRDef
>   qemuDomainDiskChangeSupported: Deny changing reservations
>   qemu: Introduce pr-manager-helper capability
>   qemu_domain: Introduce qemuDomainDiskPRObject
>   qemu: Generate alias for pr-helper
>   qemu: Store prAlias and prPath in status XML
>   qemu: Generate cmd line at startup
>   qemu: Introduce pr_helper to qemu.conf
>   qemu: Start PR daemons on domain startup
>   qemu: Track PR daemons PIDs in status XML
>   qemu_domain: Introduce qemuDomainGetPRUsageCount
>   qemu_process.c: Introduce qemuProcessSetupPRDaemon
>   qemu_hotplug: Hotplug of reservations
>   qemu_hotplug: Hotunplug of reservations

Ordering of the patches should be modified in such way, that the feature
can be enabled only once all the supporting code is already in.

E.g. hotplug should be fixed prior to enabling it, or command line
generators should not allow formatting it prior to libvirtd being able
to start the PR daemon.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list