Blob Blame History Raw
From 235e46c6adfcb0cb5feaec8073cacd0db0bc98e7 Mon Sep 17 00:00:00 2001
From: Amit Saha <asaha@redhat.com>
Date: Tue, 2 Jun 2015 14:11:32 +1000
Subject: [PATCH 08/26] expose hints in XML output (#688)

---
 src/core/hw.cc | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/core/hw.cc b/src/core/hw.cc
index 44e2bd8..963f4ba 100644
--- a/src/core/hw.cc
+++ b/src/core/hw.cc
@@ -1987,6 +1987,19 @@ string hwNode::asXML(unsigned level)
       out << "</resources>" << endl;
     }
     resources.clear();
+
+    vector < string > hints = getHints();
+    if (hints.size() > 0) {
+      out << spaces(2*level+1);
+      out << "<hints>" << endl;
+      for(unsigned int i=0; i<hints.size(); i++) {
+        out << spaces(2*level+2);
+        out << "<hint name=\"" << hints[i] << "\" " << "value=\"" << getHint(hints[i]).asString() << "\" />";
+        out << endl;
+      }
+      out << spaces(2*level+1);
+      out << "</hints>" << endl;
+    }
   }
 
   for (unsigned int i = 0; i < countChildren(); i++)
-- 
2.10.2