You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2018/04/02 10:35:51 UTC

[GitHub] rafaelweingartner commented on a change in pull request #2518: CLOUDSTACK-10348: Don't specify cache mode for empty cdrom device

rafaelweingartner commented on a change in pull request #2518: CLOUDSTACK-10348: Don't specify cache mode for empty cdrom device
URL: https://github.com/apache/cloudstack/pull/2518#discussion_r178522730
 
 

 ##########
 File path: plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
 ##########
 @@ -819,8 +819,12 @@ public String toString() {
             diskBuilder.append(" type='" + _diskType + "'");
             diskBuilder.append(">\n");
             if(qemuDriver) {
-                diskBuilder.append("<driver name='qemu'" + " type='" + _diskFmtType
-                        + "' cache='" + _diskCacheMode + "' ");
+                if (_deviceType == DeviceType.CDROM && _sourcePath == null) {
 
 Review comment:
   What about extracting this bit of code that appends the disk information to a XML to a method called? Then, it is possible to further document it (when the cache mode is used and why it is not used sometimes), and of course it would enable us to unit test this logic of creating the disk entry.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services