]> xenbits.xensource.com Git - qemu-upstream-4.4-testing.git/commitdiff
xen: Fix vcpu initialization.
authorAnthony PERARD <anthony.perard@citrix.com>
Wed, 25 Sep 2013 16:41:48 +0000 (16:41 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Mon, 17 Feb 2014 15:44:43 +0000 (15:44 +0000)
Each vcpu need a evtchn binded in qemu, even those that are
offline at QEMU initialisation.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen-all.c

index 7894ac62466183f148e3d21b394c388c53a7a2c9..0b4d9342426b3d95a7a0b17e807fde6c2bc031e8 100644 (file)
--- a/xen-all.c
+++ b/xen-all.c
@@ -614,13 +614,13 @@ static ioreq_t *cpu_get_ioreq(XenIOState *state)
     }
 
     if (port != -1) {
-        for (i = 0; i < smp_cpus; i++) {
+        for (i = 0; i < max_cpus; i++) {
             if (state->ioreq_local_port[i] == port) {
                 break;
             }
         }
 
-        if (i == smp_cpus) {
+        if (i == max_cpus) {
             hw_error("Fatal error while trying to get io event!\n");
         }
 
@@ -1115,10 +1115,10 @@ int xen_hvm_init(MemoryRegion **ram_memory)
         hw_error("map buffered IO page returned error %d", errno);
     }
 
-    state->ioreq_local_port = g_malloc0(smp_cpus * sizeof (evtchn_port_t));
+    state->ioreq_local_port = g_malloc0(max_cpus * sizeof (evtchn_port_t));
 
     /* FIXME: how about if we overflow the page here? */
-    for (i = 0; i < smp_cpus; i++) {
+    for (i = 0; i < max_cpus; i++) {
         rc = xc_evtchn_bind_interdomain(state->xce_handle, xen_domid,
                                         xen_vcpu_eport(state->shared_page, i));
         if (rc == -1) {