]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
i386: use machine class ->wakeup method
authorNicholas Piggin <npiggin@gmail.com>
Mon, 22 Jul 2019 06:17:51 +0000 (16:17 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 21 Aug 2019 07:17:39 +0000 (17:17 +1000)
Move the i386 suspend_wakeup logic out of the fallback path, and into
the new ->wakeup method.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-Id: <20190722061752.22114-1-npiggin@gmail.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/i386/pc.c
vl.c

index 95edbbfe9e21325681dde9ba8ccd58810dda5a3a..98581fe0c28e111f4e83c51694b5e0686367e005 100644 (file)
@@ -2834,6 +2834,13 @@ static void pc_machine_reset(MachineState *machine)
     }
 }
 
+static void pc_machine_wakeup(MachineState *machine)
+{
+    cpu_synchronize_all_states();
+    pc_machine_reset(machine);
+    cpu_synchronize_all_post_reset();
+}
+
 static CpuInstanceProperties
 pc_cpu_index_to_props(MachineState *ms, unsigned cpu_index)
 {
@@ -2946,6 +2953,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
     mc->block_default_type = IF_IDE;
     mc->max_cpus = 255;
     mc->reset = pc_machine_reset;
+    mc->wakeup = pc_machine_wakeup;
     hc->pre_plug = pc_machine_device_pre_plug_cb;
     hc->plug = pc_machine_device_plug_cb;
     hc->unplug_request = pc_machine_device_unplug_request_cb;
diff --git a/vl.c b/vl.c
index 09aa18cb350488267d36cd1c4d70ce5b566cf13e..8e5af7501fb163f1c88f8eada82daba11dc90c82 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -1568,8 +1568,6 @@ static void qemu_system_wakeup(void)
 
     if (mc && mc->wakeup) {
         mc->wakeup(current_machine);
-    } else {
-        qemu_system_reset(SHUTDOWN_CAUSE_NONE);
     }
 }