aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2013-05-07 06:32:00 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2013-05-07 06:32:00 -0500
commitfd8192a5a868ddbb711abbf4a871b09bbb1dae04 (patch)
tree1eb25e0ddac1163ec5ee39082cd57a7dd9bc70e9 /hw
parentb5803aa3583e82e5133f7621121bc15ee694f4a1 (diff)
parent4458c23672904fa131e69897007eeb7c953be7e5 (diff)
Merge remote-tracking branch 'afaerber/qom-cpu' into staging
# By Eduardo Habkost (6) and others # Via Andreas Färber * afaerber/qom-cpu: target-i386: n270 can MOVBE target-i386: Introduce generic CPUID feature compat function target-i386: Change CPUID model of 486 to 8 target-i386: Emulate X86CPU subclasses for global properties qdev: Introduce qdev_prop_set_globals_for_type() qdev: Let qdev_prop_parse() pass through Error target-i386: Add "filtered-features" property to X86CPU target-i386: Introduce X86CPU::filtered_features field target-i386: Add "feature-words" property to X86CPU target-i386: Use FeatureWord loop on filter_features_for_kvm() target-i386: Add ECX information to FeatureWordInfo
Diffstat (limited to 'hw')
-rw-r--r--hw/core/qdev-properties.c51
-rw-r--r--hw/core/qdev.c7
-rw-r--r--hw/i386/pc_piix.c1
-rw-r--r--hw/i386/pc_q35.c1
4 files changed, 39 insertions, 21 deletions
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index ca1739ec84..3a324fb0c3 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -986,25 +986,18 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev,
}
}
-int qdev_prop_parse(DeviceState *dev, const char *name, const char *value)
+void qdev_prop_parse(DeviceState *dev, const char *name, const char *value,
+ Error **errp)
{
char *legacy_name;
- Error *err = NULL;
legacy_name = g_strdup_printf("legacy-%s", name);
if (object_property_get_type(OBJECT(dev), legacy_name, NULL)) {
- object_property_parse(OBJECT(dev), value, legacy_name, &err);
+ object_property_parse(OBJECT(dev), value, legacy_name, errp);
} else {
- object_property_parse(OBJECT(dev), value, name, &err);
+ object_property_parse(OBJECT(dev), value, name, errp);
}
g_free(legacy_name);
-
- if (err) {
- qerror_report_err(err);
- error_free(err);
- return -1;
- }
- return 0;
}
void qdev_prop_set_bit(DeviceState *dev, const char *name, bool value)
@@ -1106,19 +1099,37 @@ void qdev_prop_register_global_list(GlobalProperty *props)
}
}
-void qdev_prop_set_globals(DeviceState *dev)
+void qdev_prop_set_globals_for_type(DeviceState *dev, const char *typename,
+ Error **errp)
+{
+ GlobalProperty *prop;
+
+ QTAILQ_FOREACH(prop, &global_props, next) {
+ Error *err = NULL;
+
+ if (strcmp(typename, prop->driver) != 0) {
+ continue;
+ }
+ qdev_prop_parse(dev, prop->property, prop->value, &err);
+ if (err != NULL) {
+ error_propagate(errp, err);
+ return;
+ }
+ }
+}
+
+void qdev_prop_set_globals(DeviceState *dev, Error **errp)
{
ObjectClass *class = object_get_class(OBJECT(dev));
do {
- GlobalProperty *prop;
- QTAILQ_FOREACH(prop, &global_props, next) {
- if (strcmp(object_class_get_name(class), prop->driver) != 0) {
- continue;
- }
- if (qdev_prop_parse(dev, prop->property, prop->value) != 0) {
- exit(1);
- }
+ Error *err = NULL;
+
+ qdev_prop_set_globals_for_type(dev, object_class_get_name(class),
+ &err);
+ if (err != NULL) {
+ error_propagate(errp, err);
+ return;
}
class = object_class_get_parent(class);
} while (class);
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 069ac9034c..6985ad870c 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -752,7 +752,12 @@ static void device_initfn(Object *obj)
}
class = object_class_get_parent(class);
} while (class != object_class_by_name(TYPE_DEVICE));
- qdev_prop_set_globals(dev);
+ qdev_prop_set_globals(dev, &err);
+ if (err != NULL) {
+ qerror_report_err(err);
+ error_free(err);
+ exit(1);
+ }
object_property_add_link(OBJECT(dev), "parent_bus", TYPE_BUS,
(Object **)&dev->parent_bus, &err);
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index fe52e5f94b..f7c80ad0a5 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -250,6 +250,7 @@ static void pc_init_pci_1_4(QEMUMachineInitArgs *args)
{
pc_sysfw_flash_vs_rom_bug_compatible = true;
has_pvpanic = false;
+ x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
pc_init_pci(args);
}
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 52511e2b69..4160e2ba37 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -212,6 +212,7 @@ static void pc_q35_init_1_4(QEMUMachineInitArgs *args)
{
pc_sysfw_flash_vs_rom_bug_compatible = true;
has_pvpanic = false;
+ x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
pc_q35_init(args);
}