diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2013-08-07 12:43:34 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-08-07 12:43:34 -0500 |
commit | 6c0f48f5b6c4cf3e1ec8ec6fa7bfe1b97dc92a9c (patch) | |
tree | 91773fbd2b967fdd62f13066ab33efb650f4d910 | |
parent | cafffa545420a2c6dc33f9cb58401c606af59572 (diff) | |
parent | cd7b87ffe9b6b7b0089ec8c71555f3b942bc6daf (diff) | |
download | hqemu-6c0f48f5b6c4cf3e1ec8ec6fa7bfe1b97dc92a9c.zip hqemu-6c0f48f5b6c4cf3e1ec8ec6fa7bfe1b97dc92a9c.tar.gz |
Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging
QOM CPUState refactorings
* Clean up X86CPU error handling
# gpg: Signature made Tue 06 Aug 2013 01:57:34 PM CDT using RSA key ID 3E7E013F
# gpg: Can't check signature: public key not found
# By Andreas Färber
# Via Andreas Färber
* afaerber/tags/qom-cpu-for-anthony:
target-i386: Fix X86CPU error handling
-rw-r--r-- | hw/i386/pc.c | 13 | ||||
-rw-r--r-- | target-i386/cpu.c | 6 |
2 files changed, 11 insertions, 8 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c index a2b9d88..6a0b042 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -912,20 +912,19 @@ static X86CPU *pc_new_cpu(const char *cpu_model, int64_t apic_id, X86CPU *cpu; Error *local_err = NULL; - cpu = cpu_x86_create(cpu_model, icc_bridge, errp); - if (!cpu) { - return cpu; + cpu = cpu_x86_create(cpu_model, icc_bridge, &local_err); + if (local_err != NULL) { + error_propagate(errp, local_err); + return NULL; } object_property_set_int(OBJECT(cpu), apic_id, "apic-id", &local_err); object_property_set_bool(OBJECT(cpu), true, "realized", &local_err); if (local_err) { - if (cpu != NULL) { - object_unref(OBJECT(cpu)); - cpu = NULL; - } error_propagate(errp, local_err); + object_unref(OBJECT(cpu)); + cpu = NULL; } return cpu; } diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 71ab915..2efbeca 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1824,7 +1824,11 @@ X86CPU *cpu_x86_create(const char *cpu_model, DeviceState *icc_bridge, } out: - error_propagate(errp, error); + if (error != NULL) { + error_propagate(errp, error); + object_unref(OBJECT(cpu)); + cpu = NULL; + } g_strfreev(model_pieces); return cpu; } |