From: Xu Wang <cngesaint(a)gmail.com>
Signed-off-by: Xu Wang <gesaint(a)linux.vnet.ibm.com>
---
libxkutil/device_parsing.c | 10 ++++++++++
libxkutil/device_parsing.h | 3 +++
2 files changed, 13 insertions(+)
diff --git a/libxkutil/device_parsing.c b/libxkutil/device_parsing.c
index a6a6cfe..99f6eda 100644
--- a/libxkutil/device_parsing.c
+++ b/libxkutil/device_parsing.c
@@ -49,6 +49,7 @@
#define GRAPHICS_XPATH (xmlChar *)"/domain/devices/graphics | "\
"/domain/devices/console"
#define INPUT_XPATH (xmlChar *)"/domain/devices/input"
+#define UNKNOWN_XPATH (xmlChar *)"/domain/devices"
#define DEFAULT_BRIDGE "xenbr0"
#define DEFAULT_NETWORK "default"
@@ -2350,6 +2351,11 @@ static int parse_devices(const char *xml, struct virt_device
**_list, int type)
func = &parse_input_device;
break;
+ case CIM_RES_TYPE_UNKNOWN:
+ xpathstr = UNKNOWN_XPATH;
+ func = &parse_unknown_device;
+ break;
+
default:
CU_DEBUG("Unrecognized device type. Returning.");
goto err1;
@@ -2846,6 +2852,9 @@ int get_dominfo_from_xml(const char *xml, struct domain **dominfo)
(*dominfo)->dev_vcpu_ct = parse_devices(xml,
&(*dominfo)->dev_vcpu,
CIM_RES_TYPE_PROC);
+ (*dominfo)->dev_unknown_ct = parse_devices(xml,
+ &(*dominfo)->dev_unknown,
+ CIM_RES_TYPE_UNKNOWN);
return ret;
@@ -2934,6 +2943,7 @@ void cleanup_dominfo(struct domain **dominfo)
cleanup_virt_devices(&dom->dev_graphics, dom->dev_graphics_ct);
cleanup_virt_devices(&dom->dev_input, dom->dev_input_ct);
cleanup_virt_devices(&dom->dev_console, dom->dev_console_ct);
+ cleanup_virt_devices(&dom->dev_unknown, dom->dev_unknown_ct);
free(dom);
diff --git a/libxkutil/device_parsing.h b/libxkutil/device_parsing.h
index a4e60ee..fa8aa17 100644
--- a/libxkutil/device_parsing.h
+++ b/libxkutil/device_parsing.h
@@ -283,6 +283,9 @@ struct domain {
struct virt_device *dev_vcpu;
int dev_vcpu_ct;
+
+ struct virt_device *dev_unknown;
+ int dev_unknown_ct;
};
struct virt_device *virt_device_dup(struct virt_device *dev);
--
1.8.3.1