From 687730540e405fe4da1148c8fe0e162339b0815b Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Mon, 27 Nov 2017 11:54:33 +0100 Subject: [PATCH] virstoragefile: Introduce virStoragePRDef This is a definition that holds information on SCSI persistent reservation settings. The XML part looks like this: If @managed is set to 'yes' then the is not parsed. This design was agreed on here: https://www.redhat.com/archives/libvir-list/2017-November/msg01005.html Signed-off-by: Michal Privoznik Reviewed-by: John Ferlan --- docs/formatdomain.html.in | 25 +++- docs/schemas/domaincommon.rng | 34 +---- docs/schemas/storagecommon.rng | 50 +++++++ src/conf/domain_conf.c | 38 +++++ src/libvirt_private.syms | 3 + src/util/virstoragefile.c | 131 ++++++++++++++++++ src/util/virstoragefile.h | 14 ++ .../disk-virtio-scsi-reservations.xml | 49 +++++++ .../disk-virtio-scsi-reservations.xml | 1 + tests/qemuxml2xmltest.c | 2 + 10 files changed, 316 insertions(+), 31 deletions(-) create mode 100644 tests/qemuxml2argvdata/disk-virtio-scsi-reservations.xml create mode 120000 tests/qemuxml2xmloutdata/disk-virtio-scsi-reservations.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index caeb14e2f4..072f9a0fdc 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2566,7 +2566,10 @@ </disk> <disk type='block' device='lun'> <driver name='qemu' type='raw'/> - <source dev='/dev/sda'/> + <source dev='/dev/sda'> + <reservations enabled='yes' managed='no'> + <source type='unix' path='/path/to/qemu-pr-helper' mode='client'/> + </reservations> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' target='3' unit='0'/> </disk> @@ -2929,6 +2932,26 @@ Storage Encryption page for more information. +
reservations
+
Since libvirt 4.4.0, the + reservations can be a sub-element of the + source element for storage sources (QEMU driver only). + If present (and enabled) it enables persistent reservations for SCSI + based disks. The element has one mandatory attribute + enabled with accepted values yes and + no. If the feature is enabled, then there's another + mandatory attribute managed (accepted values are the + same as for enabled) that enables or disables libvirt + spawning a helper process. When the PR is unmanaged, then hypervisor + acts as a client and path to server socket must be provided in child + element source, which currently accepts only the + following attributes: type with one value + unix, path with path the socket, and + finally mode which accepts one value + client and specifies the role of hypervisor. + It's recommended to allow libvirt manage the persistent + reservations. +

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 0a6b29b2f6..8c446ca418 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1530,6 +1530,9 @@ + + + @@ -2434,18 +2437,6 @@ - - - - - - - - - - - -