Message ID | 20250312143758.1660177-1-armbru@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | block: Fix bdrv_activate() not to fail without medium | expand |
diff --git a/block.c b/block.c index 0ece805e41..9855c102de 100644 --- a/block.c +++ b/block.c @@ -6860,7 +6860,7 @@ int bdrv_activate(BlockDriverState *bs, Error **errp) GRAPH_RDLOCK_GUARD_MAINLOOP(); if (!bs->drv) { - return -ENOMEDIUM; + return 0; } QLIST_FOREACH(child, &bs->children, next) {
bdrv_activate() returns failure without setting an error when !bs->drv. This is suspicious. Turns out it used to succeed then, until commit 5416645fcf82 changed it to return -ENOMEDIUM. Return zero instead. Fixes: 5416645fcf82 (block: return error-code from bdrv_invalidate_cache) Signed-off-by: Markus Armbruster <armbru@redhat.com> --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)