[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH qom-cpu-next] cpus: Replace open-coded CPU loop in q
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH qom-cpu-next] cpus: Replace open-coded CPU loop in qmp_memsave() with qemu_get_cpu() |
Date: |
Fri, 15 Feb 2013 15:47:41 +0100 |
No functional change, just less usages of first_cpu and next_cpu fields.
Signed-off-by: Andreas Färber <address@hidden>
---
cpus.c | 11 +++--------
1 Datei geändert, 3 Zeilen hinzugefügt(+), 8 Zeilen entfernt(-)
diff --git a/cpus.c b/cpus.c
index 41779eb..845e915 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1262,18 +1262,13 @@ void qmp_memsave(int64_t addr, int64_t size, const char
*filename,
cpu_index = 0;
}
- for (env = first_cpu; env; env = env->next_cpu) {
- cpu = ENV_GET_CPU(env);
- if (cpu_index == cpu->cpu_index) {
- break;
- }
- }
-
- if (env == NULL) {
+ cpu = qemu_get_cpu(cpu_index);
+ if (cpu == NULL) {
error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cpu-index",
"a CPU number");
return;
}
+ env = cpu->env_ptr;
f = fopen(filename, "wb");
if (!f) {
--
1.7.10.4
- [Qemu-devel] [PATCH qom-cpu-next] cpus: Replace open-coded CPU loop in qmp_memsave() with qemu_get_cpu(),
Andreas Färber <=