[libvirt] [PATCH] qemu: process: Clear priv->namespaces on VM shutdown

Peter Krempa posted 1 patch 6 years, 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/2f4a7388e6ab10d73e600a4e66a646c5d3defb86.1495453201.git.pkrempa@redhat.com
src/qemu/qemu_process.c | 4 ++++
1 file changed, 4 insertions(+)
[libvirt] [PATCH] qemu: process: Clear priv->namespaces on VM shutdown
Posted by Peter Krempa 6 years, 11 months ago
Otherwise the private data entry would be kept across instances of the
same VM even if it's not configured to do so.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1453142
---
 src/qemu/qemu_process.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index c19bd2925..ac17da668 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6449,6 +6449,10 @@ void qemuProcessStop(virQEMUDriverPtr driver,
     /* clean up migration data */
     VIR_FREE(priv->migTLSAlias);

+    /* clear previously used namespaces */
+    virBitmapFree(priv->namespaces);
+    priv->namespaces = NULL;
+
     /* The "release" hook cleans up additional resources */
     if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) {
         char *xml = qemuDomainDefFormatXML(driver, vm->def, 0);
-- 
2.12.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: process: Clear priv->namespaces on VM shutdown
Posted by Martin Kletzander 6 years, 11 months ago
On Mon, May 22, 2017 at 01:40:01PM +0200, Peter Krempa wrote:
>Otherwise the private data entry would be kept across instances of the
>same VM even if it's not configured to do so.
>
>Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1453142
>---
> src/qemu/qemu_process.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
>diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
>index c19bd2925..ac17da668 100644
>--- a/src/qemu/qemu_process.c
>+++ b/src/qemu/qemu_process.c
>@@ -6449,6 +6449,10 @@ void qemuProcessStop(virQEMUDriverPtr driver,
>     /* clean up migration data */
>     VIR_FREE(priv->migTLSAlias);
>
>+    /* clear previously used namespaces */
>+    virBitmapFree(priv->namespaces);
>+    priv->namespaces = NULL;
>+

Does this mean we can kill the call to qemuDomainDestroyNamespace() from
qemuProcessHandleMonitorEOF() (and possibly the whole function)?

ACK either way, this should be cleaned up every time.

>     /* The "release" hook cleans up additional resources */
>     if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) {
>         char *xml = qemuDomainDefFormatXML(driver, vm->def, 0);
>--
>2.12.2
>
>--
>libvir-list mailing list
>libvir-list@redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: process: Clear priv->namespaces on VM shutdown
Posted by Peter Krempa 6 years, 11 months ago
On Mon, May 22, 2017 at 15:04:58 +0200, Martin Kletzander wrote:
> On Mon, May 22, 2017 at 01:40:01PM +0200, Peter Krempa wrote:
> > Otherwise the private data entry would be kept across instances of the
> > same VM even if it's not configured to do so.
> > 
> > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1453142
> > ---
> > src/qemu/qemu_process.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> > 
> > diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> > index c19bd2925..ac17da668 100644
> > --- a/src/qemu/qemu_process.c
> > +++ b/src/qemu/qemu_process.c
> > @@ -6449,6 +6449,10 @@ void qemuProcessStop(virQEMUDriverPtr driver,
> >     /* clean up migration data */
> >     VIR_FREE(priv->migTLSAlias);
> > 
> > +    /* clear previously used namespaces */
> > +    virBitmapFree(priv->namespaces);
> > +    priv->namespaces = NULL;
> > +
> 
> Does this mean we can kill the call to qemuDomainDestroyNamespace() from
> qemuProcessHandleMonitorEOF() (and possibly the whole function)?

The comment there hints that it may be necessary in some cleanup cases,
so I did not remove it.

> 
> ACK either way, this should be cleaned up every time.

Thanks, there are no cleanup steps after that so clearing it is okay
either way.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: process: Clear priv->namespaces on VM shutdown
Posted by Pavel Hrdina 6 years, 11 months ago
On Mon, May 22, 2017 at 01:40:01PM +0200, Peter Krempa wrote:
> Otherwise the private data entry would be kept across instances of the
> same VM even if it's not configured to do so.
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1453142
> ---
>  src/qemu/qemu_process.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index c19bd2925..ac17da668 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -6449,6 +6449,10 @@ void qemuProcessStop(virQEMUDriverPtr driver,
>      /* clean up migration data */
>      VIR_FREE(priv->migTLSAlias);
> 
> +    /* clear previously used namespaces */
> +    virBitmapFree(priv->namespaces);
> +    priv->namespaces = NULL;
> +

I think that qemuDomainDestroyNamespace() would be better to use.

>      /* The "release" hook cleans up additional resources */
>      if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) {
>          char *xml = qemuDomainDefFormatXML(driver, vm->def, 0);

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list