[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v1 07/11] target/s390x: rename next_cpu_id to next_c
From: |
David Hildenbrand |
Subject: |
[Qemu-devel] [PATCH v1 07/11] target/s390x: rename next_cpu_id to next_cpu_addr |
Date: |
Wed, 30 Aug 2017 19:05:57 +0200 |
Adapt the term address/adddr. While at it, fix the type and drop the
initialization to 0 (which is superfluous).
Signed-off-by: David Hildenbrand <address@hidden>
---
target/s390x/cpu-qom.h | 2 +-
target/s390x/cpu.c | 9 ++++-----
target/s390x/helper.c | 4 ++--
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/target/s390x/cpu-qom.h b/target/s390x/cpu-qom.h
index 4e936e7788..a3a3ada226 100644
--- a/target/s390x/cpu-qom.h
+++ b/target/s390x/cpu-qom.h
@@ -52,7 +52,7 @@ typedef struct S390CPUClass {
bool is_migration_safe;
const char *desc;
- int64_t next_cpu_id;
+ uint32_t next_cpu_addr;
DeviceRealize parent_realize;
void (*parent_reset)(CPUState *cpu);
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index 156589e921..ffc1ff9a2b 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -201,10 +201,10 @@ static void s390_cpu_realizefn(DeviceState *dev, Error
**errp)
cpu->env.cpu_addr);
goto out;
}
- if (cpu->env.cpu_addr != scc->next_cpu_id) {
+ if (cpu->env.cpu_addr != scc->next_cpu_addr) {
error_setg(&err, "Unable to add CPU: %" PRIu32
- ", the next available nr is %" PRIi64, cpu->env.cpu_addr,
- scc->next_cpu_id);
+ ", the next available addr is %" PRIu32, cpu->env.cpu_addr,
+ scc->next_cpu_addr);
goto out;
}
@@ -214,7 +214,7 @@ static void s390_cpu_realizefn(DeviceState *dev, Error
**errp)
if (err != NULL) {
goto out;
}
- scc->next_cpu_id++;
+ scc->next_cpu_addr++;
#if !defined(CONFIG_USER_ONLY)
qemu_register_reset(s390_cpu_machine_reset_cb, cpu);
@@ -459,7 +459,6 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
CPUClass *cc = CPU_CLASS(scc);
DeviceClass *dc = DEVICE_CLASS(oc);
- scc->next_cpu_id = 0;
scc->parent_realize = dc->realize;
dc->realize = s390_cpu_realizefn;
dc->props = s390x_cpu_properties;
diff --git a/target/s390x/helper.c b/target/s390x/helper.c
index 70d1ea8cf6..d8f198cf6f 100644
--- a/target/s390x/helper.c
+++ b/target/s390x/helper.c
@@ -134,9 +134,9 @@ S390CPU *cpu_s390x_init(const char *cpu_model)
Error *err = NULL;
S390CPU *cpu;
/* Use to track CPU ID for linux-user only */
- static int64_t next_cpu_id;
+ static uint32_t next_cpu_addr;
- cpu = s390x_new_cpu(cpu_model, next_cpu_id++, &err);
+ cpu = s390x_new_cpu(cpu_model, next_cpu_addr++, &err);
if (err) {
error_report_err(err);
}
--
2.13.5
- [Qemu-devel] [PATCH v1 06/11] target/s390x: cleanup cpu number/address handling, (continued)
[Qemu-devel] [PATCH v1 05/11] s390x: rename s390-virtio.h to s390-virtio-hcall.h, David Hildenbrand, 2017/08/30
[Qemu-devel] [PATCH v1 07/11] target/s390x: rename next_cpu_id to next_cpu_addr,
David Hildenbrand <=
[Qemu-devel] [PATCH v1 08/11] s390x: allow only 1 CPU with TCG, David Hildenbrand, 2017/08/30
[Qemu-devel] [PATCH v1 09/11] target/s390x: tcg_s390_program_interrupt() will never return, David Hildenbrand, 2017/08/30