mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
block: Assume raw for drives without media
qemu -cdrom /dev/cdrom with an empty CD-ROM drive doesn't work any more because we try to guess the format and when this fails (because there is no medium) we exit with an error message. This patch should restore the old behaviour by assuming raw format for such drives. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
236f1f672c
commit
08a00559f0
1 changed files with 2 additions and 2 deletions
4
block.c
4
block.c
|
@ -331,8 +331,8 @@ static BlockDriver *find_image_format(const char *filename)
|
|||
if (ret < 0)
|
||||
return NULL;
|
||||
|
||||
/* Return the raw BlockDriver * to scsi-generic devices */
|
||||
if (bs->sg) {
|
||||
/* Return the raw BlockDriver * to scsi-generic devices or empty drives */
|
||||
if (bs->sg || !bdrv_is_inserted(bs)) {
|
||||
bdrv_delete(bs);
|
||||
return bdrv_find_format("raw");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue