From nobody Fri May 3 00:24:55 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=1629196724; cv=none; d=zohomail.com; s=zohoarc; b=KVhf+XGa8ECIx+p8mqyiDa+u8FGvPSWT/G8gkhvTWMwSZMgn357tMOAKm6W/eE5AsAug2RprjLJcQ4SPhqJ59EFN3h4DwccLeFmVAg9GJeZvyJ5y/jgA+JXQI8WdKj15d3AopU9uK9EKDvzdZCapK+u7NIUvCBQlknLCadXLst8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629196724; 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=Rne3uganSeKU7lUWaFb5PRUBeY3AH+4A/X469JBd3HM=; b=jdg8MhQGFQDO73VRZI0mTVfWedZUgOsVHkczbe3Ie5vq0CFVJkfzju4XlUKzZeqcriE6ZGVMb66I7cbRiNlwriO34lk3i05JAPC0npzd3Ho0eMsHTZ2014rG4Qbu+ePWUfAVshmD1rB6yCWsnTHpOMP0kxZtrULx6lLcDL/2EqQ= 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 1629196724880253.9592552146703; Tue, 17 Aug 2021 03:38:44 -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-247-058CARxCMTeQ2zIJX3cx4w-1; Tue, 17 Aug 2021 06:38:42 -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 53D07195D564; Tue, 17 Aug 2021 10:38:36 +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 07F885D9CA; Tue, 17 Aug 2021 10:38:35 +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 508A3181A3ED; Tue, 17 Aug 2021 10:38:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17HAcHnA002692 for ; Tue, 17 Aug 2021 06:38:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0DECD5C232; Tue, 17 Aug 2021 10:38:17 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7EF605C1D5 for ; Tue, 17 Aug 2021 10:38:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629196723; 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=Rne3uganSeKU7lUWaFb5PRUBeY3AH+4A/X469JBd3HM=; b=LicRFQaboe4Pa6oSn6Q7X+nkiebXhj0kNsDQ818gOEIz2qgkvNyUvjBy63+NPR1JtWmhOu QZwvYf91f24nSQDRxIHTGIRS3FoV4e2gRQK8J4wYvArDyK3DVxMHCycY1SewSdFsTHqP4V 5gx//kquSTDjhC/3KTGkEiIqdP/0qw4= X-MC-Unique: 058CARxCMTeQ2zIJX3cx4w-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v4 1/5] vircgroup: introduce virCgroupGetInode function Date: Tue, 17 Aug 2021 12:38:06 +0200 Message-Id: <10c2c0b249627360966bab1bd06d8bdbe9f9be8e.1629196554.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: 1629196726389100001 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: Martin Kletzander --- src/libvirt_private.syms | 1 + src/util/vircgroup.c | 31 +++++++++++++++++++++++++++++++ src/util/vircgroup.h | 2 ++ 3 files changed, 34 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 51a400ba59..fcb02c21b1 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1922,6 +1922,7 @@ virCgroupGetCpuShares; virCgroupGetDevicePermsString; virCgroupGetDomainTotalCpuStats; virCgroupGetFreezerState; +virCgroupGetInode; virCgroupGetMemoryHardLimit; virCgroupGetMemorySoftLimit; virCgroupGetMemoryStat; diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 1b3b28342e..4c9445340e 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -3973,3 +3973,34 @@ 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) +{ + 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 (stat(path, &st) < 0) { + virReportSystemError(errno, _("failed to get stat for '%s'"), path= ); + 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 Fri May 3 00:24:55 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=1629196915; cv=none; d=zohomail.com; s=zohoarc; b=WitXeNx1Ji34UaAfPgwwANxnUw/YdOgfXtHVInFN13rTR2laYq6kK5n2+JDvbQCDJtSQtGF5zhBG9fIebH/tQqsTX/FJu9ZBhJRCfpyGMMVV4ANtmd64qUSJXsjIZ3PiEguj6CJMx16JeFUX29yIJKnYdJ6/JL8lDUqpI1S0meA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629196915; 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=MquQ19ABRVnxm2/b8PULTZN8uolamvVPCQFkXaFgDRw=; b=a2Td7YCAFN15rzxoh987WI7HwRZGjGtXPjx4EYqb7ZOa3ZXW2eVJrmYnOYPYK2dP/TupoLyXJ9kGVhdnrdX4f3mlFZbShm3jB1EChlOncl0soMR5LVbpWdOjgtjRegL0lmxI/hoCIBgHA50WIfMGnBZbwEyTOokGFZ2pn7nut8k= 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 1629196915008825.5335835737721; Tue, 17 Aug 2021 03:41:55 -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-504-AZU5Jzw0PmyodQVSy3vh-A-1; Tue, 17 Aug 2021 06:41:52 -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 2ECBB344AF; Tue, 17 Aug 2021 10:41:47 +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 1006B60C0F; Tue, 17 Aug 2021 10:41:47 +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 D0E0F181A3F0; Tue, 17 Aug 2021 10:41:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17HAcHMV002711 for ; Tue, 17 Aug 2021 06:38:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id E11AA5C232; Tue, 17 Aug 2021 10:38:17 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 60ED15C1D5 for ; Tue, 17 Aug 2021 10:38:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629196913; 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=MquQ19ABRVnxm2/b8PULTZN8uolamvVPCQFkXaFgDRw=; b=DmmbH4xSRi6tkbX0VxlEvtoH1u2z+/a65uZiCVzEC7ps9AvMmdtwMwjmo3Qg7RYUNVqIYD gFQF3PBpppP5ekGq75skGRJaH74VbNoL/jYWWiXzzEk/cyAJeSpF6UL+TjPwwXBsWYdV6x cU8qkd5x/ICcgEZcfP9W4TAToQ6bUrE= X-MC-Unique: AZU5Jzw0PmyodQVSy3vh-A-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v4 2/5] conf: refactor virDomainResourceDefParse Date: Tue, 17 Aug 2021 12:38:07 +0200 Message-Id: <77b53057c7f8e9a147e748bce2ed867d298f881f.1629196554.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: 1629196917244100001 Content-Type: text/plain; charset="utf-8" There is no need to error out for empty element as we can just simply ignore it. This allows to simplify the function and prepare it for new sub-elements of . It makes the element optional so we need to reflect the change in schema as well. Signed-off-by: Pavel Hrdina Reviewed-by: Martin Kletzander --- docs/schemas/domaincommon.rng | 8 +++++--- src/conf/domain_conf.c | 18 +++++++----------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 2442078969..9b669d9de5 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1172,9 +1172,11 @@ =20 - - - + + + + + =20 diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e9bdbbfd74..7dff6c8beb 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -17284,23 +17284,19 @@ virDomainResourceDefParse(xmlNodePtr node, { VIR_XPATH_NODE_AUTORESTORE(ctxt) virDomainResourceDef *def =3D NULL; + char *partition =3D NULL; =20 ctxt->node =3D node; =20 + partition =3D virXPathString("string(./partition)", ctxt); + + if (!partition) + return NULL; + def =3D g_new0(virDomainResourceDef, 1); - - /* Find out what type of virtualization to use */ - if (!(def->partition =3D virXPathString("string(./partition)", ctxt)))= { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("missing resource partition attribute")); - goto error; - } + def->partition =3D partition; =20 return def; - - error: - virDomainResourceDefFree(def); - return NULL; } =20 =20 --=20 2.31.1 From nobody Fri May 3 00:24:55 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=1629196917; cv=none; d=zohomail.com; s=zohoarc; b=hlhBRf765iClVTEN4lWV6fmJPF1P0TMZlHxZ0ZgyKcqufuTnB2Kl3+cadVpLRtCTIxwbbve1d8nezBAv7S/QBkV8K4KIxw0nfWrC4/OXJmAzF5IUyCGGdYhr+HYL2ZZkYDxtPBZPqhUDH01EEB3HsmFxpSy3zXA4nFYFvHpHM80= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629196917; 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=gmfw8rHLo5aAUVCfvmAh0dqiseuVhoVrL5Aw/CHyZ3c=; b=GGFUXt5jWDbND7hES+L3Fq9TTadIufo1dzZeEzx2oBDemnSNQsZiTAolr5Z7eAXbyQyMgnTigQnZ8H+cIb/0VTMdUA2LdE7kteVJVc1tr3TNeLUYfKdoJBEog9TxNAo4aNIkNcutmm2ZIiidjbNx10r15tJnTWi0xTcf/hvj8v8= 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 1629196917921170.50331164055376; Tue, 17 Aug 2021 03:41:57 -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-480-Fb5aPwWYPMKyrkSErpnRLQ-1; Tue, 17 Aug 2021 06:41:54 -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 1D3901082927; Tue, 17 Aug 2021 10:41:50 +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 F14F060C81; Tue, 17 Aug 2021 10:41:49 +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 C16FF4A7C9; Tue, 17 Aug 2021 10:41:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17HAcIsB002729 for ; Tue, 17 Aug 2021 06:38:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id C17035C232; Tue, 17 Aug 2021 10:38:18 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4115A5C1D5 for ; Tue, 17 Aug 2021 10:38:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629196916; 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=gmfw8rHLo5aAUVCfvmAh0dqiseuVhoVrL5Aw/CHyZ3c=; b=D5CuDGk70FxSI72Mf1WnrfUxRe4D58f7zLrXbpTnHxgkdTG4M7TeBmLFz1kdhBRULXMRoh METGY3JuJ7rz6KaKl2C9pPPmW/9HwEIngZNcM9A8prNind3oxO9GPv3EFlLtz24TTK+Azd QhHjx3GLijlZoQXoFxKIejRqJl2PBpg= X-MC-Unique: Fb5aPwWYPMKyrkSErpnRLQ-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v4 3/5] conf: refactor virDomainResourceDefFormat Date: Tue, 17 Aug 2021 12:38:08 +0200 Message-Id: <9ea9f7dab2bcedd16c88437955b7a39b41e1f390.1629196554.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: 1629196919490100001 Content-Type: text/plain; charset="utf-8" Prepare the function for additional sub-elements where all of the sub-elements are optional. Signed-off-by: Pavel Hrdina Reviewed-by: Martin Kletzander --- src/conf/domain_conf.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7dff6c8beb..571650bfd3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -26761,11 +26761,15 @@ static void virDomainResourceDefFormat(virBuffer *buf, virDomainResourceDef *def) { - virBufferAddLit(buf, "\n"); - virBufferAdjustIndent(buf, 2); - virBufferEscapeString(buf, "%s\n", def->partiti= on); - virBufferAdjustIndent(buf, -2); - virBufferAddLit(buf, "\n"); + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); + + if (!def) + return; + + if (def->partition) + virBufferEscapeString(&childBuf, "%s\n", de= f->partition); + + virXMLFormatElement(buf, "resource", NULL, &childBuf); } =20 =20 @@ -27918,8 +27922,7 @@ virDomainDefFormatInternalSetRootName(virDomainDef = *def, if (virDomainNumatuneFormatXML(buf, def->numa) < 0) return -1; =20 - if (def->resource) - virDomainResourceDefFormat(buf, def->resource); + virDomainResourceDefFormat(buf, def->resource); =20 for (i =3D 0; i < def->nsysinfo; i++) { if (virSysinfoFormat(buf, def->sysinfo[i]) < 0) --=20 2.31.1 From nobody Fri May 3 00:24:55 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=1629196920; cv=none; d=zohomail.com; s=zohoarc; b=RLGecfEQV7cxCQ+8DvZvY3NZS7yCPzGeZ8CasCBqokUfzKohb8QOLfXpM7HQnwfl0pLcela8n7cruKGc6mTdalRKAwU80iRRA3cwPTKInBRyMemyIJQ9DIeZWNylJxfbMeUikc4gGg9343GHbt5/FzVkOjpdCBPP5A+miRWAxyA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629196920; 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=1xRgFnlt/J47J9RNvFfMVW8KzzLXeMmZbDNvF+KxaO0=; b=niGugb30M+6ywwCgVCRiuleDflV3mWvBnmG3a2m+PWSAlsAcKVUBKXRV7ubPEOEOFDJUh9+z8jfldZzdpljmnsE5vxFZDT/6Uf82RFtPERazkYKCi4FvZsMHTBoCCVX/K3gBJqdzXGAnqouPBeRbm4mtTnNK8czgQdpm8No4IvA= 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 1629196920937977.0981568321645; Tue, 17 Aug 2021 03:42: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-459-_vv-X8brMOWp1RecApgyAA-1; Tue, 17 Aug 2021 06:41:58 -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 28D82802947; Tue, 17 Aug 2021 10:41:53 +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 F301F6A8FA; Tue, 17 Aug 2021 10:41:52 +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 BEA1A4A7CD; Tue, 17 Aug 2021 10:41:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17HAcJlZ002772 for ; Tue, 17 Aug 2021 06:38:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id A356D5C232; Tue, 17 Aug 2021 10:38:19 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 207655C1D5 for ; Tue, 17 Aug 2021 10:38:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629196919; 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=1xRgFnlt/J47J9RNvFfMVW8KzzLXeMmZbDNvF+KxaO0=; b=KXybj29cxihzY/oKLmQa4OjJbXzuVj/9DT91mTgwrHKn25cIONExzKPbKUAlcvEgZQQkav KZ61QJAPUOQvgWI+1RJsalPf9VgzXJyIGoVfbCu8gxYycY0HKOgSDWjH0scxoXxGlE5Zi/ KxI9Vu1uymWjmtKIuP3RQDNyu6FCG20= X-MC-Unique: _vv-X8brMOWp1RecApgyAA-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v4 4/5] conf: introduce support for Fibre Channel VMID Date: Tue, 17 Aug 2021 12:38:09 +0200 Message-Id: <05c4f80cf51250be5cb2c484475a3aadc205b85e.1629196554.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629196921927100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina Reviewed-by: Martin Kletzander --- docs/formatdomain.rst | 21 ++++++++++++ docs/schemas/domaincommon.rng | 14 ++++++++ src/conf/domain_conf.c | 9 ++++- src/conf/domain_conf.h | 1 + src/conf/domain_validate.c | 34 +++++++++++++++++++ .../fibrechannel-appid.xml | 21 ++++++++++++ tests/genericxml2xmltest.c | 2 ++ 7 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 tests/genericxml2xmlindata/fibrechannel-appid.xml diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 61ccd8895a..512e6abd27 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1221,6 +1221,27 @@ Resource partitions are currently supported by the Q= EMU and LXC drivers, which map partition paths to cgroups directories, in all mounted controllers. :since:`Since 1.0.5` =20 +Fibre Channel VMID +------------------- + +The FC SAN can provide various QoS levels and access control depending on = the +VMID. It can also 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 ``appid`` attribute of ``fibrechannel`` element. The attribute contains +single string (max 128 bytes) and it is used by kernel to create VMID. + +:: + + ... + + + + ... + +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 CPU model and topology diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 9b669d9de5..11fa24f398 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -576,6 +576,17 @@ =20 + + + + + + [ -~]{1,128} + + + + +