From nobody Tue Apr 30 17:22:41 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=1628009272; cv=none; d=zohomail.com; s=zohoarc; b=mTOG40Ro7uaVeySJ0sAiDucJ5Yo01VvD3ZGQuJXywb6yf220kA+h+eBTyCm4WJHkXylCe1fCrIpo44jXDpu4k08pazRnfuWrBluvg//Gb3Pe5w00I9nsHJMtiRJn5qQVMG8VIJvBOE4FCf71gQRkGiKAMJHt3s/05jeeIpGwOAk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628009272; 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=dshJSEW20h2WpWAzDXik92mwNLxRZ9tHpLvx5G30qI4=; b=CDnnmYigTpqpxFt9OVolJZFzhLZkPgFwib7rWNdigrTZdhgEHz0T7H1sWwa58038pDg/x1KI60733wV+j3rTws6r/3F1C/NdettmjyuZmwW1Pf93TcqHMjurV9uD8ypXpwhnW32rKAaHew6iQFzWgRMvcaFNZgmj7bpnIPt2iVA= 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 1628009272255602.6164242303801; Tue, 3 Aug 2021 09:47:52 -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-272-guHpkY3VMP2DQRipqDMFig-1; Tue, 03 Aug 2021 12:47:31 -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 A87BB1853040; Tue, 3 Aug 2021 16:47:25 +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 87D6A60CA1; Tue, 3 Aug 2021 16:47:25 +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 4DEEE5003B; Tue, 3 Aug 2021 16:47:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 173EU76v005598 for ; Tue, 3 Aug 2021 10:30:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id A11AD1036D27; Tue, 3 Aug 2021 14:30:07 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 197A910631FD for ; Tue, 3 Aug 2021 14:30:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628009271; 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=dshJSEW20h2WpWAzDXik92mwNLxRZ9tHpLvx5G30qI4=; b=Ls4wrBleu4y1o1AuZGcydIjApVJhSRD8mSC7exrpdeYVbjI49PBFxQ+Z5rKr+lmHNzcVQC B3uydgWLHYkoBG8hSI6IgDrC/xtJdkXdCRWm/8D0ApN7Zc3SOhx9hdiA5wvhpBcM24e4xE Tpe7VtJGsGOUOvllpjqij+EVsj4l0vU= X-MC-Unique: guHpkY3VMP2DQRipqDMFig-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 1/3] vircgroup: introduce virCgroupGetInode function Date: Tue, 3 Aug 2021 16:29:31 +0200 Message-Id: <6d91fab8e578316dcdb96b44c3674ad6dc1cee1c.1628000893.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1628009274233100001 Content-Type: text/plain; charset="utf-8" For new feature Fibre Channel VMID we will need to get inode of the VM root cgroup as it is used in the new kernel API together with VMID. Signed-off-by: Pavel Hrdina Reviewed-by still applies. Reviewed-by: Michal Privoznik --- src/libvirt_private.syms | 1 + src/util/vircgroup.c | 37 +++++++++++++++++++++++++++++++++++++ src/util/vircgroup.h | 2 ++ 3 files changed, 40 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 6961cdb137..d8451fcfff 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1920,6 +1920,7 @@ virCgroupGetCpuShares; virCgroupGetDevicePermsString; virCgroupGetDomainTotalCpuStats; virCgroupGetFreezerState; +virCgroupGetInode; virCgroupGetMemoryHardLimit; virCgroupGetMemorySoftLimit; virCgroupGetMemoryStat; diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 1b3b28342e..ea702e7b63 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -3973,3 +3973,40 @@ virCgroupGetCpuPeriodQuota(virCgroup *cgroup, unsign= ed long long *period, =20 return 0; } + + +/** + * virCgroupGetInode: + * + * @cgroup: the cgroup to get inode for + * + * Get the @cgroup inode and return its value to the caller. + * + * Returns inode on success, -1 on error with error message reported. + */ +int +virCgroupGetInode(virCgroup *cgroup) +{ + VIR_AUTOCLOSE fd =3D 0; + struct stat st; + int controller =3D virCgroupGetAnyController(cgroup); + g_autofree char *path =3D NULL; + + if (controller < 0) + return -1; + + if (virCgroupPathOfController(cgroup, controller, "", &path) < 0) + return -1; + + if ((fd =3D open(path, O_RDONLY | O_NONBLOCK)) < 0) { + virReportSystemError(errno, _("failed to open cgroup '%s'"), path); + return -1; + } + + if (fstat(fd, &st) < 0) { + virReportSystemError(errno, _("failed to get fstat for '%s'"), pat= h); + return -1; + } + + return st.st_ino; +} diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h index 8002cac570..690f09465c 100644 --- a/src/util/vircgroup.h +++ b/src/util/vircgroup.h @@ -283,3 +283,5 @@ int virCgroupSetOwner(virCgroup *cgroup, int virCgroupHasEmptyTasks(virCgroup *cgroup, int controller); =20 bool virCgroupControllerAvailable(int controller); + +int virCgroupGetInode(virCgroup *cgroup); --=20 2.31.1 From nobody Tue Apr 30 17:22:41 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=1628009340; cv=none; d=zohomail.com; s=zohoarc; b=T8o09ji5fCsm02zeD92Ivonc2QYiDHKaFSH5cKvmN1PxYqACnLf2Vxx+MvhoqCq0eIm+rWfCIw07mDuVk1EBwTO2Ae8O5d8Ph+To+hDfImZqXWt6NF3gHXALOT6TAP7Z/R+LA0uoyQCftJ9gOOhOpU0Al6L6XYAUGtysXgjmMu0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628009340; 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=fK1T0Y3F3a58qzlrDICLmo0s6L32YWCdQ0pnRR1Gyy4=; b=P64VSlmF/1SbxTRObpIfkzhQ9lHDg6ZFMk2vwyeanymVKYsCGU3SI001Sc1g2iqoxnRCBCCvDvviy9DFV0E5B4b29U/19FSCYEVvJAGg6Ft6JV80EfNUI4G7OjYz/EpR8xKBQ2rZZwPZR/HjM2Ar/Wfmhut262jzMb+3Pe1QP1Q= 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 1628009340117485.81543559991167; Tue, 3 Aug 2021 09:49:00 -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-277-gY9pKEBZNxqaaF2oyViJXQ-1; Tue, 03 Aug 2021 12:47: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 069C493943; Tue, 3 Aug 2021 16:47:23 +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 B3ABB175B6; Tue, 3 Aug 2021 16:47:22 +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 6BA47181A601; Tue, 3 Aug 2021 16:47:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 173EU81O005603 for ; Tue, 3 Aug 2021 10:30:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8820A10074E1; Tue, 3 Aug 2021 14:30:08 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0459C10016F7 for ; Tue, 3 Aug 2021 14:30:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628009339; 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=fK1T0Y3F3a58qzlrDICLmo0s6L32YWCdQ0pnRR1Gyy4=; b=JTyXFUqMQdqQegBODwlZMGw6jI6O0zbVWtsJK+eMSoBfVUYucWhZueTr8sb/Dlg/sLA6AT jss7ldd48bYlBNzYCPP/lLZZNMAEeD+jxIL4g80Yq7VQDnx8yB73Br3cAPzKEGwnxd4ii3 bZsymUsus5EgLNftosLOoJZ6aAjboTE= X-MC-Unique: gY9pKEBZNxqaaF2oyViJXQ-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 2/3] conf: introduce support for Fibre Channel VMID Date: Tue, 3 Aug 2021 16:29:32 +0200 Message-Id: <76387240b8c8eaf0b2c547bb842257baad9aefd8.1628000893.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1628009342057100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina Reviewed-by: Michal Privoznik --- docs/formatdomain.rst | 13 +++++++++++++ docs/schemas/domaincommon.rng | 11 +++++++++++ src/conf/domain_conf.c | 5 +++++ src/conf/domain_conf.h | 2 ++ src/conf/domain_validate.c | 19 +++++++++++++++++++ tests/genericxml2xmlindata/vmid.xml | 19 +++++++++++++++++++ tests/genericxml2xmltest.c | 2 ++ 7 files changed, 71 insertions(+) create mode 100644 tests/genericxml2xmlindata/vmid.xml diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 61ccd8895a..f6a1885acf 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -2232,6 +2232,19 @@ event name Description ``emulation_faults`` the count of emulation faults, that is when th= e kernel traps on unimplemented instrucions and emulates them for user spac= e, by applications running on the platform ``perf.emula= tion_faults`` =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 +Fibre Channel VMID +------------------- + +The FC SAN can provide various QOS levels, access control depending on the +VMID. Also it can collect telemetry data at per-VM level which can be used +to enhance the IO performance of the VM. This can be configured by using +the ``vmid`` element. The element contains single string (max 128 bytes). + +Using this feature requires Fibre Channel capable HW, kernel compiled with +option ``CONFIG_BLK_CGROUP_FC_APPID`` and ``nvme_fc`` kernel module loaded. +:since:`Since 7.7.0` + + :anchor:`` =20 Devices diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 2442078969..d2e6039c76 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -62,6 +62,9 @@ + + + @@ -576,6 +579,14 @@ =20 + + + + .{1,128} + + + +