Patchwork [RFC,4/5] target-i386: Make CPU objects user-creatable

login
register
mail settings
Submitter Eduardo Habkost
Date April 30, 2014, 8:29 p.m.
Message ID <1398889773-14652-5-git-send-email-ehabkost@redhat.com>
Download mbox | patch
Permalink /patch/344313/
State New
Headers show

Comments

Eduardo Habkost - April 30, 2014, 8:29 p.m.
Creating X86CPU objects using object-add will allow management code to
probe for details on each CPU model when using "-machine none", and
without having to restart QEMU.

Note that object-add will _not_ create a running VCPU. It is not CPU
hotplug, which will use device_add instead of object-add. It will just
allow some information about the CPU object to be queried from the CPU
object, without starting an actual VCPU thread.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/cpu.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 8fd1497..2417fc8 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -43,6 +43,7 @@ 
 #include "sysemu/sysemu.h"
 #include "hw/qdev-properties.h"
 #include "hw/cpu/icc_bus.h"
+#include "qom/object_interfaces.h"
 #ifndef CONFIG_USER_ONLY
 #include "hw/xen/xen.h"
 #include "hw/i386/apic_internal.h"
@@ -2832,6 +2833,10 @@  static const TypeInfo x86_cpu_type_info = {
     .abstract = true,
     .class_size = sizeof(X86CPUClass),
     .class_init = x86_cpu_common_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { TYPE_USER_CREATABLE },
+        { }
+    },
 };
 
 static void x86_cpu_register_types(void)