From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, hreitz@redhat.com, kwolf@redhat.com,
vsementsov@yandex-team.ru
Subject: [PATCH] block: Fix bdrv_activate() not to fail without medium
Date: Wed, 12 Mar 2025 15:37:58 +0100 [thread overview]
Message-ID: <20250312143758.1660177-1-armbru@redhat.com> (raw)
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
next reply other threads:[~2025-03-12 14:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-12 14:37 Markus Armbruster [this message]
2025-03-13 10:17 ` [PATCH] block: Fix bdrv_activate() not to fail without medium 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250312143758.1660177-1-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@yandex-team.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).