Markus Armbruster <arm...@redhat.com> writes: > Markus Armbruster <arm...@redhat.com> writes: > >> Kevin Wolf <kw...@redhat.com> writes: >> >>> auto-read-only=on changed its behaviour in file-posix for the 4.0 >>> release. >> >> Commit hash, please. > > I guess it's commit 23dece19da4 "file-posix: Make auto-read-only > dynamic". > >>> This change cannot be detected through the usual mechanisms >>> like schema introspection. Add a new feature to query-qemu-features to >>> allow libvirt to detect the presence of the new behaviour. >>> >>> Signed-off-by: Kevin Wolf <kw...@redhat.com> [...] > The "posix" in @file-posix-dynamic-auto-read-only feels weird. To make > sense of it, you need to know on what kind of host QEMU runs. If we > ever implement it for Windows hosts, we'd get do add > @file-windows-posix-dynamic-auto-read-only. > > What about instead adding @file-dynamic-auto-read-only with a suitable > compile-time conditional? > > [...]
Incremental patch: diff --git a/qapi/misc.json b/qapi/misc.json index df23c54a65..36b5ceb595 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -3058,7 +3058,7 @@ # Information about support for QEMU features that isn't available through # schema introspection. # -# @file-posix-dynamic-auto-read-only: +# @file-dynamic-auto-read-only: # true if auto-read-only=on means that the image file is dynamically reopened # read-only or read-write depending on whether any writers are attached to # the node. @@ -3066,7 +3066,9 @@ # Since: 4.0 ## { 'struct': 'QemuFeatures', - 'data': { 'file-posix-dynamic-auto-read-only': 'bool' } } + 'data': { + 'file-dynamic-auto-read-only': { 'type': 'bool', + 'if': 'defined(CONFIG_POSIX)' } } } ## # @query-qemu-features: diff --git a/qmp.c b/qmp.c index 2a887c1e7d..7a4e8d5935 100644 --- a/qmp.c +++ b/qmp.c @@ -723,7 +723,7 @@ QemuFeatures *qmp_query_qemu_features(Error **errp) QemuFeatures *caps = g_new(QemuFeatures, 1); *caps = (QemuFeatures) { - .file_posix_dynamic_auto_read_only = true, + .file_dynamic_auto_read_only = true, }; return caps;