From: Ján Tomko Date: Mon, 19 May 2025 16:20:57 +0000 (+0200) Subject: qemu: forbid readonly attribute for externally launched virtiofsd X-Git-Tag: v11.9.0-rc1~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6862969cf8c9e3a7c0636e7c1a220fe65014155d;p=thirdparty%2Flibvirt.git qemu: forbid readonly attribute for externally launched virtiofsd In that case, libvirtd cannot set it on the command line because virtiofsd is not launched by libvirt. https://issues.redhat.com/browse/RHEL-87522 Signed-off-by: Ján Tomko Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 3e8fdb2268..3b0f2b50a5 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -5022,6 +5022,12 @@ qemuValidateDomainDeviceDefFS(virDomainFSDef *fs, _("virtiofs does not support wrpolicy")); return -1; } + } else { + if (fs->readonly) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("readonly mode cannot be set for externally started virtiofsd")); + return -1; + } } if (fs->model != VIR_DOMAIN_FS_MODEL_DEFAULT) { diff --git a/tests/qemuxmlconfdata/vhost-user-fs-sock-readonly.x86_64-latest.err b/tests/qemuxmlconfdata/vhost-user-fs-sock-readonly.x86_64-latest.err new file mode 100644 index 0000000000..d6df9bddb8 --- /dev/null +++ b/tests/qemuxmlconfdata/vhost-user-fs-sock-readonly.x86_64-latest.err @@ -0,0 +1 @@ +unsupported configuration: readonly mode cannot be set for externally started virtiofsd diff --git a/tests/qemuxmlconfdata/vhost-user-fs-sock-readonly.xml b/tests/qemuxmlconfdata/vhost-user-fs-sock-readonly.xml new file mode 100644 index 0000000000..39e27ccfba --- /dev/null +++ b/tests/qemuxmlconfdata/vhost-user-fs-sock-readonly.xml @@ -0,0 +1,41 @@ + + guest + 126f2720-6f8e-45ab-a886-ec9277079a67 + 14680064 + 14680064 + + + + + 2 + + hvm + + + + qemu64 + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + + + +
+ + + +