Subject: [PATCH 12/13] qdev: print bus properties too

From: Gerd Hoffmann <[email-masked]>
Date: Tue, 20 Sep 2011 07:55:05 +0200

RH-Author: Gerd Hoffmann <[email-masked]>
Message-id: <[email-masked]>
Patchwork-id: 32978
O-Subject: [RHEL-6.2 kvm PATCH] qdev: print bus properties too
Bugzilla: 678731
RH-Acked-by: Markus Armbruster <[email-masked]>
RH-Acked-by: Don Dutile <[email-masked]>
RH-Acked-by: Chris Wright <[email-masked]>
RH-Acked-by: Alex Williamson <[email-masked]>

Make qdev_device_help print both device and bus properties.
Helps libvirt to figure whenever bus properties such as
PCI.multifunction are present & supported or not.

Signed-off-by: Gerd Hoffmann <[email-masked]>
Signed-off-by: Anthony Liguori <[email-masked]>
(cherry picked from commit a8467c7a0e8b024a18608ff7db31ca2f2297e641)

bugzilla: 678731 - Update qemu-kvm -device pci-assign,? properties
Cc: Don Dutile <[email-masked]>
Cc: Markus Armbruster <[email-masked]>
---
 hw/qdev.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Signed-off-by: Michal Novotny <[email-masked]>
---
 hw/qdev.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/hw/qdev.c b/hw/qdev.c
index 3b55909..453c17f 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -191,6 +191,12 @@ int qdev_device_help(QemuOpts *opts)
         }
         error_printf("%s.%s=%s\n", info->name, prop->name, prop->info->name);
     }
+    for (prop = info->bus_info->props; prop && prop->name; prop++) {
+        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;
 }
 
-- 
1.7.4.4