Skip to contentSkip to conversation

qed: Refuse to create images on block devices

PATCH Applied Stefan Hajnoczi 2 participants 2 messages Jan 14, 2011 – Jan 17, 2011 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qed: Refuse to create images on block devices

QED relies on the underlying filesystem to extend the file and maintain its size. Check that images are not created on a block device.

---
 block/qed.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
block/qed.c +6 -0
index 085c4f2..a46f9ef 100644
@@ -469,6 +469,12 @@ static int qed_create(const char *filename, uint32_t cluster_size,
         return ret;
     }
 
+    /* File must start empty and grow, check truncate is supported */
+    ret = bdrv_truncate(bs, 0);
+    if (ret < 0) {
+        goto out;
+    }
+
     if (backing_file) {
         header.features |= QED_F_BACKING_FILE;
         header.backing_filename_offset = sizeof(le_header);
Signature · 1 line
1.7.2.3
Applied
#1 lore raw

Am 14.01.2011 23:44, schrieb Stefan Hajnoczi:

Quoted 4 lines

QED relies on the underlying filesystem to extend the file and maintain its size. Check that images are not created on a block device.

Thanks, applied to the block branch.

Kevin