]> git.proxmox.com Git - mirror_qemu.git/commitdiff
s390x: allow cpu hotplug via device_add
authorDavid Hildenbrand <david@redhat.com>
Wed, 13 Sep 2017 13:24:11 +0000 (15:24 +0200)
committerCornelia Huck <cohuck@redhat.com>
Tue, 19 Sep 2017 16:31:32 +0000 (18:31 +0200)
E.g. the following now works:
    device_add host-s390-cpu,id=cpu1,core-id=1

The system will perform the same checks as when using cpu_add:
- If the core_id is already in use
- If the next sequential core_id isn't used
- If core-id >= max_cpu is specified

In addition, mixed CPU models are checked. E.g. if starting with
-cpu host and trying to hotplug "qemu-s390-cpu":
    "Mixed CPU models are not supported on s390x."

Reviewed-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20170913132417.24384-17-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
target/s390x/cpu.c

index 8c1c644057929ba4aac79160af03f24c6ba7f313..5724dffb88ab9d48b2674569a8d661255411bf0c 100644 (file)
@@ -467,6 +467,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
     scc->parent_realize = dc->realize;
     dc->realize = s390_cpu_realizefn;
     dc->props = s390x_cpu_properties;
+    dc->user_creatable = true;
 
     scc->parent_reset = cc->reset;
 #if !defined(CONFIG_USER_ONLY)