rhtyd closed pull request #2518: CLOUDSTACK-10348: Don't specify cache mode for 
empty cdrom device
URL: https://github.com/apache/cloudstack/pull/2518
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
 
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
index 7c12c0713c5..cd94b874cf6 100644
--- 
a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
+++ 
b/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) {
+                    diskBuilder.append("<driver name='qemu'" + " type='" + 
_diskFmtType + "' ");
+                } else {
+                    diskBuilder.append("<driver name='qemu'" + " type='" + 
_diskFmtType
+                            + "' cache='" + _diskCacheMode + "' ");
+                }
                 if(_discard != null && _discard != DiscardType.IGNORE) {
                     diskBuilder.append("discard='" + _discard.toString() + "' 
");
                 }


 

----------------------------------------------------------------
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

Reply via email to