From nobody Fri Oct 18 06:16:12 2024 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1721738921253688.0747831549226; Tue, 23 Jul 2024 05:48:41 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 131EEBC3; Tue, 23 Jul 2024 08:48:40 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id E9707A45; Tue, 23 Jul 2024 08:48:10 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 7FEB09C3; Tue, 23 Jul 2024 08:48:06 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id C93879C0 for ; Tue, 23 Jul 2024 08:48:05 -0400 (EDT) Received: from mx-prod-mc-04.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-660-L3csuANTMw-Jx6lkvDO1CQ-1; Tue, 23 Jul 2024 08:48:03 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 21A191955D45 for ; Tue, 23 Jul 2024 12:48:03 +0000 (UTC) Received: from ajulis-thinkpadt14gen4.remote.csb (unknown [10.43.2.246]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 491E21955D44 for ; Tue, 23 Jul 2024 12:48:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721738885; 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=OmJg7kyBhruxrdkS32oQip59psc/Y9LMoxnHZV02Gyk=; b=fQMytToOtNmO44/cYw8WCiSS6fbB4SGEVjOX7h2MvXhkHw8WzFgmExSP/dWZvXPRwdHxww 9kaE8ouOC2aekvDY35DDBmAvMTZlMio6Ji7BYeD+/tttoYgVypMHAIW9vnKGIEmoX2KUqF cUOLQaJkyxLgq5TjOrEGbc32DtgEkSQ= X-MC-Unique: L3csuANTMw-Jx6lkvDO1CQ-1 From: Adam Julis To: devel@lists.libvirt.org Subject: [PATCH] virtiofs: rename member to 'openfiles' for clarity Date: Tue, 23 Jul 2024 14:47:58 +0200 Message-ID: <74b7404071c5aa961f9dfccd4092b12975f86be4.1721738811.git.ajulis@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ACUS627XVBZLZAB7O5XDC3HC4QHVZC6V X-Message-ID-Hash: ACUS627XVBZLZAB7O5XDC3HC4QHVZC6V X-MailFrom: ajulis@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1721738921646116600 Content-Type: text/plain; charset="utf-8"; x-default="true" New element 'openfiles' had confusing name. Since the patch with this new element wasn't propagate yet, old name ('rlimit_nofile') was changed. ... ... Signed-off-by: Adam Julis Reviewed-by: Michal Privoznik --- docs/formatdomain.rst | 6 +++--- src/conf/domain_conf.c | 14 +++++++------- src/conf/domain_conf.h | 2 +- src/conf/schemas/domaincommon.rng | 4 ++-- src/qemu/qemu_virtiofs.c | 4 ++-- ... vhost-user-fs-fd-openfiles.x86_64-latest.args} | 0 .../vhost-user-fs-fd-openfiles.x86_64-latest.xml | 1 + ...d-rlimit.xml =3D> vhost-user-fs-fd-openfiles.xml} | 2 +- .../vhost-user-fs-fd-rlimit.x86_64-latest.xml | 1 - tests/qemuxmlconftest.c | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) rename tests/qemuxmlconfdata/{vhost-user-fs-fd-rlimit.x86_64-latest.args = =3D> vhost-user-fs-fd-openfiles.x86_64-latest.args} (100%) create mode 120000 tests/qemuxmlconfdata/vhost-user-fs-fd-openfiles.x86_64= -latest.xml rename tests/qemuxmlconfdata/{vhost-user-fs-fd-rlimit.xml =3D> vhost-user-= fs-fd-openfiles.xml} (97%) delete mode 120000 tests/qemuxmlconfdata/vhost-user-fs-fd-rlimit.x86_64-la= test.xml diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 10584dfe83..c2a6d0b910 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -3734,10 +3734,10 @@ A directory on the host that can be accessed direct= ly from the guest. The thread pool helps increase the number of requests in flight when us= ed with storage that has a higher latency. However, it has an overhead, and so= for fast, low latency filesystems, it may be best to turn it off. ( :since:= `Since 8.5.0` ) - Element ``rlimit_profile`` accepts one attribute ``size`` which defines= the + Element ``openfiles`` accepts one attribute ``max`` which defines the maximum number of file descriptors. Non-positive values are forbidden. - Although numbers greater than 1M are allowed, the virtiofsd documentati= on - states that in this case its set by virtiofsd to the 1M. ( :since:`Sinc= e 10.6.0` ) + The upper bound on the number of open files is implementation defined. + ( :since:`Since 10.6.0` ) ``source`` The resource on the host that is being accessed in the guest. The ``nam= e`` attribute must be used with ``type=3D'template'``, and the ``dir`` attr= ibute diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6733857a3a..d1c59f7a91 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8868,7 +8868,7 @@ virDomainFSDefParseXML(virDomainXMLOption *xmlopt, g_autofree char *queue_size =3D virXPathString("string(./driver/@q= ueue)", ctxt); g_autofree char *binary =3D virXPathString("string(./binary/@path)= ", ctxt); g_autofree char *thread_pool_size =3D virXPathString("string(./bin= ary/thread_pool/@size)", ctxt); - g_autofree char *rlimit_nofile =3D virXPathString("string(./binary= /rlimit_nofile/@size)", ctxt); + g_autofree char *openfiles =3D virXPathString("string(./binary/ope= nfiles/@max)", ctxt); xmlNodePtr binary_node =3D virXPathNode("./binary", ctxt); xmlNodePtr binary_lock_node =3D virXPathNode("./binary/lock", ctxt= ); xmlNodePtr binary_cache_node =3D virXPathNode("./binary/cache", ct= xt); @@ -8892,11 +8892,11 @@ virDomainFSDefParseXML(virDomainXMLOption *xmlopt, goto error; } =20 - if (rlimit_nofile && - virStrToLong_ull(rlimit_nofile, NULL, 10, &def->rlimit_nofile)= < 0) { + if (openfiles && + virStrToLong_ull(openfiles, NULL, 10, &def->openfiles) < 0) { virReportError(VIR_ERR_XML_ERROR, - _("cannot parse rlimit_nofile '%1$s' for virtio= fs"), - rlimit_nofile); + _("cannot parse openfiles '%1$s' for virtiofs"), + openfiles); goto error; } =20 @@ -23424,8 +23424,8 @@ virDomainFSDefFormat(virBuffer *buf, if (def->thread_pool_size >=3D 0) virBufferAsprintf(&binaryBuf, "\n", = def->thread_pool_size); =20 - if (def->rlimit_nofile > 0) - virBufferAsprintf(&binaryBuf, "\= n", def->rlimit_nofile); + if (def->openfiles > 0) + virBufferAsprintf(&binaryBuf, "\n", d= ef->openfiles); =20 } =20 diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 8283493dfc..6972f6ae9b 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -890,7 +890,7 @@ struct _virDomainFSDef { bool symlinksResolved; char *binary; unsigned long long queue_size; - unsigned long long rlimit_nofile; + unsigned long long openfiles; virTristateSwitch xattr; virDomainFSCacheMode cache; virTristateSwitch posix_lock; diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index ab5374d5f0..8dae6416e9 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -3381,9 +3381,9 @@ - + - + diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c index 703f1226a2..a8f2416273 100644 --- a/src/qemu/qemu_virtiofs.c +++ b/src/qemu/qemu_virtiofs.c @@ -194,8 +194,8 @@ qemuVirtioFSBuildCommandLine(virQEMUDriverConfig *cfg, if (fs->thread_pool_size >=3D 0) virCommandAddArgFormat(cmd, "--thread-pool-size=3D%i", fs->thread_= pool_size); =20 - if (fs->rlimit_nofile > 0) - virCommandAddArgFormat(cmd, "--rlimit-nofile=3D%llu", fs->rlimit_n= ofile); + if (fs->openfiles > 0) + virCommandAddArgFormat(cmd, "--rlimit-nofile=3D%llu", fs->openfile= s); =20 if (cfg->virtiofsdDebug) { if (virBitmapIsBitSet(fs->caps, QEMU_VHOST_USER_FS_FEATURE_SEPARAT= E_OPTIONS)) diff --git a/tests/qemuxmlconfdata/vhost-user-fs-fd-rlimit.x86_64-latest.ar= gs b/tests/qemuxmlconfdata/vhost-user-fs-fd-openfiles.x86_64-latest.args similarity index 100% rename from tests/qemuxmlconfdata/vhost-user-fs-fd-rlimit.x86_64-latest.args rename to tests/qemuxmlconfdata/vhost-user-fs-fd-openfiles.x86_64-latest.ar= gs diff --git a/tests/qemuxmlconfdata/vhost-user-fs-fd-openfiles.x86_64-latest= .xml b/tests/qemuxmlconfdata/vhost-user-fs-fd-openfiles.x86_64-latest.xml new file mode 120000 index 0000000000..74761b0d0f --- /dev/null +++ b/tests/qemuxmlconfdata/vhost-user-fs-fd-openfiles.x86_64-latest.xml @@ -0,0 +1 @@ +vhost-user-fs-fd-openfiles.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/vhost-user-fs-fd-rlimit.xml b/tests/qemu= xmlconfdata/vhost-user-fs-fd-openfiles.xml similarity index 97% rename from tests/qemuxmlconfdata/vhost-user-fs-fd-rlimit.xml rename to tests/qemuxmlconfdata/vhost-user-fs-fd-openfiles.xml index 2983d3f275..3e925a8c8b 100644 --- a/tests/qemuxmlconfdata/vhost-user-fs-fd-rlimit.xml +++ b/tests/qemuxmlconfdata/vhost-user-fs-fd-openfiles.xml @@ -32,7 +32,7 @@ - + diff --git a/tests/qemuxmlconfdata/vhost-user-fs-fd-rlimit.x86_64-latest.xm= l b/tests/qemuxmlconfdata/vhost-user-fs-fd-rlimit.x86_64-latest.xml deleted file mode 120000 index 68c4e8a482..0000000000 --- a/tests/qemuxmlconfdata/vhost-user-fs-fd-rlimit.x86_64-latest.xml +++ /dev/null @@ -1 +0,0 @@ -vhost-user-fs-fd-rlimit.xml \ No newline at end of file diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index cc984440ea..bf88bd2f8d 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2816,7 +2816,7 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("launch-security-s390-pv", "s390x"); =20 DO_TEST_CAPS_LATEST("vhost-user-fs-fd-memory"); - DO_TEST_CAPS_LATEST("vhost-user-fs-fd-rlimit"); + DO_TEST_CAPS_LATEST("vhost-user-fs-fd-openfiles"); DO_TEST_CAPS_LATEST("vhost-user-fs-hugepages"); DO_TEST_CAPS_LATEST_PARSE_ERROR("vhost-user-fs-readonly"); =20 --=20 2.45.2