[libvirt] [PATCH v3 14/28] lock_daemon_dispatch: Check for ownerPid rather than ownerId

John Ferlan jferlan at redhat.com
Thu Aug 30 21:47:33 UTC 2018



On 08/27/2018 04:08 AM, Michal Privoznik wrote:
> At the beginning of each dispatch function we check if owner
> attributes were registered (these consist of ID, UUID, PID and
> name). The check then consists of checking if ID is not zero.
> This is not going to work with
> VIR_LOCK_MANAGER_OBJECT_TYPE_DAEMON which doesn't set ID. Switch
> to setting PID which is available for both cases.
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  src/locking/lock_daemon_dispatch.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 

BTW: My idea of setting id == -1 for deamon still works without any
change required in/for this patch.

So what would be concerning about using ownerPid would be that over the
lifetime of the host the @pid can recycle; whereas, during the lifetime
of the daemon don't we guarantee that the @id will be ever increasing?
But right now I'm too lazy to go look and see if getting the next id is
through libvirtd or virtlockd.

Not against this, but I need to get feedback from earlier patches and of
course your thoughts on the @id vs. @pid rotation.  Plus I need see how
this plays out in future patches.

John




More information about the libvir-list mailing list