From nobody Thu Apr 25 18:49:27 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=1617216968; cv=none; d=zohomail.com; s=zohoarc; b=Z+ZREbf4L9hMH2U7qNjVhwBsZRnIp4/a59+rbzjWDNdGxd83rMugHUg8dAkd+B4hoU9sTOjYtlaMs6Hlvyq7jfJogadtw/RKwINyjKDgMxIHSy/XlJ7GRGh3rlhVfKIlYyI64mHN9vEhor+DrCLpWtdY+PQSZl9Gzp8Uz4ITtHQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617216968; 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=48fi3bzCldIjODGq6eNx6PhpLLeJViHT2AVlWIp+Wxw=; b=WJKf3RxMJPU8l/NNBpQDuY6LKlVxe8x+t5Hp8bSTAiVzm7KrnfGGBfSco2LVkZrA2oFZOEHUHL6O/bmfeNQ/KlRWXdUTrm5AiEKQRZZ9/S5exCSGeHMBd5bsn12no3tHy9pSbUVo67seed2KHgtqQr47oVcnvfXBsJaqdlLgwig= 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) header.from= 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 1617216968317332.51287367250075; Wed, 31 Mar 2021 11:56:08 -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-298-vCgWxHM8MVe6HwOusr1VvQ-1; Wed, 31 Mar 2021 14:56:02 -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 ADA7181746D; Wed, 31 Mar 2021 18:55:57 +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 8346D4F3C6; Wed, 31 Mar 2021 18:55:57 +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 3913A4A7CA; Wed, 31 Mar 2021 18:55:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12VItkN6004606 for ; Wed, 31 Mar 2021 14:55:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7063A17DC3; Wed, 31 Mar 2021 18:55:46 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.40.208.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id E0E1B6060F for ; Wed, 31 Mar 2021 18:55:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617216967; 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=48fi3bzCldIjODGq6eNx6PhpLLeJViHT2AVlWIp+Wxw=; b=GljgNn98b6raTAnFMopJQYCK0cBDplA5lbR0333LW8MjRXGHaMe4tkwEj28iTsLytHpQN0 f70Vo+Fb2EtM24ciee2jCGIDfnbwau29fUR8/C5gMgFQGjyLRoWUfJRIuR/Ew6fEB0vnvx 11p8WcPPdcmtFIhI0GoGk6KscaiYEWk= X-MC-Unique: vCgWxHM8MVe6HwOusr1VvQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCHv1 1/4] conf: fs: fill out accessmode in post-parse Date: Wed, 31 Mar 2021 20:55:35 +0200 Message-Id: <4f343d3135ab4be76541a70198933086d519648e.1617216814.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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 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) Move the default setting of accessmode to the post-parse phase. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 18 ++++++++++++++++-- src/conf/domain_conf.h | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d050a519c6..3c3e381de2 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -504,6 +504,7 @@ VIR_ENUM_IMPL(virDomainFSDriver, =20 VIR_ENUM_IMPL(virDomainFSAccessMode, VIR_DOMAIN_FS_ACCESSMODE_LAST, + "", "passthrough", "mapped", "squash", @@ -5486,6 +5487,16 @@ virDomainMemoryDefPostParse(virDomainMemoryDefPtr me= m, } =20 =20 +static int +virDomainFSDefPostParse(virDomainFSDefPtr fs) +{ + if (fs->accessmode =3D=3D VIR_DOMAIN_FS_ACCESSMODE_DEFAULT) + fs->accessmode =3D VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH; + + return 0; +} + + static int virDomainDeviceDefPostParseCommon(virDomainDeviceDefPtr dev, const virDomainDef *def, @@ -5531,8 +5542,11 @@ virDomainDeviceDefPostParseCommon(virDomainDeviceDef= Ptr dev, ret =3D virDomainMemoryDefPostParse(dev->data.memory, def); break; =20 - case VIR_DOMAIN_DEVICE_LEASE: case VIR_DOMAIN_DEVICE_FS: + ret =3D virDomainFSDefPostParse(dev->data.fs); + break; + + case VIR_DOMAIN_DEVICE_LEASE: case VIR_DOMAIN_DEVICE_NET: case VIR_DOMAIN_DEVICE_INPUT: case VIR_DOMAIN_DEVICE_SOUND: @@ -10263,7 +10277,7 @@ virDomainFSDefParseXML(virDomainXMLOptionPtr xmlopt, goto error; } } else { - def->accessmode =3D VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH; + def->accessmode =3D VIR_DOMAIN_FS_ACCESSMODE_DEFAULT; } =20 fmode =3D virXMLPropString(node, "fmode"); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 0b8895bbdf..9c47df99f6 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -802,6 +802,7 @@ typedef enum { =20 /* Filesystem mount access mode */ typedef enum { + VIR_DOMAIN_FS_ACCESSMODE_DEFAULT =3D 0, VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH, VIR_DOMAIN_FS_ACCESSMODE_MAPPED, VIR_DOMAIN_FS_ACCESSMODE_SQUASH, --=20 2.29.2 From nobody Thu Apr 25 18:49:27 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=1617216971; cv=none; d=zohomail.com; s=zohoarc; b=GMbZbBbFr/ms4dzgeDNuvSDrtg3voqwmdtKOtwei4En5wAOdjynogkIFXVK0OJmlI38+y8JVEVM+Xo5Ag5SDXfJOwypWLyzdeEt0mZaOnLLjHdxYzGfugykFI/i//qYd+g5gFYDjrZP4wAtAiMBCd2N4zk5iUCFccKyE075vJ3I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617216971; 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=wSaPm/9lx2Wqx1ZVPh47erCJ6YbIu0M7oOM4QrQWztA=; b=jT6uBdpqp0EKTxe7LgYsMyIrWDtRpvbix0J1b8gqG7P9sWjI6h3ztcjQLkEv6SPk7kw0h+2Ggu/xyXyav4b+NGFMxSBYPMOjznfP5TlOp4TZWoXWJvrTDLPs0XnVYDHK8JMzlYmz1aDctHBu8FD+l2IokTzWll1f9vwWkiZX8qA= 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) header.from= 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 1617216971810408.04677543251876; Wed, 31 Mar 2021 11:56: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-161-Jx3s74AAPuWTRtdLKL7UFg-1; Wed, 31 Mar 2021 14:56:07 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 30452802B62; Wed, 31 Mar 2021 18:56:01 +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 0316E5D72F; Wed, 31 Mar 2021 18:56: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 ABED94A7CD; Wed, 31 Mar 2021 18:56:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12VItl1F004621 for ; Wed, 31 Mar 2021 14:55:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5A84F6060F; Wed, 31 Mar 2021 18:55:47 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.40.208.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id CDA252B0A7 for ; Wed, 31 Mar 2021 18:55:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617216970; 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=wSaPm/9lx2Wqx1ZVPh47erCJ6YbIu0M7oOM4QrQWztA=; b=hBOcRt/N/nbLzvejaZsK373DKC5ktxF7hLgAYaLfp+8Aox1XzIFyM+4XVDQWn8+mVOvKCb MxkLoJRw/gdzz+SHM0s2MnYCO9lmNRn2hnOHqTkI6jWk8P84GqAgig2J2uSwAmRVDpH02H wsRyBeg8UeT+6+1xyFhDEhO+3sXNikM= X-MC-Unique: Jx3s74AAPuWTRtdLKL7UFg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCHv1 2/4] conf: fs: allow missing accessmode in the formatter Date: Wed, 31 Mar 2021 20:55:36 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.15 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) So far VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH is always set in virDomainFSDefPostParse, but future commits aim to change that. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3c3e381de2..5a1e193b2d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -25436,9 +25436,9 @@ virDomainFSDefFormat(virBufferPtr buf, return -1; } =20 - virBufferAsprintf(buf, - "accessmode !=3D VIR_DOMAIN_FS_ACCESSMODE_DEFAULT) + virBufferAsprintf(buf, " accessmode=3D'%s'", accessmode); if (def->model) { virBufferAsprintf(buf, " model=3D'%s'", virDomainFSModelTypeToString(def->model)); --=20 2.29.2 From nobody Thu Apr 25 18:49:27 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=1617216963; cv=none; d=zohomail.com; s=zohoarc; b=Ubz0LDsZunMSOeWDIfnMESrydPzmalQMIzLnob85TxAkk2gJ1/KRvqy47KDwxt/Q7jcEyYbhB6tdqti7DM4r21PQ5btk38DOh6DeqWko2SbNBSKGBHf/a7SN8lxbYJ92oyKHyc+56MObpCAFNQK2AwALC9WQ2IKqJOMWYzwboCQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617216963; 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=3SuD2+XGPoqNjYs3OIzBhEPVasSRQWAafg7s+7Yydt8=; b=Dh5cKmgeJ1iDfFWAHsiUdc8+/i0QbojwS5fUuauhgwMsMCGmwjosMBGEfC0rEQX+DguuEvEGE0TmTwoBGSAArpHplgqplAVgG14QWJX1P7Q3ISdl0QyVW1qBc5ee+8I9x/rehE+0oCt2gbg9SM4kHLVlaSZsQTH627LWIZLCCUM= 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) header.from= 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 1617216963058119.89246548005815; Wed, 31 Mar 2021 11:56:03 -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-295-Lx9zIFUXMaixYBMscyVuHg-1; Wed, 31 Mar 2021 14:55:58 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C9F1CA0CB3; Wed, 31 Mar 2021 18:55:51 +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 7509C12D9A6; Wed, 31 Mar 2021 18:55:51 +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 244EE4BB7C; Wed, 31 Mar 2021 18:55:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12VItm89004628 for ; Wed, 31 Mar 2021 14:55:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6638A2B0A7; Wed, 31 Mar 2021 18:55:48 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.40.208.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id B684A6060F for ; Wed, 31 Mar 2021 18:55:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617216962; 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=3SuD2+XGPoqNjYs3OIzBhEPVasSRQWAafg7s+7Yydt8=; b=gPIFeEF2BFSACe2esmGysvoC1hLkKEsMM1bS8F1Ld0Qev1fDUc/LRibgCtf24iOqR/pilz hJGPj0CuUaykdoqYKLxcky5kU3PQzpNmRVDBJ7FDaFDBx8y5iEuvN+hTUnJHdkGGmYdArO 2RO3A+69GWPWYdiHMsyf9JR5HIGcZDM= X-MC-Unique: Lx9zIFUXMaixYBMscyVuHg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCHv1 3/4] conf: add socket for virtiofs filesystems Date: Wed, 31 Mar 2021 20:55:37 +0200 Message-Id: <5d5202db1cff6b580df34d3921b3854ddc473d53.1617216815.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.12 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) Allow passing a socket of an externally launched virtiofsd to the vhost-user-fs device. https://bugzilla.redhat.com/show_bug.cgi?id=3D1855789 Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- docs/schemas/domaincommon.rng | 11 ++++++ src/conf/domain_conf.c | 21 ++++++---- src/conf/domain_conf.h | 1 + src/qemu/qemu_validate.c | 17 ++++---- tests/qemuxml2argvdata/vhost-user-fs-sock.xml | 39 +++++++++++++++++++ .../vhost-user-fs-sock.x86_64-latest.xml | 1 + tests/qemuxml2xmltest.c | 1 + 7 files changed, 76 insertions(+), 15 deletions(-) create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-sock.xml create mode 120000 tests/qemuxml2xmloutdata/vhost-user-fs-sock.x86_64-late= st.xml diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index f5ced5b7a2..361cd44e4e 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2747,9 +2747,18 @@ + + + + + + + + + @@ -2811,10 +2820,12 @@ + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5a1e193b2d..ddf072783b 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2472,6 +2472,7 @@ void virDomainFSDefFree(virDomainFSDefPtr def) g_free(def->virtio); virObjectUnref(def->privateData); g_free(def->binary); + g_free(def->sock); =20 g_free(def); } @@ -5490,7 +5491,7 @@ virDomainMemoryDefPostParse(virDomainMemoryDefPtr mem, static int virDomainFSDefPostParse(virDomainFSDefPtr fs) { - if (fs->accessmode =3D=3D VIR_DOMAIN_FS_ACCESSMODE_DEFAULT) + if (fs->accessmode =3D=3D VIR_DOMAIN_FS_ACCESSMODE_DEFAULT && !fs->soc= k) fs->accessmode =3D VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH; =20 return 0; @@ -10252,6 +10253,7 @@ virDomainFSDefParseXML(virDomainXMLOptionPtr xmlopt, g_autofree char *multidevs =3D NULL; g_autofree char *fmode =3D NULL; g_autofree char *dmode =3D NULL; + g_autofree char *sock =3D NULL; =20 ctxt->node =3D node; =20 @@ -10334,9 +10336,9 @@ virDomainFSDefParseXML(virDomainXMLOptionPtr xmlopt, cur =3D node->children; while (cur !=3D NULL) { if (cur->type =3D=3D XML_ELEMENT_NODE) { - if (!source && + if (!source && !sock && virXMLNodeNameEqual(cur, "source")) { - + sock =3D virXMLPropString(cur, "socket"); if (def->type =3D=3D VIR_DOMAIN_FS_TYPE_MOUNT || def->type =3D=3D VIR_DOMAIN_FS_TYPE_BIND) { source =3D virXMLPropString(cur, "dir"); @@ -10458,13 +10460,13 @@ virDomainFSDefParseXML(virDomainXMLOptionPtr xmlo= pt, } =20 if (source =3D=3D NULL && def->type !=3D VIR_DOMAIN_FS_TYPE_RAM - && def->type !=3D VIR_DOMAIN_FS_TYPE_VOLUME) { + && def->type !=3D VIR_DOMAIN_FS_TYPE_VOLUME && !sock) { virReportError(VIR_ERR_NO_SOURCE, target ? "%s" : NULL, target); goto error; } =20 - if (target =3D=3D NULL) { + if (target =3D=3D NULL && !sock) { virReportError(VIR_ERR_NO_TARGET, source ? "%s" : NULL, source); goto error; @@ -10488,6 +10490,7 @@ virDomainFSDefParseXML(virDomainXMLOptionPtr xmlopt, } =20 def->src->path =3D g_steal_pointer(&source); + def->sock =3D g_steal_pointer(&sock); def->dst =3D g_steal_pointer(&target); =20 if (virDomainDeviceInfoParseXML(xmlopt, node, ctxt, &def->info, @@ -22372,7 +22375,7 @@ static bool virDomainFsDefCheckABIStability(virDomainFSDefPtr src, virDomainFSDefPtr dst) { - if (STRNEQ(src->dst, dst->dst)) { + if (STRNEQ_NULLABLE(src->dst, dst->dst)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Target filesystem guest target %s does not match= source %s"), dst->dst, src->dst); @@ -25508,8 +25511,10 @@ virDomainFSDefFormat(virBufferPtr buf, switch (def->type) { case VIR_DOMAIN_FS_TYPE_MOUNT: case VIR_DOMAIN_FS_TYPE_BIND: - virBufferEscapeString(buf, "\n", - src); + if (!def->sock) + virBufferEscapeString(buf, "\n", src); + else + virBufferEscapeString(buf, "\n", def->s= ock); break; =20 case VIR_DOMAIN_FS_TYPE_BLOCK: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 9c47df99f6..0c1124078b 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -859,6 +859,7 @@ struct _virDomainFSDef { int multidevs; /* virDomainFSMultidevs */ unsigned long long usage; /* in bytes */ virStorageSourcePtr src; + char *sock; char *dst; bool readonly; virDomainDeviceInfo info; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 6043f974ce..0843a7f74a 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -4102,26 +4102,29 @@ qemuValidateDomainDeviceDefFS(virDomainFSDefPtr fs, return -1; =20 case VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS: - if (fs->readonly) { + if (!fs->sock) { + if (fs->readonly) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("virtiofs does not yet support read-only mode= ")); return -1; - } - if (!driver->privileged) { + } + if (!driver->privileged) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("virtiofs is not yet supported in session mod= e")); return -1; - } - if (fs->accessmode !=3D VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH) { + } + if (fs->accessmode !=3D VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("virtiofs only supports passthrough accessmod= e")); return -1; - } - if (fs->wrpolicy !=3D VIR_DOMAIN_FS_WRPOLICY_DEFAULT) { + } + if (fs->wrpolicy !=3D VIR_DOMAIN_FS_WRPOLICY_DEFAULT) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("virtiofs does not support wrpolicy")); return -1; + } } + if (fs->model !=3D VIR_DOMAIN_FS_MODEL_DEFAULT) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("virtiofs does not support model")); diff --git a/tests/qemuxml2argvdata/vhost-user-fs-sock.xml b/tests/qemuxml2= argvdata/vhost-user-fs-sock.xml new file mode 100644 index 0000000000..aef005d3fd --- /dev/null +++ b/tests/qemuxml2argvdata/vhost-user-fs-sock.xml @@ -0,0 +1,39 @@ + + guest + 126f2720-6f8e-45ab-a886-ec9277079a67 + 14680064 + 14680064 + + + + + 2 + + hvm + + + + qemu64 + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + +
+ + + +