Damans227 commented on code in PR #14272:
URL: https://github.com/apache/cloudstack/pull/14272#discussion_r4283390724


##########
plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/utils/qemu/QemuImg.java:
##########
@@ -911,6 +911,16 @@ public void setSkipTargetVolumeCreation(boolean 
skipTargetVolumeCreation) {
     }
 
     public boolean supportsImageFormat(QemuImg.PhysicalDiskFormat format) {
+        // qemu-img create -f $format -o help
+        // - prints supported format options with rc=0 on known format, and
+        // - error message with rc=1 on unsupported format
+        final Script createProbe = new Script(_qemuImgPath, timeout);
+        createProbe.add("create", "-f", format.toString(), "-o", "help");

Review Comment:
   is this still needed? #13587 already handles the new help header on 4.22, 
and the current check finds qcow2 in the 10.x output from the description



##########
plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/utils/qemu/QemuImg.java:
##########
@@ -132,7 +132,7 @@ public enum BitmapOperation {
     public QemuImg(final long timeout, final boolean skipZeroIfSupported, 
final boolean noCache) throws LibvirtException {
         if (skipZeroIfSupported) {
             final Script s = new Script(_qemuImgPath, timeout);
-            s.add("--help");
+            s.add("convert", "--help");

Review Comment:
   main already checks this flag a different way since #14256. should this 
match it so the forward merge doesnt conflict?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to