Merge remote-tracking branch 'afaerber-or/qom-1.1' into staging

* afaerber-or/qom-1.1:
  mips_fulong2e: Don't register "cpu" VMState twice
  pc: Add back PCI.rombar compat property
  qdev: Fix adding of ptr properties
  qdev: Use object_property_print() in info qtree
  target-i386: Defer MCE init
  qom: Documentation addition for object_class_by_name()
  target-mips: Remove commented-out function declaration
This commit is contained in:
Anthony Liguori 2012-05-14 10:15:52 -05:00
commit 8592d5259a
10 changed files with 29 additions and 7 deletions

View File

@ -284,7 +284,6 @@ static void mips_fulong2e_init(ram_addr_t ram_size, const char *boot_device,
exit(1); exit(1);
} }
register_savevm(NULL, "cpu", 0, 3, cpu_save, cpu_load, env);
qemu_register_reset(main_cpu_reset, env); qemu_register_reset(main_cpu_reset, env);
/* fulong 2e has 256M ram. */ /* fulong 2e has 256M ram. */

View File

@ -522,6 +522,10 @@ static QEMUMachine pc_machine_v0_12 = {
.driver = "virtio-blk-pci",\ .driver = "virtio-blk-pci",\
.property = "vectors",\ .property = "vectors",\
.value = stringify(0),\ .value = stringify(0),\
},{\
.driver = "PCI",\
.property = "rombar",\
.value = stringify(0),\
} }
static QEMUMachine pc_machine_v0_11 = { static QEMUMachine pc_machine_v0_11 = {

View File

@ -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)) { if (object_property_get_type(OBJECT(dev), legacy_name, NULL)) {
value = object_property_get_str(OBJECT(dev), legacy_name, &err); value = object_property_get_str(OBJECT(dev), legacy_name, &err);
} else { } else {
value = object_property_get_str(OBJECT(dev), props->name, &err); value = object_property_print(OBJECT(dev), props->name, &err);
} }
g_free(legacy_name); g_free(legacy_name);

View File

@ -576,9 +576,12 @@ void qdev_property_add_legacy(DeviceState *dev, Property *prop,
{ {
gchar *name, *type; 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; return;
} }
name = g_strdup_printf("legacy-%s", prop->name); name = g_strdup_printf("legacy-%s", prop->name);
type = g_strdup_printf("legacy<%s>", type = g_strdup_printf("legacy<%s>",
prop->info->legacy_name ?: prop->info->name); prop->info->legacy_name ?: prop->info->name);

View File

@ -555,6 +555,12 @@ ObjectClass *object_class_dynamic_cast(ObjectClass *klass,
*/ */
const char *object_class_get_name(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); ObjectClass *object_class_by_name(const char *typename);
void object_class_foreach(void (*fn)(ObjectClass *klass, void *opaque), void object_class_foreach(void (*fn)(ObjectClass *klass, void *opaque),

View File

@ -830,7 +830,7 @@ char *object_property_print(Object *obj, const char *name,
char *string; char *string;
mo = string_output_visitor_new(); 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 = string_output_get_string(mo);
string_output_visitor_cleanup(mo); string_output_visitor_cleanup(mo);
return string; return string;

View File

@ -22,6 +22,7 @@
#include "qemu/cpu.h" #include "qemu/cpu.h"
#include "cpu.h" #include "cpu.h"
#include "error.h"
#ifdef TARGET_X86_64 #ifdef TARGET_X86_64
#define TYPE_X86_CPU "x86_64-cpu" #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)) #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 #endif

View File

@ -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) static void x86_cpu_initfn(Object *obj)
{ {
X86CPU *cpu = X86_CPU(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); x86_cpuid_set_tsc_freq, NULL, NULL, NULL);
env->cpuid_apic_id = env->cpu_index; env->cpuid_apic_id = env->cpu_index;
mce_init(cpu);
} }
static void x86_cpu_common_class_init(ObjectClass *oc, void *data) static void x86_cpu_common_class_init(ObjectClass *oc, void *data)

View File

@ -1181,7 +1181,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
return NULL; return NULL;
} }
qemu_init_vcpu(env); x86_cpu_realize(OBJECT(cpu), NULL);
return env; return env;
} }

View File

@ -627,7 +627,6 @@ enum {
int cpu_mips_exec(CPUMIPSState *s); int cpu_mips_exec(CPUMIPSState *s);
CPUMIPSState *cpu_mips_init(const char *cpu_model); 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); int cpu_mips_signal_handler(int host_signum, void *pinfo, void *puc);
/* mips_timer.c */ /* mips_timer.c */