summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--include/block/block.h4
-rw-r--r--qemu-img.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/include/block/block.h b/include/block/block.h
index 467fb2ba0a..27d8598eec 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -34,6 +34,10 @@ typedef struct BlockDriverInfo {
      * opened with BDRV_O_UNMAP flag for this to work.
      */
     bool can_write_zeroes_with_unmap;
+    /*
+     * True if this block driver only supports compressed writes
+     */
+    bool needs_compressed_writes;
 } BlockDriverInfo;
 
 typedef struct BlockFragInfo {
diff --git a/qemu-img.c b/qemu-img.c
index 317bc6c1cd..04ce02aeb4 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1502,6 +1502,7 @@ static int img_convert(int argc, char **argv)
             goto out;
         }
     } else {
+        compress = compress || bdi.needs_compressed_writes;
         cluster_sectors = bdi.cluster_size / BDRV_SECTOR_SIZE;
     }