[RFC 1/5] cpu: Initialize cpu->stopped=true earlier

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

 



In case something happens and prevents qemu_init_vcpu() from running
after cpu_exec_init() was already called, this will let the rest of the
VCPU handling code know that the CPU is not running yet.

Signed-off-by: Eduardo Habkost <ehabkost@xxxxxxxxxx>
---
 cpus.c | 1 -
 exec.c | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpus.c b/cpus.c
index 7bbe153..69b0530 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1184,7 +1184,6 @@ void qemu_init_vcpu(CPUState *cpu)
 {
     cpu->nr_cores = smp_cores;
     cpu->nr_threads = smp_threads;
-    cpu->stopped = true;
     if (kvm_enabled()) {
         qemu_kvm_start_vcpu(cpu);
     } else if (tcg_enabled()) {
diff --git a/exec.c b/exec.c
index 91513c6..e91decc 100644
--- a/exec.c
+++ b/exec.c
@@ -485,6 +485,7 @@ void cpu_exec_init(CPUArchState *env)
     }
     cpu->cpu_index = cpu_index;
     cpu->numa_node = 0;
+    cpu->stopped = true;
     QTAILQ_INIT(&cpu->breakpoints);
     QTAILQ_INIT(&cpu->watchpoints);
 #ifndef CONFIG_USER_ONLY
-- 
1.9.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]