* [PATCH] file-posix: Fix loss of QAPI feature 'dynamic-auto-read-only'
@ 2026-11-24 15:22 Markus Armbruster
2026-11-24 19:30 ` Eric Blake
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Markus Armbruster @ 2026-11-24 15:22 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, eblake, stefanha, Peter Krempa
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
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] file-posix: Fix loss of QAPI feature 'dynamic-auto-read-only'
2026-11-24 15:22 [PATCH] file-posix: Fix loss of QAPI feature 'dynamic-auto-read-only' Markus Armbruster
@ 2026-11-24 19:30 ` Eric Blake
2026-11-27 9:59 ` Markus Armbruster
2026-11-27 10:07 ` Kevin Wolf
2 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2026-11-24 19:30 UTC (permalink / raw)
To: Markus Armbruster; +Cc: qemu-devel, kwolf, stefanha, Peter Krempa
On Tue, Nov 24, 2026 at 04:22:18PM +0100, Markus Armbruster wrote:
> 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(-)
While we may do a more complete change in 12.0, I agree that this
patch is worth having in 11.2.
>
> 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' } ] }
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] file-posix: Fix loss of QAPI feature 'dynamic-auto-read-only'
2026-11-24 15:22 [PATCH] file-posix: Fix loss of QAPI feature 'dynamic-auto-read-only' Markus Armbruster
2026-11-24 19:30 ` Eric Blake
@ 2026-11-27 9:59 ` Markus Armbruster
2026-11-27 10:07 ` Kevin Wolf
2 siblings, 0 replies; 4+ messages in thread
From: Markus Armbruster @ 2026-11-27 9:59 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, eblake, stefanha, Peter Krempa
Markus Armbruster <armbru@redhat.com> writes:
> 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>
Queued for 11.2.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] file-posix: Fix loss of QAPI feature 'dynamic-auto-read-only'
2026-11-24 15:22 [PATCH] file-posix: Fix loss of QAPI feature 'dynamic-auto-read-only' Markus Armbruster
2026-11-24 19:30 ` Eric Blake
2026-11-27 9:59 ` Markus Armbruster
@ 2026-11-27 10:07 ` Kevin Wolf
2 siblings, 0 replies; 4+ messages in thread
From: Kevin Wolf @ 2026-11-27 10:07 UTC (permalink / raw)
To: Markus Armbruster; +Cc: qemu-devel, eblake, stefanha, Peter Krempa
Am 24.11.2026 um 16:22 hat Markus Armbruster geschrieben:
> 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>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-27 10:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 15:22 [PATCH] file-posix: Fix loss of QAPI feature 'dynamic-auto-read-only' Markus Armbruster
2026-11-24 19:30 ` Eric Blake
2026-11-27 9:59 ` Markus Armbruster
2026-11-27 10:07 ` Kevin Wolf
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.