aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2016-07-25 14:47:12 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2016-09-13 19:08:41 +0200
commit3b8c1761f0e1523622e008836d01a6544b1c21ab (patch)
treeea4fd8ce936246f7c0f41e1c899dba85149d4151 /exec.c
parentfa9701240951093907076db0943f96972a396ef5 (diff)
qtail: clean up direct access to tqe_prev field
instead of accessing tqe_prev field dircetly outside of queue.h use macros to check if element is in list and make sure that afer element is removed from list tqe_prev field could be used to do the same check. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <1469450832-84343-1-git-send-email-imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/exec.c b/exec.c
index 80398b038f..ce3fb9ec8e 100644
--- a/exec.c
+++ b/exec.c
@@ -617,7 +617,7 @@ void cpu_exec_exit(CPUState *cpu)
CPUClass *cc = CPU_GET_CLASS(cpu);
cpu_list_lock();
- if (cpu->node.tqe_prev == NULL) {
+ if (!QTAILQ_IN_USE(cpu, node)) {
/* there is nothing to undo since cpu_exec_init() hasn't been called */
cpu_list_unlock();
return;
@@ -626,7 +626,6 @@ void cpu_exec_exit(CPUState *cpu)
assert(!(cpu_index_auto_assigned && cpu != QTAILQ_LAST(&cpus, CPUTailQ)));
QTAILQ_REMOVE(&cpus, cpu, node);
- cpu->node.tqe_prev = NULL;
cpu->cpu_index = UNASSIGNED_CPU_INDEX;
cpu_list_unlock();