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>
This commit is contained in:
		
							
								
								
									
										2
									
								
								block.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								block.c
									
									
									
									
									
								
							| @@ -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); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user