From nobody Sat Apr 27 04:50:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1589360351; cv=none; d=zohomail.com; s=zohoarc; b=B84mfYu2oseNeCUTRvwapDmkeuBZj6pWnovS+tJMYV6HEvTjl3XDv4mjkTRoeawr6GxqGnVuYv5yGN1c7oA8SHDp7bbaIDyolSoFtLTjOOCIcTxOPIkTPEqZ7eBQK8SpyoHtZt5rFvNQqtCDF1DEsQAXvCyafFBOBygWUER5Gtg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589360351; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=bzjojqpfI0lCEfvj72WILE69oXfr7hNlKuAn0zJHsh8=; b=FuNKNzPijWvf+p6Z9sBc6eb0q8y5O6AAcYPQy6BAH3IG/J5G0UI/d44/pljbN7qs3Pxb8SlsuqrsmoT7rQnvTByDESDJIU+li71/vc0qn1FVzAndTuXpMWSwhDDWLORz8AHPoUVQlMTYZWUdb/wmA3rdoxP3Kiu213VDljP1yDM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1589360351955770.4279394070481; Wed, 13 May 2020 01:59:11 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-44-MPspFcqnO4qfq0oJEL9uBg-1; Wed, 13 May 2020 04:59:08 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C318C18FE860; Wed, 13 May 2020 08:59:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 49C8375268; Wed, 13 May 2020 08:59:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5D93A1809543; Wed, 13 May 2020 08:58:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04D8wwfN001276 for ; Wed, 13 May 2020 04:58:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 249245D9E5; Wed, 13 May 2020 08:58:58 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.40.208.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B5AB5D9C5 for ; Wed, 13 May 2020 08:58:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589360350; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=bzjojqpfI0lCEfvj72WILE69oXfr7hNlKuAn0zJHsh8=; b=Q6Ds4HlLyqd4d4uyFN5vcasTU0v+M/i6+BKvr9qfyapB0Qnh8JnC3xl5AcVKx509nX9W6c pQiM9k1ZHuWdWif7nKAHkA9M/VUxtrbMlrEeMK8bMPVqD2Pd4KqUksXkXHrWyIQT8StPSz K5BzjVCBFPH/TN/XFpMfxPIxAQu5JKc= X-MC-Unique: MPspFcqnO4qfq0oJEL9uBg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH] qemu: reject readonly attribute for virtiofs Date: Wed, 13 May 2020 10:58:51 +0200 Message-Id: <18539fa2c8d6731dc3ab028fd2d264a26fa8694d.1589360327.git.jtomko@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) This is not yet supported by virtiofsd. Fixes #23 Signed-off-by: J=C3=A1n Tomko Reviewed-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_validate.c | 5 +++ .../vhost-user-fs-readonly.xml | 44 +++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 50 insertions(+) create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-readonly.xml diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index fde1892d42..ac22270104 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3418,6 +3418,11 @@ qemuValidateDomainDeviceDefFS(virDomainFSDefPtr fs, return -1; =20 case VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS: + if (fs->readonly) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("virtiofs does not yet supported read-only mo= de")); + return -1; + } if (!driver->privileged) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("virtiofs is not yet supported in session mod= e")); diff --git a/tests/qemuxml2argvdata/vhost-user-fs-readonly.xml b/tests/qemu= xml2argvdata/vhost-user-fs-readonly.xml new file mode 100644 index 0000000000..003ed41eb3 --- /dev/null +++ b/tests/qemuxml2argvdata/vhost-user-fs-readonly.xml @@ -0,0 +1,44 @@ + + guest + 126f2720-6f8e-45ab-a886-ec9277079a67 + 14680064 + 14680064 + + + + + 2 + + hvm + + + + qemu64 + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + +
+ + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 4ab664a846..8cbf3f8daf 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3171,6 +3171,7 @@ mymain(void) =20 DO_TEST_CAPS_LATEST("vhost-user-fs-fd-memory"); DO_TEST_CAPS_LATEST("vhost-user-fs-hugepages"); + DO_TEsT_CAPS_LATEST_PARSE_ERROR("vhost-user-fs-readonly"); =20 DO_TEST("riscv64-virt", QEMU_CAPS_DEVICE_VIRTIO_MMIO); --=20 2.25.4