* [Qemu-devel] [PATCH 1/7] target-mips: Remove commented-out function declaration
2012-05-13 18:27 [Qemu-devel] [PULL for-1.1-rc2] Fixes from QOM-related series Andreas Färber
@ 2012-05-13 18:27 ` Andreas Färber
2012-05-13 18:27 ` [Qemu-devel] [PATCH 2/7] qom: Documentation addition for object_class_by_name() Andreas Färber
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Andreas Färber @ 2012-05-13 18:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Aurelien Jarno, Andreas Färber, anthony
There is no function cpu_mips_get_clock(), so drop it.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Stefan Weil <sw@weilnetz.de>
---
target-mips/cpu.h | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/target-mips/cpu.h b/target-mips/cpu.h
index c0f8826..44c1152 100644
--- a/target-mips/cpu.h
+++ b/target-mips/cpu.h
@@ -627,7 +627,6 @@ enum {
int cpu_mips_exec(CPUMIPSState *s);
CPUMIPSState *cpu_mips_init(const char *cpu_model);
-//~ uint32_t cpu_mips_get_clock (void);
int cpu_mips_signal_handler(int host_signum, void *pinfo, void *puc);
/* mips_timer.c */
--
1.7.7
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PATCH 2/7] qom: Documentation addition for object_class_by_name()
2012-05-13 18:27 [Qemu-devel] [PULL for-1.1-rc2] Fixes from QOM-related series Andreas Färber
2012-05-13 18:27 ` [Qemu-devel] [PATCH 1/7] target-mips: Remove commented-out function declaration Andreas Färber
@ 2012-05-13 18:27 ` Andreas Färber
2012-05-13 18:27 ` [Qemu-devel] [PATCH 3/7] target-i386: Defer MCE init Andreas Färber
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Andreas Färber @ 2012-05-13 18:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Andreas Färber, anthony
From: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[AF: Document the possible NULL return value]
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
include/qemu/object.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/include/qemu/object.h b/include/qemu/object.h
index ca1649c..d93b772 100644
--- a/include/qemu/object.h
+++ b/include/qemu/object.h
@@ -555,6 +555,12 @@ ObjectClass *object_class_dynamic_cast(ObjectClass *klass,
*/
const char *object_class_get_name(ObjectClass *klass);
+/**
+ * object_class_by_name:
+ * @typename: The QOM typename to obtain the class for.
+ *
+ * Returns: The class for @typename or %NULL if not found.
+ */
ObjectClass *object_class_by_name(const char *typename);
void object_class_foreach(void (*fn)(ObjectClass *klass, void *opaque),
--
1.7.7
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PATCH 3/7] target-i386: Defer MCE init
2012-05-13 18:27 [Qemu-devel] [PULL for-1.1-rc2] Fixes from QOM-related series Andreas Färber
2012-05-13 18:27 ` [Qemu-devel] [PATCH 1/7] target-mips: Remove commented-out function declaration Andreas Färber
2012-05-13 18:27 ` [Qemu-devel] [PATCH 2/7] qom: Documentation addition for object_class_by_name() Andreas Färber
@ 2012-05-13 18:27 ` Andreas Färber
2012-05-13 18:27 ` [Qemu-devel] [PATCH 4/7] qdev: Use object_property_print() in info qtree Andreas Färber
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Andreas Färber @ 2012-05-13 18:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber, anthony
Commit de024815e3b523addf58f1f79846b7fe74643678 (target-i386: QOM'ify
CPU init) moved mce_init() call from helper.c:cpu_x86_init() into
X86CPU's cpu.c:x86_cpu_initfn().
mce_init() checks for a family >= 6 though, so we could end up with a
sequence such as for -cpu somecpu,family=6:
x86_cpu_initfn => X86CPU::family == 5
mce_init => no-op
cpu_x86_register => X86CPU::family = 6
=> MCE unexpectedly not init'ed
or for -cpu someothercpu,family=5:
x86_cpu_initfn => X86CPU::family == 6
mce_init => init'ed
cpu_x86_register => X86CPU::family = 5
=> MCE unexpectedly init'ed
Therefore partially revert the above commit. To avoid moving
mce_init() back into helper.c, foresightedly move it into a
new x86_cpu_realize() function and, in lack of ObjectClass::realize,
call it directly from cpu_x86_init().
While at it, move the qemu_init_vcpu() call that used to follow
mce_init() in cpu_x86_init() into the new realizefn as well.
Reported-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
---
target-i386/cpu-qom.h | 4 ++++
target-i386/cpu.c | 9 ++++++++-
target-i386/helper.c | 2 +-
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/target-i386/cpu-qom.h b/target-i386/cpu-qom.h
index 40635c4..5901140 100644
--- a/target-i386/cpu-qom.h
+++ b/target-i386/cpu-qom.h
@@ -22,6 +22,7 @@
#include "qemu/cpu.h"
#include "cpu.h"
+#include "error.h"
#ifdef TARGET_X86_64
#define TYPE_X86_CPU "x86_64-cpu"
@@ -71,5 +72,8 @@ static inline X86CPU *x86_env_get_cpu(CPUX86State *env)
#define ENV_GET_CPU(e) CPU(x86_env_get_cpu(e))
+/* TODO Drop once ObjectClass::realize is available */
+void x86_cpu_realize(Object *obj, Error **errp);
+
#endif
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 65d9af6..89b4ac7 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1722,6 +1722,14 @@ static void mce_init(X86CPU *cpu)
}
}
+void x86_cpu_realize(Object *obj, Error **errp)
+{
+ X86CPU *cpu = X86_CPU(obj);
+
+ mce_init(cpu);
+ qemu_init_vcpu(&cpu->env);
+}
+
static void x86_cpu_initfn(Object *obj)
{
X86CPU *cpu = X86_CPU(obj);
@@ -1755,7 +1763,6 @@ static void x86_cpu_initfn(Object *obj)
x86_cpuid_set_tsc_freq, NULL, NULL, NULL);
env->cpuid_apic_id = env->cpu_index;
- mce_init(cpu);
}
static void x86_cpu_common_class_init(ObjectClass *oc, void *data)
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 0b22582..3421be2 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1181,7 +1181,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
return NULL;
}
- qemu_init_vcpu(env);
+ x86_cpu_realize(OBJECT(cpu), NULL);
return env;
}
--
1.7.7
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PATCH 4/7] qdev: Use object_property_print() in info qtree
2012-05-13 18:27 [Qemu-devel] [PULL for-1.1-rc2] Fixes from QOM-related series Andreas Färber
` (2 preceding siblings ...)
2012-05-13 18:27 ` [Qemu-devel] [PATCH 3/7] target-i386: Defer MCE init Andreas Färber
@ 2012-05-13 18:27 ` Andreas Färber
2012-05-13 18:27 ` [Qemu-devel] [PATCH 5/7] qdev: Fix adding of ptr properties Andreas Färber
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Andreas Färber @ 2012-05-13 18:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Andreas Färber, anthony
From: Paolo Bonzini <pbonzini@redhat.com>
Otherwise, non-string properties without a legacy counterpart are missed.
Also fix error propagation in object_property_print() itself.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/qdev-monitor.c | 2 +-
qom/object.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c
index dc4e4e1..a06748c 100644
--- a/hw/qdev-monitor.c
+++ b/hw/qdev-monitor.c
@@ -493,7 +493,7 @@ static void qdev_print_props(Monitor *mon, DeviceState *dev, Property *props,
if (object_property_get_type(OBJECT(dev), legacy_name, NULL)) {
value = object_property_get_str(OBJECT(dev), legacy_name, &err);
} else {
- value = object_property_get_str(OBJECT(dev), props->name, &err);
+ value = object_property_print(OBJECT(dev), props->name, &err);
}
g_free(legacy_name);
diff --git a/qom/object.c b/qom/object.c
index e721fc2..6f839ad 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -830,7 +830,7 @@ char *object_property_print(Object *obj, const char *name,
char *string;
mo = string_output_visitor_new();
- object_property_get(obj, string_output_get_visitor(mo), name, NULL);
+ object_property_get(obj, string_output_get_visitor(mo), name, errp);
string = string_output_get_string(mo);
string_output_visitor_cleanup(mo);
return string;
--
1.7.7
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PATCH 5/7] qdev: Fix adding of ptr properties
2012-05-13 18:27 [Qemu-devel] [PULL for-1.1-rc2] Fixes from QOM-related series Andreas Färber
` (3 preceding siblings ...)
2012-05-13 18:27 ` [Qemu-devel] [PATCH 4/7] qdev: Use object_property_print() in info qtree Andreas Färber
@ 2012-05-13 18:27 ` Andreas Färber
2012-05-13 18:27 ` [Qemu-devel] [PATCH 6/7] pc: Add back PCI.rombar compat property Andreas Färber
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Andreas Färber @ 2012-05-13 18:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Anthony Liguori, Andreas Färber, anthony
From: Anthony Liguori <aliguori@us.ibm.com>
ptr properties have neither a get/set or a print/parse which means that when
they're added they aren't treated as static or legacy properties.
Just assume properties like this are legacy properties and treat them as such.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/qdev.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/hw/qdev.c b/hw/qdev.c
index 0bcde20..6a8f6bd 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -576,9 +576,12 @@ void qdev_property_add_legacy(DeviceState *dev, Property *prop,
{
gchar *name, *type;
- if (!prop->info->print && !prop->info->parse) {
+ /* Register pointer properties as legacy properties */
+ if (!prop->info->print && !prop->info->parse &&
+ (prop->info->set || prop->info->get)) {
return;
}
+
name = g_strdup_printf("legacy-%s", prop->name);
type = g_strdup_printf("legacy<%s>",
prop->info->legacy_name ?: prop->info->name);
--
1.7.7
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PATCH 6/7] pc: Add back PCI.rombar compat property
2012-05-13 18:27 [Qemu-devel] [PULL for-1.1-rc2] Fixes from QOM-related series Andreas Färber
` (4 preceding siblings ...)
2012-05-13 18:27 ` [Qemu-devel] [PATCH 5/7] qdev: Fix adding of ptr properties Andreas Färber
@ 2012-05-13 18:27 ` Andreas Färber
2012-05-13 18:27 ` [Qemu-devel] [PATCH 7/7] mips_fulong2e: Don't register "cpu" VMState twice Andreas Färber
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Andreas Färber @ 2012-05-13 18:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Anthony Liguori, Andreas Färber, anthony
From: Paolo Bonzini <pbonzini@redhat.com>
This was erroneously dropped in d6c730086cbf24382eb8cff25551798769edfd84
(pc: reduce duplication in compat machine types).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/pc_piix.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 6a75718..a7aad4b 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -522,6 +522,10 @@ static QEMUMachine pc_machine_v0_12 = {
.driver = "virtio-blk-pci",\
.property = "vectors",\
.value = stringify(0),\
+ },{\
+ .driver = "PCI",\
+ .property = "rombar",\
+ .value = stringify(0),\
}
static QEMUMachine pc_machine_v0_11 = {
--
1.7.7
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PATCH 7/7] mips_fulong2e: Don't register "cpu" VMState twice
2012-05-13 18:27 [Qemu-devel] [PULL for-1.1-rc2] Fixes from QOM-related series Andreas Färber
` (5 preceding siblings ...)
2012-05-13 18:27 ` [Qemu-devel] [PATCH 6/7] pc: Add back PCI.rombar compat property Andreas Färber
@ 2012-05-13 18:27 ` Andreas Färber
2012-05-14 12:56 ` [Qemu-devel] [PULL for-1.1-rc2] Fixes from QOM-related series Luiz Capitulino
2012-05-14 20:08 ` Anthony Liguori
8 siblings, 0 replies; 10+ messages in thread
From: Andreas Färber @ 2012-05-13 18:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber, anthony, Juan Quintela
From: Juan Quintela <quintela@redhat.com>
We have the following simplified callgraph in mips_fulong2e_init():
cpu_init() => cpu_mips_init()
object_new()
mips_cpu_initfn()
cpu_exec_init()
register_savevm(NULL, "cpu", cpu_index, CPU_SAVE_VERSION,
cpu_save, cpu_load, env)
register_savevm(NULL, "cpu", 0, 3, cpu_save, cpu_load, env)
CPU_SAVE_VERSION is defined as 3 in target-mips/cpu.h.
fulong2e instantiates one CPU, so its cpu_index is 0.
Thus the two are fully identical.
Therefore just remove the second call in fulong2e.
Signed-off-by: Juan Quintela <quintela@redhat.com>
[AF: Extend explanation in commit message]
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/mips_fulong2e.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/hw/mips_fulong2e.c b/hw/mips_fulong2e.c
index 37dc711..1a8df10 100644
--- a/hw/mips_fulong2e.c
+++ b/hw/mips_fulong2e.c
@@ -284,7 +284,6 @@ static void mips_fulong2e_init(ram_addr_t ram_size, const char *boot_device,
exit(1);
}
- register_savevm(NULL, "cpu", 0, 3, cpu_save, cpu_load, env);
qemu_register_reset(main_cpu_reset, env);
/* fulong 2e has 256M ram. */
--
1.7.7
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL for-1.1-rc2] Fixes from QOM-related series
2012-05-13 18:27 [Qemu-devel] [PULL for-1.1-rc2] Fixes from QOM-related series Andreas Färber
` (6 preceding siblings ...)
2012-05-13 18:27 ` [Qemu-devel] [PATCH 7/7] mips_fulong2e: Don't register "cpu" VMState twice Andreas Färber
@ 2012-05-14 12:56 ` Luiz Capitulino
2012-05-14 20:08 ` Anthony Liguori
8 siblings, 0 replies; 10+ messages in thread
From: Luiz Capitulino @ 2012-05-14 12:56 UTC (permalink / raw)
To: Andreas Färber; +Cc: qemu-devel, anthony
On Sun, 13 May 2012 20:27:38 +0200
Andreas Färber <afaerber@suse.de> wrote:
> Hello Anthony,
>
> Please pull the following patches cherry-picked from various QOM-related series.
> I've dropped Paolo's "Fix -device foo,?" since you already had that queued.
> QMP patches will be handled by Luiz.
>
> Cc: Anthony Liguori <anthony@codemonkey.ws>
>
> If there's other QOM bugfixes or cleanups for 1.1 that I've missed here,
> please ping / resend / submit a PULL request on your own. Thanks.
>
> Luiz, as announced, this includes a new usage of object_property_print(), so
> please evaluate whether you want to include the float printing fix for this
> or a later RC.
I'll send a pull request shortly, but the two fixes are independent, so no
problem to merge them separately.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL for-1.1-rc2] Fixes from QOM-related series
2012-05-13 18:27 [Qemu-devel] [PULL for-1.1-rc2] Fixes from QOM-related series Andreas Färber
` (7 preceding siblings ...)
2012-05-14 12:56 ` [Qemu-devel] [PULL for-1.1-rc2] Fixes from QOM-related series Luiz Capitulino
@ 2012-05-14 20:08 ` Anthony Liguori
8 siblings, 0 replies; 10+ messages in thread
From: Anthony Liguori @ 2012-05-14 20:08 UTC (permalink / raw)
To: Andreas Färber; +Cc: qemu-devel, Luiz Capitulino
On 05/13/2012 01:27 PM, Andreas Färber wrote:
> Hello Anthony,
>
> Please pull the following patches cherry-picked from various QOM-related series.
> I've dropped Paolo's "Fix -device foo,?" since you already had that queued.
> QMP patches will be handled by Luiz.
>
> Cc: Anthony Liguori<anthony@codemonkey.ws>
>
> If there's other QOM bugfixes or cleanups for 1.1 that I've missed here,
> please ping / resend / submit a PULL request on your own. Thanks.
>
> Luiz, as announced, this includes a new usage of object_property_print(), so
> please evaluate whether you want to include the float printing fix for this
> or a later RC.
>
> Cc: Luiz Capitulino<lcapitulino@redhat.com>
>
> The following changes since commit 94d1991445fa3582c042ee4e5b72606e2fc39cc2:
>
> sun4u: implement interrupt clearing registers (2012-05-12 09:49:19 +0000)
>
> are available in the git repository at:
> git://repo.or.cz/qemu/afaerber.git qom-1.1
Pulled. Thanks.
Regards,
Anthony Liguori
>
> Andreas Färber (2):
> target-mips: Remove commented-out function declaration
> target-i386: Defer MCE init
>
> Anthony Liguori (1):
> qdev: Fix adding of ptr properties
>
> Juan Quintela (1):
> mips_fulong2e: Don't register "cpu" VMState twice
>
> Paolo Bonzini (3):
> qom: Documentation addition for object_class_by_name()
> qdev: Use object_property_print() in info qtree
> pc: Add back PCI.rombar compat property
>
> hw/mips_fulong2e.c | 1 -
> hw/pc_piix.c | 4 ++++
> hw/qdev-monitor.c | 2 +-
> hw/qdev.c | 5 ++++-
> include/qemu/object.h | 6 ++++++
> qom/object.c | 2 +-
> target-i386/cpu-qom.h | 4 ++++
> target-i386/cpu.c | 9 ++++++++-
> target-i386/helper.c | 2 +-
> target-mips/cpu.h | 1 -
> 10 files changed, 29 insertions(+), 7 deletions(-)
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread