From nobody Fri May 3 21:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1623856359; cv=none; d=zohomail.com; s=zohoarc; b=Y6jOsSnH9CKkbg3/72jNkfZFoFF8U8nTXW1NzynokP1tLCoOrQiFNyekZHhzauEpce0RoEvCjYazOoqDJH0hKfFjww6P4THdru3EdrnB17Czd5+WG8MkE96nBUAffDegs2SZM7D5Lg4120AlXGysE5J7AEho3TZAZkv3814mFbo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623856359; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CWCgjKE6JVNs56Qqmj7zAVG9aB0h4yaVWbq98A5f8Ak=; b=OTwj8kvegNyT9HIDYSnN1flPyExL477QGByAgvuG0S9Mb6JnZtUAwiLGvLWJEI2rBtaQlsa98ME82ZIRkN0fJst2qAndi46H/ngSC72YCSPKobPdv/XJ0thVRh13iXOPJKSX0+jAXh5lsKWLeT70H2R2GTzML1OonI8beTqgWfI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 162385635910431.238070497239733; Wed, 16 Jun 2021 08:12:39 -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-287-VZl5nvzwOPyYmz2Oe7-jWw-1; Wed, 16 Jun 2021 11:12:35 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B7EF1DF8AA; Wed, 16 Jun 2021 15:12:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 80C505D9DE; Wed, 16 Jun 2021 15:12:29 +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 0C69F46F59; Wed, 16 Jun 2021 15:12:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 15GF9DSp013404 for ; Wed, 16 Jun 2021 11:09:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id C0C9E5D6AD; Wed, 16 Jun 2021 15:09:13 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4AAA55D6D1 for ; Wed, 16 Jun 2021 15:09:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623856357; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=CWCgjKE6JVNs56Qqmj7zAVG9aB0h4yaVWbq98A5f8Ak=; b=gymzYYAaOBEcnUu+cejIpIQIgUqoSal+JBRS0dpC8G0tA7dhAX8ZZXxxOE1uoaCJ3EnE7p GFiHRr/NMcU+iQb68ey1+N0eissfrn1kS8wfqT4jS+GJS9PYbnTHpwGXe9bmCqg6i1ki3/ JIw9PXpNna1ERe+ISWX6pglKOSK8LrM= X-MC-Unique: VZl5nvzwOPyYmz2Oe7-jWw-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCHv2 1/2] conf: move filesystem target validation Date: Wed, 16 Jun 2021 17:09:06 +0200 Message-Id: <2eaebf6dfd903b50549ee401c177acf78c04df66.1623856123.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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) Check the presence of the target in the validation phase. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Peter Krempa --- src/conf/domain_conf.c | 6 ------ src/conf/domain_validate.c | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 139cdfc0a7..f65509d8ec 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9896,12 +9896,6 @@ virDomainFSDefParseXML(virDomainXMLOption *xmlopt, goto error; } =20 - if (target =3D=3D NULL && !sock) { - virReportError(VIR_ERR_NO_TARGET, - source ? "%s" : NULL, source); - goto error; - } - if (def->type =3D=3D VIR_DOMAIN_FS_TYPE_RAM) { if (!usage) { virReportError(VIR_ERR_XML_ERROR, "%s", diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 9422b00964..bba5a85657 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -2036,6 +2036,14 @@ virDomainShmemDefValidate(const virDomainShmemDef *s= hmem) static int virDomainFSDefValidate(const virDomainFSDef *fs) { + if (fs->dst =3D=3D NULL && !fs->sock) { + const char *source =3D fs->src->path; + + virReportError(VIR_ERR_NO_TARGET, + source ? "%s" : NULL, source); + return -1; + } + if (fs->info.bootIndex && fs->fsdriver !=3D VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", --=20 2.31.1 From nobody Fri May 3 21:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1623856360; cv=none; d=zohomail.com; s=zohoarc; b=XuCe4uvyxvWnTycHeKucZppD/6lDHhL8V1jxsDD41bQbwva8nzvLjKIxcaBqROgua8efcLoh414gqBjELqp9l6jZPpe51dLU0oWwKELNrxgBQzfy1LlE8M2T8ohKflDfoDOXbeJXwsPQOpK7D/Goipsh/BmkBJxjmei7XTYPIQo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623856360; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=olRhq3bQAnMJYfmnkzhUJRrtEPjpeoxuaIttx3cMeIQ=; b=gs87D7Wc7JtCZ15noODr3vhlFMTUr5xVbnDHeZ/CWSuPI1VO5+lC9WuegCN/BmVUbhaGNAlxpe2/U5D6G8Zxx/AgIOyZL+zBDgPMffBt9RGSp0tDCSviQs9ZJ0E4cm7LWCEEsr3S9h7P3N04Kvu1EhOfdps7E/+Iyqk4ggnywuo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1623856360778559.9357789733757; Wed, 16 Jun 2021 08:12:40 -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-292-mHJvN8ciNq2-Z_INLDbmYw-1; Wed, 16 Jun 2021 11:12:37 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 790DE180D513; Wed, 16 Jun 2021 15:12:32 +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 5324B5D9E3; Wed, 16 Jun 2021 15:12:32 +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 146931800FF2; Wed, 16 Jun 2021 15:12:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 15GF9E7I013411 for ; Wed, 16 Jun 2021 11:09:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8F2B65D6BA; Wed, 16 Jun 2021 15:09:14 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id 186105D6AD for ; Wed, 16 Jun 2021 15:09:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623856359; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=olRhq3bQAnMJYfmnkzhUJRrtEPjpeoxuaIttx3cMeIQ=; b=RTCIjc0Z9RRBwG93RmAcgmGSwHioKOXUfKQTCIPlfo4VrL1Lvb4subjsDYP1UmtTXa+5H9 F4WECoJfVc2C8crEKetoSc8gFWTFjJXxIpqv7rJ7CP+awzX+Jx9Uhmvl7FOAvmx8rEoaSW 8AlWtk/hSSn0Nu/4+b7bSSxeuX0GYqU= X-MC-Unique: mHJvN8ciNq2-Z_INLDbmYw-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCHv2 2/2] conf: require target for external virtiofsd Date: Wed, 16 Jun 2021 17:09:07 +0200 Message-Id: <14282440ff71a74311da8e5e17dc3f4c5bc9f062.1623856123.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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) When adding support for externally launched virtiofsd, I was too liberal and did not require a target. But the target is required, because it's passed to the QEMU device, not to virtiofsd. https://bugzilla.redhat.com/show_bug.cgi?id=3D1969232 Fixes: 12967c3e1333a6e106110f449ccb1e96279b9527 Signed-off-by: J=C3=A1n Tomko --- docs/formatdomain.rst | 1 + docs/kbase/virtiofs.rst | 1 + src/conf/domain_validate.c | 4 +++- tests/qemuxml2argvdata/vhost-user-fs-sock.xml | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index da4d93a787..c6dede053f 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -3261,6 +3261,7 @@ A directory on the host that can be accessed directly= from the guest. + ... diff --git a/docs/kbase/virtiofs.rst b/docs/kbase/virtiofs.rst index 8cf7567bf8..6ba7299a72 100644 --- a/docs/kbase/virtiofs.rst +++ b/docs/kbase/virtiofs.rst @@ -180,4 +180,5 @@ control and need to be set by the application running v= irtiofsd. + diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index bba5a85657..2124d25d16 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -2036,8 +2036,10 @@ virDomainShmemDefValidate(const virDomainShmemDef *s= hmem) static int virDomainFSDefValidate(const virDomainFSDef *fs) { - if (fs->dst =3D=3D NULL && !fs->sock) { + if (fs->dst =3D=3D NULL) { const char *source =3D fs->src->path; + if (!source) + source =3D fs->sock; =20 virReportError(VIR_ERR_NO_TARGET, source ? "%s" : NULL, source); diff --git a/tests/qemuxml2argvdata/vhost-user-fs-sock.xml b/tests/qemuxml2= argvdata/vhost-user-fs-sock.xml index aef005d3fd..e5a380c9b6 100644 --- a/tests/qemuxml2argvdata/vhost-user-fs-sock.xml +++ b/tests/qemuxml2argvdata/vhost-user-fs-sock.xml @@ -29,6 +29,7 @@ +
--=20 2.31.1