On Thu, Jan 18, 2018 at 17:04:36 +0100, Michal Privoznik wrote:
> This is an extended definition of virStoragePRDef because it
> contains runtime information (like path to pr helper socket, its
> pid and alias). Since these are driver dependant we should have a
> driver specific structure instead of putting all of that into
> driver agnostic structure.
> 
> Signed-off-by: Michal Privoznik <mpriv...@redhat.com>
> ---
>  src/qemu/qemu_domain.c | 120 
> +++++++++++++++++++++++++++++++++++++++++++++++++
>  src/qemu/qemu_domain.h |  18 ++++++++
>  2 files changed, 138 insertions(+)
> 
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index e8539dcab..7fa8c93b7 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -65,6 +65,7 @@
>  #endif
>  #include <sys/time.h>
>  #include <fcntl.h>
> +#include <signal.h>
>  #if defined(HAVE_SYS_MOUNT_H)
>  # include <sys/mount.h>
>  #endif
> @@ -1829,6 +1830,9 @@ qemuDomainObjPrivateDataClear(qemuDomainObjPrivatePtr 
> priv)
>  
>      virBitmapFree(priv->migrationCaps);
>      priv->migrationCaps = NULL;
> +
> +    virHashFree(priv->prHelpers);
> +    priv->prHelpers = NULL;
>  }
>  
>  
> @@ -10917,6 +10921,122 @@ 
> qemuDomainCheckMigrationCapabilities(virQEMUDriverPtr driver,
>  }
>  
>  
> +static void
> +qemuDomainDiskPRObjectHashFree(void *payload,
> +                               const void *name)
> +{
> +    qemuDomainDiskPRObjectPtr tmp = payload;
> +
> +    if (tmp->managed &&
> +        tmp->pid != (pid_t) -1) {
> +        VIR_DEBUG("Forcibly killing pr-manager: %s", (const char *) name);
> +        virProcessKillPainfully(tmp->pid, true);

Is this really a good idea? If you restart libvirtd gracefully, this
will kill all the PR daemons.

Also I'd prefer if all the process management code would be in
qemu_process.c.

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to