mirror of https://github.com/xqemu/xqemu.git
block: Make bdrv_create_file() ':' handling consistent
Filenames may start with "<protocol>:" to explicitly use a protocol like nbd. Filenames with unknown protocols are rejected in most of QEMU except for bdrv_create_file(). Even if a file with an invalid filename can be created, QEMU cannot use it since all the other relevant functions reject such paths. Make bdrv_create_file() consistent. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
36888c6335
commit
16905d7175
2
block.c
2
block.c
|
@ -215,7 +215,7 @@ int bdrv_create_file(const char* filename, QEMUOptionParameter *options)
|
||||||
|
|
||||||
drv = bdrv_find_protocol(filename);
|
drv = bdrv_find_protocol(filename);
|
||||||
if (drv == NULL) {
|
if (drv == NULL) {
|
||||||
drv = bdrv_find_format("file");
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
return bdrv_create(drv, filename, options);
|
return bdrv_create(drv, filename, options);
|
||||||
|
|
Loading…
Reference in New Issue