On 6/10/25 19:15, Simon Coter wrote:
Adding users DL to possibly reach out a wider audience.
Simon
Dropping devel list as this is users list material.
> On Jun 9, 2025, at 7:28 PM, Annie Li <annie.li(a)oracle.com>
wrote:
>
> Hello,
>
> I've been looking at source code related to persistent reservation and
> got confused a little bit about managed persistent reservation disks.
> For disk configured with 'managed=yes' as the following,
>
> <reservations managed='yes'>
> <source type='unix' path='/var/lib/libvirt/qemu/domain-7-
> brml10g19-iscsi-rese/pr-helper0.sock' mode='client'/>
> </reservations>
>
> libvirt is responsible for starting a pr-helper program with a
> specific associated socket file. The following source code shows that
> there is only one pr-helper and socket file associated with the
> managed disks for one VM.
>
> const char *
> qemuDomainGetManagedPRAlias(void)
> {
> return "pr-helper0";
> }
> char *
> qemuDomainGetManagedPRSocketPath(qemuDomainObjPrivate *priv)
> {
> return g_strdup_printf("%s/%s.sock", priv->libDir,
> qemuDomainGetManagedPRAlias());
> }
>
> So if the VM is booted with multiple disks configured with
> 'managed=yes' for reservation, I suppose these multiple disks share
> the this managed pr-helper and socket file. However, per the qemu
> document,
https://www.qemu.org/docs/master/interop/pr-helper.html
> <
https://www.qemu.org/docs/master/interop/pr-helper.html>
> "It is invalid to send multiple commands concurrently on the same
> socket. It is however possible to connect multiple sockets to the
> helper and send multiple commands to the helper for one or more file
> descriptors."
>
This certainly did not use to be the case. IIRC this was discussed in
this very old thread:
https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/UU...
Maybe QEMU has some internal lock that does the right thing and
serializes requests?
Michal
> Due to this limitation above, only one persistent reservation
disk is
> allowed as managed in theory. However, libvirt doesn't throw out any
> error or warning when the VM is booted up with multiple managed
> persistent reservation disks. I am wondering if I've missed something
> here?
>
> For unmanaged persistent reservation disks, libvirt doesn't start the
> pr-helper program for them. It is user's responsibility to start this
> program with customized socket file per disk, but the complexity
> increases with numbers of persistent reservation disks, especially in
> the case of hotplug/hotunplog. Is there any plan to support multiple
> managed persistent reservation disks with separate pr-helper/socket file?
>
> Any suggestions/clarifications are greatly appreciated.
>
> Thanks
>
> Annie
>