mirror of https://gitee.com/openkylin/qemu.git
qdev: use built-in QOM string parser
object_property_parse lets us drop the legacy setters when their task is done just as well by the string visitors. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
97aa6e9b8f
commit
0c96e2856e
|
@ -1080,9 +1080,9 @@ int qdev_prop_parse(DeviceState *dev, const char *name, const char *value)
|
|||
|
||||
legacy_name = g_strdup_printf("legacy-%s", name);
|
||||
if (object_property_get_type(OBJECT(dev), legacy_name, NULL)) {
|
||||
object_property_set_str(OBJECT(dev), value, legacy_name, &err);
|
||||
object_property_parse(OBJECT(dev), value, legacy_name, &err);
|
||||
} else {
|
||||
object_property_set_str(OBJECT(dev), value, name, &err);
|
||||
object_property_parse(OBJECT(dev), value, name, &err);
|
||||
}
|
||||
g_free(legacy_name);
|
||||
|
||||
|
|
Loading…
Reference in New Issue