From nobody Tue Oct 28 08:10:27 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1761052637; cv=none; d=zohomail.com; s=zohoarc; b=L6e2RIh+b9XCLWku8bY4DXg3YXEKWvsZ5gKz5AODih2zwGedHuAEXflmC+2vQArdnOFLrHviAE1VdplblDZyEl9fB4FMpzqcUykK9rauH8TXrLQGct6yI3VukxUeSLZlTAU6QJxvD9nZimaCkCp/rYoEarW14AKkBCOXTNIM+GI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761052637; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id:Cc; bh=1jdx81vXIXBLMd8sQG0pFV8zmkaeUlshqgwDe6q8W94=; b=Ci9t/SnCgetW/E+CRZCLlmbQEo2QgXp5sPkJGS9vHev7bNE0dXZ9PHSbJNH/18iHbhjNNs5SYB+vjI0Wpb582bu/TC3VXyLV88nD5I9X1qioyWFC6VfJVgOTt/fBbemeFZr6tEObcPPXRdyZunUJ1yhNz2BHTY66L+MGdKteB/I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1761052637418729.5392743584694; Tue, 21 Oct 2025 06:17:17 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 6D8D83F881; Tue, 21 Oct 2025 09:17:14 -0400 (EDT) Received: from [172.19.199.20] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id C226D41BF7; Tue, 21 Oct 2025 09:16:03 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id D054A3F843; Tue, 21 Oct 2025 09:11:15 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 363343F299 for ; Tue, 21 Oct 2025 09:11:14 -0400 (EDT) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-353-lRROv5_QNpy1Q6kERHn2Kw-1; Tue, 21 Oct 2025 09:11:11 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 620391956089 for ; Tue, 21 Oct 2025 13:11:10 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.44.34.40]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6AF4B1800452 for ; Tue, 21 Oct 2025 13:11:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761052273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1jdx81vXIXBLMd8sQG0pFV8zmkaeUlshqgwDe6q8W94=; b=RbFRRYQSVXo4zv83DljghP3zSyoB4PyGqadPCeJ/l0W25Wy6AOZ2kGBxth/yV9DcJYN2s2 XbTA653Mx30GGAM/61AFwu29+spIhtJ9RP6PPLN3icnKb7j3dUTUBH629hg5irW/GuT138 1SmeAu6Z0Nc2pKdhqOc94FBuv6HdEcw= X-MC-Unique: lRROv5_QNpy1Q6kERHn2Kw-1 X-Mimecast-MFC-AGG-ID: lRROv5_QNpy1Q6kERHn2Kw_1761052270 To: devel@lists.libvirt.org Subject: [libvirt PATCH] qemu: forbid readonly attribute for externally launched virtiofsd Date: Tue, 21 Oct 2025 15:10:52 +0200 Message-ID: <93bf89632e89a87d75e65218f2623ed4b01e95d5.1761052252.git.jtomko@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: D9RQhMrBkjcZ-pKei6kTRwceX1ZwbrmGi4A1CsM2suk_1761052270 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: CRLXEXBJRWNOARBXQYV37E7QCAV4YEPK X-Message-ID-Hash: CRLXEXBJRWNOARBXQYV37E7QCAV4YEPK X-MailFrom: jtomko@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: =?utf-8?q?J=C3=A1n_Tomko_via_Devel?= Reply-To: =?UTF-8?q?J=C3=A1n=20Tomko?= X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1761052640596158500 From: J=C3=A1n Tomko 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=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/qemu/qemu_validate.c | 6 +++ ...st-user-fs-sock-readonly.x86_64-latest.err | 1 + .../vhost-user-fs-sock-readonly.xml | 41 +++++++++++++++++++ tests/qemuxmlconftest.c | 1 + 4 files changed, 49 insertions(+) create mode 100644 tests/qemuxmlconfdata/vhost-user-fs-sock-readonly.x86_6= 4-latest.err create mode 100644 tests/qemuxmlconfdata/vhost-user-fs-sock-readonly.xml 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 external= ly started virtiofsd")); + return -1; + } } =20 if (fs->model !=3D VIR_DOMAIN_FS_MODEL_DEFAULT) { diff --git a/tests/qemuxmlconfdata/vhost-user-fs-sock-readonly.x86_64-lates= t.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 star= ted 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 + + + + + + + +
+ + + +