Skip to content

Commit b3729b2

Browse files
XanClicmdroth
authored andcommitted
block/vvfat: qcow driver may not be found
Although virtually impossible right now, bdrv_find_format("qcow") may fail. The vvfat block driver should heed that case. Cc: [email protected] Signed-off-by: Max Reitz <[email protected]> Reviewed-by: Kevin Wolf <[email protected]> Signed-off-by: Kevin Wolf <[email protected]> (cherry picked from commit 1bcb15c) Signed-off-by: Michael Roth <[email protected]>
1 parent 1b9ea89 commit b3729b2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

block/vvfat.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2926,6 +2926,12 @@ static int enable_write_target(BDRVVVFATState *s, Error **errp)
29262926
}
29272927

29282928
bdrv_qcow = bdrv_find_format("qcow");
2929+
if (!bdrv_qcow) {
2930+
error_setg(errp, "Failed to locate qcow driver");
2931+
ret = -ENOENT;
2932+
goto err;
2933+
}
2934+
29292935
opts = qemu_opts_create(bdrv_qcow->create_opts, NULL, 0, &error_abort);
29302936
qemu_opt_set_number(opts, BLOCK_OPT_SIZE, s->sector_count * 512);
29312937
qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, "fat:");

0 commit comments

Comments
 (0)