mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-01 22:23:23 -10:00
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. Signed-off-by: Stefan Hajnoczi <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
This commit is contained in:
1 parent
e61846908e
commit
c743849bee
1 file changed
+6
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user