[libvirt] [PATCHv7 18/18] qemu: Setting up vcpu and adding pids to resctrl monitor groups during reconnection

Wang Huaqiang posted 18 patches 7 years, 3 months ago
There is a newer version of this series
[libvirt] [PATCHv7 18/18] qemu: Setting up vcpu and adding pids to resctrl monitor groups during reconnection
Posted by Wang Huaqiang 7 years, 3 months ago
Invoking qemuProcessSetupVcpus in process of VM reconnection.

The vcpu pid information need to be refilled to resctrl monitor
after a VM reconnection./

Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com>
---
 src/qemu/qemu_process.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index fba4fb4..ed0330b 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8008,6 +8008,9 @@ qemuProcessReconnect(void *opaque)
         }
     }
 
+    if (qemuProcessSetupVcpus(obj) < 0)
+        goto error;
+
     /* update domain state XML with possibly updated state in virDomainObj */
     if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, obj, driver->caps) < 0)
         goto error;
-- 
2.7.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCHv7 18/18] qemu: Setting up vcpu and adding pids to resctrl monitor groups during reconnection
Posted by John Ferlan 7 years, 3 months ago

On 10/22/18 4:01 AM, Wang Huaqiang wrote:
> Invoking qemuProcessSetupVcpus in process of VM reconnection.
> 
> The vcpu pid information need to be refilled to resctrl monitor
> after a VM reconnection./
> 
> Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com>
> ---
>  src/qemu/qemu_process.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index fba4fb4..ed0330b 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -8008,6 +8008,9 @@ qemuProcessReconnect(void *opaque)
>          }
>      }
>  
> +    if (qemuProcessSetupVcpus(obj) < 0)
> +        goto error;
> +

IIRC the reason for not needing this is that the assumption is that the
initial startup (ProcessLaunch) and any hotplug thereafter would end up
calling qemuProcessSetupVcpu.

Not sure this is necessary for everything except perhaps the resctrl
monitor *pids list which I'm not even sure is necessary.

John

>      /* update domain state XML with possibly updated state in virDomainObj */
>      if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, obj, driver->caps) < 0)
>          goto error;
> 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCHv7 18/18] qemu: Setting up vcpu and adding pids to resctrl monitor groups during reconnection
Posted by Wang, Huaqiang 7 years, 2 months ago

> -----Original Message-----
> From: John Ferlan [mailto:jferlan@redhat.com]
> Sent: Tuesday, November 6, 2018 4:09 AM
> To: Wang, Huaqiang <huaqiang.wang@intel.com>; libvir-list@redhat.com
> Cc: Feng, Shaohe <shaohe.feng@intel.com>; Niu, Bing <bing.niu@intel.com>;
> Ding, Jian-feng <jian-feng.ding@intel.com>; Zang, Rui <rui.zang@intel.com>
> Subject: Re: [PATCHv7 18/18] qemu: Setting up vcpu and adding pids to resctrl
> monitor groups during reconnection
> 
> 
> 
> On 10/22/18 4:01 AM, Wang Huaqiang wrote:
> > Invoking qemuProcessSetupVcpus in process of VM reconnection.
> >
> > The vcpu pid information need to be refilled to resctrl monitor after
> > a VM reconnection./
> >
> > Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com>
> > ---
> >  src/qemu/qemu_process.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index
> > fba4fb4..ed0330b 100644
> > --- a/src/qemu/qemu_process.c
> > +++ b/src/qemu/qemu_process.c
> > @@ -8008,6 +8008,9 @@ qemuProcessReconnect(void *opaque)
> >          }
> >      }
> >
> > +    if (qemuProcessSetupVcpus(obj) < 0)
> > +        goto error;
> > +
> 
> IIRC the reason for not needing this is that the assumption is that the initial
> startup (ProcessLaunch) and any hotplug thereafter would end up calling
> qemuProcessSetupVcpu.
> 
> Not sure this is necessary for everything except perhaps the resctrl monitor
> *pids list which I'm not even sure is necessary.
> 

This time I think this patch is not necessary. This patch is only 
required if *tasks file content is changed in process of re-connection.
Now I don't think the *tasks file will be changed because the vcpu 
processes are still there
in process of reconnection and no add no removal.

Patch will be removed.

> John
> 

Thanks for review.
Huaqiang

> >      /* update domain state XML with possibly updated state in virDomainObj */
> >      if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, obj, driver->caps) < 0)
> >          goto error;
> >

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