diff mbox

[v3,5/7] qdev: set the object property's description to the qdev property's.

Message ID 1411794841-9672-6-git-send-email-arei.gonglei@huawei.com
State New
Headers show

Commit Message

Gonglei (Arei) Sept. 27, 2014, 5:13 a.m. UTC
From: Gonglei <arei.gonglei@huawei.com>

Set all static qdev properties' descriptions to object property's
description.

When we call object_property_add_alias() adding alias properties to
the source object on the target Object, set the object property's
description to the source qdev property's.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 hw/core/qdev.c | 5 +++++
 qom/object.c   | 4 ++++
 2 files changed, 9 insertions(+)
diff mbox

Patch

diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index fcb1638..a270a91 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -766,6 +766,11 @@  void qdev_property_add_static(DeviceState *dev, Property *prop,
         error_propagate(errp, local_err);
         return;
     }
+
+    object_property_set_description(obj, prop->name,
+                                    prop->info->description,
+                                    &error_abort);
+
     if (prop->qtype == QTYPE_NONE) {
         return;
     }
diff --git a/qom/object.c b/qom/object.c
index c9b67cf..56ace2f 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1674,6 +1674,10 @@  void object_property_add_alias(Object *obj, const char *name,
     }
     op->resolve = property_resolve_alias;
 
+    object_property_set_description(obj, name,
+                                    target_prop->description,
+                                    &error_abort);
+
 out:
     g_free(prop_type);
 }