Signed-off-by: Xu Wang <gesaint(a)linux.vnet.ibm.com>
---
libxkutil/xmlgen.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/libxkutil/xmlgen.c b/libxkutil/xmlgen.c
index 10a04a6..c2ff98b 100644
--- a/libxkutil/xmlgen.c
+++ b/libxkutil/xmlgen.c
@@ -2338,6 +2338,24 @@ static char *tree_to_xml(xmlNodePtr root)
return xml;
}
+static const char *unknown_xml(xmlNodePtr root, struct domain *dominfo)
+{
+ int i;
+
+ CU_DEBUG("Enter unknown_xml()");
+
+ for (i = 0; i < dominfo->dev_unknown_ct; i++) {
+ struct virt_device *_dev = &dominfo->dev_unknown[i];
+ struct unknown_device *dev = &_dev->dev.unknown;
+ dev->others = others_to_xml(root, dev->others, 0,
"devices");
+ if (check_others_active(dev->others)) {
+ return "xml generation failed.";
+ }
+ }
+
+ return NULL;
+}
+
char *device_to_xml(struct virt_device *_dev)
{
char *xml = NULL;
@@ -2402,6 +2420,11 @@ char *device_to_xml(struct virt_device *_dev)
dominfo->dev_input_ct = 1;
dominfo->dev_input = dev;
break;
+ case CIM_RES_TYPE_UNKNOWN:
+ func = unknown_xml;
+ dominfo->dev_unknown_ct = 1;
+ dominfo->dev_unknown = dev;
+ break;
default:
cleanup_virt_devices(&dev, 1);
goto out;
--
1.7.1