summary refs log tree commit diff stats
path: root/hw/qdev.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2010-02-19 11:47:06 +0100
committerMarkus Armbruster <armbru@redhat.com>2010-03-16 17:01:08 +0100
commit036f7166c73a9e0cc1b2f10c03763e61894a1033 (patch)
tree14958df948902116a68c37d20f60088a4ec312b2 /hw/qdev.c
parentc64eafaf0c2f080d81f4c51a1eb2a98ceb40d2c8 (diff)
downloadfocaccia-qemu-036f7166c73a9e0cc1b2f10c03763e61894a1033.tar.gz
focaccia-qemu-036f7166c73a9e0cc1b2f10c03763e61894a1033.zip
qdev: Hide "ptr" properties from users
Users can't set them, so qdev_device_help() shouldn't list them.  Fix
that.  Also make qdev_prop_parse() hide them instead of printing a
meaningless "has no parser" error message.

Their value means nothing to users, so qdev_print_props() shouldn't
print it.  Fix by removing their print method.

Their only use is dirty hacks.  Document that.
Diffstat (limited to 'hw/qdev.c')
-rw-r--r--hw/qdev.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/hw/qdev.c b/hw/qdev.c
index 233480e12d..4608169449 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -180,6 +180,15 @@ int qdev_device_help(QemuOpts *opts)
     }
 
     for (prop = info->props; prop && prop->name; prop++) {
+        /*
+         * TODO Properties without a parser are just for dirty hacks.
+         * qdev_prop_ptr is the only such PropertyInfo.  It's marked
+         * for removal.  This conditional should be removed along with
+         * it.
+         */
+        if (!prop->info->parse) {
+            continue;           /* no way to set it, don't show */
+        }
         error_printf("%s.%s=%s\n", info->name, prop->name, prop->info->name);
     }
     return 1;
@@ -682,6 +691,12 @@ static void qdev_print_props(Monitor *mon, DeviceState *dev, Property *props,
     if (!props)
         return;
     while (props->name) {
+        /*
+         * TODO Properties without a print method are just for dirty
+         * hacks.  qdev_prop_ptr is the only such PropertyInfo.  It's
+         * marked for removal.  The test props->info->print should be
+         * removed along with it.
+         */
         if (props->info->print) {
             props->info->print(dev, props, buf, sizeof(buf));
             qdev_printf("%s-prop: %s = %s\n", prefix, props->name, buf);