[libvirt] [PATCH 4/4] qemu: Split handling of managed and unmanaged persistent reservations

Peter Krempa pkrempa at redhat.com
Thu May 31 17:59:35 UTC 2018


On Thu, May 31, 2018 at 19:30:25 +0200, Peter Krempa wrote:
> Add code that will handle the managed persistent reservations object
> separately from the unmanaged one. There is only one managed object so
> handling it with disks is awkward and does not scale well when backing
> chains come into view.
> 
> Signed-off-by: Peter Krempa <pkrempa at redhat.com>
> ---
>  src/qemu/qemu_command.c                            | 113 +++++++++++++++------
>  src/qemu/qemu_command.h                            |   1 +
>  src/qemu/qemu_hotplug.c                            | 104 ++++++++-----------
>  ...isk-virtio-scsi-reservations.x86_64-latest.args |   4 +-
>  4 files changed, 130 insertions(+), 92 deletions(-)

[...]

> diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> index e78aff7adf..21503b3905 100644
> --- a/src/qemu/qemu_hotplug.c
> +++ b/src/qemu/qemu_hotplug.c

[...]

> @@ -461,16 +441,13 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver,
>      if (encinfo && qemuBuildSecretInfoProps(encinfo, &encobjProps) < 0)
>          goto error;
> 
> -    if (qemuMaybeBuildPRManagerInfoProps(vm, disk, &prmgrProps) < 0)
> +    if (qemuDomainDiskAttachManagedPR(vm, disk, &managedPrmgrProps) < 0)
>          goto error;
> 
> -    /* Start daemon only after prmgrProps is built. Otherwise
> -     * qemuDomainMaybeStartPRDaemon() might start daemon and set
> -     * priv->prDaemonRunning which confuses props building code. */
> -    if ((rv = qemuDomainMaybeStartPRDaemon(vm, disk)) < 0)
> +    if (disk->src->pr &&
> +        virStoragePRDefIsManaged(disk->src->pr) &&

This condition term is supposed to be inverted, since we are adding only
non-managed objects here. I'll fix it in my branch.

> +        !(unmanagedPrmgrProps = qemuBuildPRManagerInfoProps(disk->src)))
>          goto error;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180531/ae6f9f95/attachment-0001.sig>


More information about the libvir-list mailing list