qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: Fix bdrv_activate() not to fail without medium
@ 2025-03-12 14:37 Markus Armbruster
  2025-03-13 10:17 ` Kevin Wolf
  0 siblings, 1 reply; 6+ messages in thread
From: Markus Armbruster @ 2025-03-12 14:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-block, hreitz, kwolf, vsementsov

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(-)

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) {
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-03-20 11:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-12 14:37 [PATCH] block: Fix bdrv_activate() not to fail without medium Markus Armbruster
2025-03-13 10:17 ` Kevin Wolf
2025-03-13 10:44   ` Markus Armbruster
2025-03-13 10:45     ` Markus Armbruster
2025-03-13 11:53   ` Markus Armbruster
2025-03-20 11:30     ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).