On 24/03/2016 11:14, Cao jin wrote:
> include:
> 1. remove unnecessary declaration of static function
> 2. fix inconsistency between comment and function name, and typo OOM->QOM
> 2. update comment of function
>
> Signed-off-by: Cao jin <[email protected]>
> ---
> A question about legacy property: I don`t see legacy property is really
> used in the code, so, why still add legacy property to object?
It's used here:
static void qdev_print_props(Monitor *mon, DeviceState *dev, Property *props,
int indent)
{
if (!props)
return;
for (; props->name; props++) {
Error *err = NULL;
char *value;
char *legacy_name = g_strdup_printf("legacy-%s", props->name);
if (object_property_get_type(OBJECT(dev), legacy_name, NULL)) {
value = object_property_get_str(OBJECT(dev), legacy_name, &err);
} else {
value = object_property_print(OBJECT(dev), props->name, true, &err);
}
g_free(legacy_name);
if (err) {
error_free(err);
continue;
}
qdev_printf("%s = %s\n", props->name,
value && *value ? value : "<null>");
g_free(value);
}
}
Paolo