qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 7/7] Implement cpu hot-add using device_add moni


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 7/7] Implement cpu hot-add using device_add monitor command
Date: Wed, 15 Feb 2012 17:35:34 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15

On 02/15/2012 05:16 PM, Igor Mammedov wrote:
Adds ability to hot-add cpus if guest was started with options
     -smp X,maxcpus=Y
where X<  Y.
For simplicity sake this implementation doesn't allow to add specific
cpu but rather it adds the next not yet plugged cpu.

For adding cpu just execute following command in monitor:
     device_add cpu-pc
If guest was started with a specific cpu model, then add option model
to cmonitor command. for example:
     device_add cpu-pc,model="host"

Signed-off-by: Igor Mammedov<address@hidden>

I don't see how the code matches this description, but unless you've got qdev-ification patches in the earlier ones (haven't made the list yet), device_add is not the right place for this.

There's no such thing as "cpu-pc" either.  You should start with a cpu_add 
command.

Regards,

Anthony Liguori

---
  hw/pc.c |   11 +++++++++++
  1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index ec50f16..5923549 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -44,6 +44,8 @@
  #include "ui/qemu-spice.h"
  #include "memory.h"
  #include "exec-memory.h"
+#include "cpus.h"
+#include "kvm.h"

  /* output Bochs bios info messages */
  //#define DEBUG_BIOS
@@ -941,6 +943,10 @@ static int cpu_device_init(ICCBusDevice *dev)
  #endif
      }

+    if (runstate_is_running()) {
+        pause_all_vcpus();
+    }
+
      if (cpu_x86_init_inplace(env, cpu->model)<  0) {
          return -1;
      }
@@ -949,6 +955,11 @@ static int cpu_device_init(ICCBusDevice *dev)
          env->apic_state = apic_init(env, env->cpuid_apic_id);
      }

+    cpu_synchronize_post_init(env);
+    if (runstate_is_running()) {
+        resume_all_vcpus();
+        acpi_cpu_hot_plug(env->cpuid_apic_id, 1);
+    }
      return 0;
  }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]