DaanHoogland commented on code in PR #11213: URL: https://github.com/apache/cloudstack/pull/11213#discussion_r2209485409
########## plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java: ########## @@ -379,10 +390,13 @@ public String toString() { feaBuilder.append("<"); feaBuilder.append(e.getKey()); - if(e.getKey().equals("spinlocks")) feaBuilder.append(" state='" + e.getValue() + "' retries='" + getRetries() + "'"); - else feaBuilder.append(" state='" + e.getValue() + "'"); + if (e.getKey().equals("spinlocks")) feaBuilder.append(" state='" + e.getValue() + "' retries='" + getRetries() + "'"); + else if (e.getKey().equals("vendor_id")) feaBuilder.append(" state='" + e.getValue() + "' value='KVM Hv'"); + else if (e.getKey().equals("stimer")) feaBuilder.append(" state='" + e.getValue() + "'><direct state='" + e.getValue() + "'/>"); + else feaBuilder.append(" state='" + e.getValue() + "'"); - feaBuilder.append("/>\n"); + if (e.getKey().equals("stimer")) feaBuilder.append("</stimer>\n"); + else feaBuilder.append("/>\n"); Review Comment: looks like this could be a bit cleaner as a switch statement: ``` String key = e.getKey(); feaBuilder.append("<"); feaBuilder.append(key); switch (key) { case “spinlocks”: feaBuilder.append(" state='" + e.getValue() + "' retries='" + getRetries() + "'/>\n”); break; case “vendor_id”: feaBuilder.append(" state='" + e.getValue() + "' value='KVM Hv'/>\n"); break; case “stimer”: feaBuilder.append(" state='" + e.getValue() + "'><direct state='" + e.getValue() + "'/></stimer>\n"); break; default: feaBuilder.append(" state='" + e.getValue() + "'/>\n”); } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org