rhtyd commented on a change in pull request #1707: CLOUDSTACK-9397: Add
Watchdog timer to KVM Instance
URL: https://github.com/apache/cloudstack/pull/1707#discussion_r141537257
##########
File path:
plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtDomainXMLParser.java
##########
@@ -237,6 +241,23 @@ public boolean parseDomainXML(String domXML) {
rngDefs.add(def);
}
+ NodeList watchDogs = devices.getElementsByTagName("watchdog");
+ for (int i = 0; i < watchDogs.getLength(); i++) {
+ WatchDogDef def = null;
+ Element watchDog = (Element)watchDogs.item(i);
+ String action = watchDog.getAttribute("action");
+ String model = watchDog.getAttribute("model");
+
+ if (Strings.isNullOrEmpty(action)) {
+ def = new
WatchDogDef(WatchDogModel.valueOf(model.toUpperCase()));
+ } else {
+ def = new
WatchDogDef(WatchDogAction.valueOf(action.toUpperCase()),
+
WatchDogModel.valueOf(model.toUpperCase()));
+ }
+
+ watchDogDefs.add(def);
+ }
Review comment:
Assuming NPE won't happen on line 244, we can accept this per @wido 's
comment (I've not personally verified this)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services