[libvirt] [PATCH 04/14] qemu_domain: Introduce qemuDomainDiskPRObject
Peter Krempa
pkrempa at redhat.com
Mon Feb 12 16:03:46 UTC 2018
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 <mprivozn at 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.
-------------- 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/20180212/ffd856dd/attachment-0001.sig>
More information about the libvir-list
mailing list