From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, eblake@redhat.com, stefanha@redhat.com,
Peter Krempa <pkrempa@redhat.com>
Subject: [PATCH] file-posix: Fix loss of QAPI feature 'dynamic-auto-read-only'
Date: Tue, 24 Nov 2026 16:22:18 +0100 [thread overview]
Message-ID: <20261124152218.2562390-1-armbru@redhat.com> (raw)
Recent commit 691094b7091b added a variant member to BlockdevOptions
branch 'host-device' by changing the branch type to new struct type
BlockdevOptionsHostDevice that has the old branch type
BlockdevOptionsFile as base. This is a perfectly reasonable thing to
do. However, since a type only inherits its base's members, and not
its features or conditions, this lost BlockdevOptionsFile's feature
'dynamic-auto-read-only'.
Considering we are in deep freeze, fix the regression the stupidest
and safest way possible: copy the feature from BlockdevOptionsFile to
BlockdevOptionsHostDevice.
Reported-by: Peter Krempa <pkrempa@redhat.com>
Fixes: 691094b7091b ("file-posix: Add 'accept-read-only-device' option")
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
qapi/block-core.json | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 23c5787d99b..7aa4fa2df93 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -3403,11 +3403,23 @@
# writable. If it is true, this check is skipped. (since: 11.2,
# default: false)
#
+# Features:
+#
+# @dynamic-auto-read-only: If present, enabled auto-read-only means
+# that the driver will open the image read-only at first,
+# dynamically reopen the image file read-write when the first
+# writer is attached to the node and reopen read-only when the
+# last writer is detached. This allows giving QEMU write
+# permissions only on demand when an operation actually needs
+# write access.
+#
# Since: 11.2
##
{ 'struct': 'BlockdevOptionsHostDevice',
'base': 'BlockdevOptionsFile',
- 'data': { '*accept-read-only-device': 'bool' } }
+ 'data': { '*accept-read-only-device': 'bool' },
+ 'features': [ { 'name': 'dynamic-auto-read-only',
+ 'if': 'CONFIG_POSIX' } ] }
##
# @BlockdevOptionsNull:
--
2.55.0
next reply other threads:[~2026-11-24 15:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 15:22 Markus Armbruster [this message]
2026-11-24 19:30 ` [PATCH] file-posix: Fix loss of QAPI feature 'dynamic-auto-read-only' Eric Blake
2026-11-27 9:59 ` Markus Armbruster
2026-11-27 10:07 ` 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=20261124152218.2562390-1-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=pkrempa@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.