Signed-off-by: Xu Wang <gesaint(a)linux.vnet.ibm.com>
---
libxkutil/device_parsing.c | 38 ++++++++++++++++++++++++++++----------
1 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/libxkutil/device_parsing.c b/libxkutil/device_parsing.c
index ced167f..21d2ef3 100644
--- a/libxkutil/device_parsing.c
+++ b/libxkutil/device_parsing.c
@@ -2601,17 +2601,35 @@ static int parse_os(struct domain *dominfo)
return 1;
}
-static int parse_features(struct domain *dominfo, xmlNode *features)
+static int parse_features(struct domain *dominfo)
{
- xmlNode *child;
+ CU_DEBUG("Enter parse_features()");
- for (child = features->children; child != NULL; child = child->next) {
- if (XSTREQ(child->name, "acpi"))
- dominfo->acpi = true;
- else if (XSTREQ(child->name, "apic"))
- dominfo->apic = true;
- else if (XSTREQ(child->name, "pae"))
- dominfo->pae = true;
+ if (seek_in_others(&dominfo->others,
+ -1,
+ "acpi",
+ TYPE_NODE,
+ -1,
+ "features")) {
+ dominfo->acpi = true;
+ }
+
+ if (seek_in_others(&dominfo->others,
+ -1,
+ "apic",
+ TYPE_NODE,
+ -1,
+ "features")) {
+ dominfo->apic = true;
+ }
+
+ if (seek_in_others(&dominfo->others,
+ -1,
+ "pae",
+ TYPE_NODE,
+ -1,
+ "features")) {
+ dominfo->pae = true;
}
return 1;
@@ -2770,7 +2788,7 @@ static int parse_domain(xmlNodeSet *nsv, struct domain *dominfo)
TYPE_NODE,
-1,
(char *)nodes[0]->name)) {
- /* parse_features(); */
+ parse_features(dominfo);
}
return 1;
--
1.7.1