GabrielBrascher 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_r138649341
##########
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:
Shouldn't it check if the 'model' is null/empty/blank (as the one applied to
the 'action')? Thanks @wido!
----------------------------------------------------------------
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