Patchwork [04/21] cpu: resume CPU from CPUClass.cpu_common_realizefn() when it is hot-plugged

login
register
mail settings
Submitter Igor Mammedov
Date April 23, 2013, 8:29 a.m.
Message ID <1366705795-24732-5-git-send-email-imammedo@redhat.com>
Download mbox | patch
Permalink /patch/238832/
State New
Headers show

Comments

Igor Mammedov - April 23, 2013, 8:29 a.m.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v2:
  s/resume_vcpu/cpu_resume/
v2:
 * remove unnecessary now sysemu/cpus.h header
 * move out introducing resume_vcpu() into a separate patch
---
 qom/cpu.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Andreas Färber - April 24, 2013, 3:37 p.m.
Am 23.04.2013 10:29, schrieb Igor Mammedov:
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
> v2:
>   s/resume_vcpu/cpu_resume/
> v2:
>  * remove unnecessary now sysemu/cpus.h header
>  * move out introducing resume_vcpu() into a separate patch
> ---
>  qom/cpu.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)

Thanks, applied to qom-cpu (rebased on introduction of cpu variable and
aligning commit messages wrt realize):

https://github.com/afaerber/qemu-cpu/commits/qom-cpu

> diff --git a/qom/cpu.c b/qom/cpu.c
> index 0c76712..abb20d0 100644
> --- a/qom/cpu.c
> +++ b/qom/cpu.c
> @@ -60,6 +60,7 @@ static void cpu_common_realizefn(DeviceState *dev, Error **errp)
>  {
>      if (dev->hotplugged) {
>          cpu_synchronize_post_init(CPU(dev));
> +        cpu_resume(CPU(dev));

Having introduced CPUState *cpu in a preceding patch, we can avoid the
duplicate CPU() cast here.

>      }
>  }
>  

Andreas

Patch

diff --git a/qom/cpu.c b/qom/cpu.c
index 0c76712..abb20d0 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -60,6 +60,7 @@  static void cpu_common_realizefn(DeviceState *dev, Error **errp)
 {
     if (dev->hotplugged) {
         cpu_synchronize_post_init(CPU(dev));
+        cpu_resume(CPU(dev));
     }
 }