diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-11-24 16:29:06 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2024-06-28 14:44:51 +0200 |
commit | ae8b45d29317be0bcc60d40e5d627f978b27ccd0 (patch) | |
tree | deb264a54d469456a989c4f08d5609bb0b779692 | |
parent | b3f1ce8a472e7239b196bcb3aaa38738012f23b5 (diff) |
block: make assertion more generic
.bdrv_needs_filename is only set for drivers that also set bdrv_file_open,
i.e. protocol drivers.
So we can make the assertion always, it will always pass for those drivers
that use bdrv_open.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | block.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1655,8 +1655,8 @@ bdrv_open_driver(BlockDriverState *bs, BlockDriver *drv, const char *node_name, bs->drv = drv; bs->opaque = g_malloc0(drv->instance_size); + assert(!drv->bdrv_needs_filename || bs->filename[0]); if (drv->bdrv_file_open) { - assert(!drv->bdrv_needs_filename || bs->filename[0]); ret = drv->bdrv_file_open(bs, options, open_flags, &local_err); } else if (drv->bdrv_open) { ret = drv->bdrv_open(bs, options, open_flags, &local_err); |