mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
block: remove separate bdrv_file_open callback
bdrv_file_open and bdrv_open are completely equivalent, they are never checked except to see which one to invoke. So merge them into a single one. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
41770f6e6f
commit
44b424dc4a
17 changed files with 30 additions and 34 deletions
4
block.c
4
block.c
|
@ -1655,9 +1655,7 @@ bdrv_open_driver(BlockDriverState *bs, BlockDriver *drv, const char *node_name,
|
|||
bs->opaque = g_malloc0(drv->instance_size);
|
||||
|
||||
assert(!drv->bdrv_needs_filename || bs->filename[0]);
|
||||
if (drv->bdrv_file_open) {
|
||||
ret = drv->bdrv_file_open(bs, options, open_flags, &local_err);
|
||||
} else if (drv->bdrv_open) {
|
||||
if (drv->bdrv_open) {
|
||||
ret = drv->bdrv_open(bs, options, open_flags, &local_err);
|
||||
} else {
|
||||
ret = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue