From nobody Mon May 6 23:11:44 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=1628171947; cv=none; d=zohomail.com; s=zohoarc; b=nE7tstGHGL7mRLqve6ychCA6v8m6qf3gVwT67uvZFuRbL5pbr1s3bneMt3KIJt7gCGf2ArOE29w8SfrNY0eJ6Dpcf+xfjt8F1y1sDeKtIenW3sc5kSqm59w9cbxyrjLwVK44OYL2j0LbrSGGzy4ps1Kk8AVuscbQnMMnBtnsTB4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628171947; 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=Dzsn9Dn9KFp6k7QPAafZ2uEMzRpFO7kOO+MXYadQyhE=; b=Ik62gJCiR4VhBKYhZyfWDE7rCGiLCaCjmc18yuIzTtBE0D2A2RDgg9ek7mhL1WEru09pVyKorHkCKhLVdVjh9MRXDyyXpij58RgoCMz/awdeuInptqLs06ncC9JHf+oMMzcqSZsgN4yKtYrLr48Rt7LCEfCfpOhO8639eqHS4Vw= 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 1628171947923942.0466590282452; Thu, 5 Aug 2021 06:59:07 -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-442-AZiLqpt3NKiu15eqKcmpdA-1; Thu, 05 Aug 2021 09:58:54 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B92BB190D340; Thu, 5 Aug 2021 13:58:49 +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 858065C25D; Thu, 5 Aug 2021 13:58: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 608044BB7C; Thu, 5 Aug 2021 13:58:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 175DuGAn014628 for ; Thu, 5 Aug 2021 09:56:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id A485078C1B; Thu, 5 Aug 2021 13:56:15 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9EF578DD4 for ; Thu, 5 Aug 2021 13:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628171947; 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=Dzsn9Dn9KFp6k7QPAafZ2uEMzRpFO7kOO+MXYadQyhE=; b=YkWRlbCbUG9vooT9tipjgWoE0TS6GSmEkkaV9ppUNfUyB35GEGYv5/gNaLJYA4cHYiZs05 J3FJxMTBVVbJh/Zw3kPJ1i5gd6C1mhXKHRCxjV80maWK6rWwu9+c9ajozexnjTwAGRPnzV dgoY825QcWNioJpV6HVUWmiBBIDJUo8= X-MC-Unique: AZiLqpt3NKiu15eqKcmpdA-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v2 1/5] vircgroup: introduce virCgroupGetInode function Date: Thu, 5 Aug 2021 15:56:05 +0200 Message-Id: <8fc03bcd26082721a73f2ed3bdc65cc41b05538a.1628171661.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.16 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: 1628171948909100001 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 --- 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 aed40977b3..c2321aba70 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..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 Mon May 6 23:11:44 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=1628171937; cv=none; d=zohomail.com; s=zohoarc; b=QPnzNWjmXFvnYGRTwEiisHnNA5jgMNv7y543VrDkZNUqxknauA0JoMVWsVvPvearQxGDiED0dHNlpgiCXWuAXvQcd+M7j4w34+L3tw5UEoZ9s+p5v9GWbQH7cRpssnxjGlo9ag/Shy2vccqzmMmUAOoWCKeaIVR0R0NhfKgelww= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628171937; 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=050uGlFznncvaE7tt5vGDG4+ZfSgfTN90/yXXY4Sjco=; b=Uuq1Sxt5mHTBWMl+niDhEHG4T7bqxy60pFBmMBbDmlTJN3OU5Ne+EZbFidSovUhE+YyN76FYvitYBOomEj2ObQgl8Ei9JkDyZiROQDllk5kGB49ny34RfpAi//MFMchwHqBBjgnVkcQNBd1xzXqQIZMnaG/TJewMnQG5qcOZAGE= 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 1628171937808548.306299613151; Thu, 5 Aug 2021 06:58: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-281-_Ks4WRWRPmaKlq7kYGEeCA-1; Thu, 05 Aug 2021 09:58:55 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D466F190D341; Thu, 5 Aug 2021 13:58:49 +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 891345C1D0; Thu, 5 Aug 2021 13:58: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 7D45A181A3ED; Thu, 5 Aug 2021 13:58:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 175DuIpd014638 for ; Thu, 5 Aug 2021 09:56:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4C8347CD65; Thu, 5 Aug 2021 13:56:18 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 409C87B9DA for ; Thu, 5 Aug 2021 13:56:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628171936; 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=050uGlFznncvaE7tt5vGDG4+ZfSgfTN90/yXXY4Sjco=; b=KLZL+QEwlqu3uIBM06KpCcqrhsoD4wcciqF+AbcdsO0VoMQGwC/sQO1n5MEA5pQodJxA7D PruF3nbbRbDRmPkuZZhuEjQjzoWbnzsdLApQMKV/PiCq0Gb0CV6sO7YFWma9J4S8JzU5Gw yIudRj+93Wr1Z4hqaxARyhCL/IEgBvA= X-MC-Unique: _Ks4WRWRPmaKlq7kYGEeCA-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v2 2/5] conf: refactor virDomainResourceDefParse Date: Thu, 5 Aug 2021 15:56:06 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.16 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: 1628171939756100002 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 --- 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 09da4ab952..de38dd7110 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -17292,23 +17292,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 Mon May 6 23:11:44 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=1628171937; cv=none; d=zohomail.com; s=zohoarc; b=F8Vk0bFUwzjLBPqB7d/X8GBUKgcTvmHPRAPA5RFK0FAYxoN3aglllq6hjGQcpyns3/T9oYguhKVGvTh1SS2gLeNQkYnTGFTL1ioK2CDdxmiOZwHC5yu6+I3Zh8MnokPZftvxXjfCQkKI6jDQLzpa57gKTcGh5YKG0NWqQiVkA8E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628171937; 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=n8hWUuHgPXcvxSFZm0D0XuOVGwrASBcxN/dg+rPpYko=; b=W0nOic907lZsAk/Ypp767HP0G/4S74na6AWXYa5IG6fR55/78h1DJQuNcnr+cnBGcjAju5kaC0lulyIUR5YdSklMjOLYZrEUuy9QVrsWDzP8xlULsQL4hlYFfglZQBj82pYaPFcEQAUgOc5cXzCAbTzap4rnNQDq6ZDejVpuq3o= 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 1628171937982155.71637418841442; Thu, 5 Aug 2021 06:58: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-442-wgOJvvbfN4OjCtMMmIXofg-1; Thu, 05 Aug 2021 09:58: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 CDB98100F764; Thu, 5 Aug 2021 13:58:49 +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 9630C60BF4; Thu, 5 Aug 2021 13:58: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 E2098181A3F0; Thu, 5 Aug 2021 13:58:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 175DuKHY014644 for ; Thu, 5 Aug 2021 09:56:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 69AE960BF4; Thu, 5 Aug 2021 13:56:20 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61ACF7E12E for ; Thu, 5 Aug 2021 13:56:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628171936; 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=n8hWUuHgPXcvxSFZm0D0XuOVGwrASBcxN/dg+rPpYko=; b=YvF1zzg6lO1mdm9YivSfWPRvQ6iNjUCfWkMW4sARPjUw1DYO7+KFiobqC0uXt63ol1yyWv QwygmSzVhO78LQYCyJ5oHWQYzR31dXG+mK9NuyVF78XgBwFo8xHJzN98f9TYY65Rkeuhg0 OKqGIgoFDZNnTl70JCjcTCJDYwVH2R0= X-MC-Unique: wgOJvvbfN4OjCtMMmIXofg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v2 3/5] conf: refactor virDomainResourceDefFormat Date: Thu, 5 Aug 2021 15:56:07 +0200 Message-Id: <873856d3fabd1c51d7da905d51217eba6fe2e300.1628171661.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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: 1628171939755100001 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 --- 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 de38dd7110..d33d708189 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -26794,11 +26794,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 @@ -27951,8 +27955,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 Mon May 6 23:11:44 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=1628171951; cv=none; d=zohomail.com; s=zohoarc; b=FIU2TsgvypeqsqjyxhRONNTsUZ57uKJyzL3ydXVXMMyBxS+D0zkeaQLxFWpCkhsr0REArmKYzaNzw7YQIkOW6Ag23XqGBDOMGUq86ZbKLzpQK0WQKkSu9xyyR/KLmwzVEB/721dK/UFPb/62OpUUGqbx159XmhTEUkIbWflr1G0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628171951; 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=0Ica831bnIHQKBbve0U3TUC702P2V/cO6Fzj7LibO0c=; b=lknyKRoAM71r7HwVfuWHXxf1hD3b/TVJsINBy8T+2UltFSqR2LhT+PotMdeJN5+N1NBfKbXSvQRhMJJPiTibKrVUmXi9WVz+C0QEBTfW9/4nPmmK3oj5a5Qxj2WZFO6UFRU8ck/7qf8pf2jyaqsXoDw1vGeLYPeTbMXIn+qmW5I= 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 1628171951266683.3515695731691; Thu, 5 Aug 2021 06:59: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-21-H3sCwP5HO6-kU_-GDs2NTA-1; Thu, 05 Aug 2021 09:59:04 -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 E6BB81006C8B; Thu, 5 Aug 2021 13:58:55 +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 C56475D9DD; Thu, 5 Aug 2021 13:58:55 +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 91BE64A7C9; Thu, 5 Aug 2021 13:58:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 175DuMLa014650 for ; Thu, 5 Aug 2021 09:56:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 333C160CA1; Thu, 5 Aug 2021 13:56:22 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3EFC060BF4 for ; Thu, 5 Aug 2021 13:56:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628171950; 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=0Ica831bnIHQKBbve0U3TUC702P2V/cO6Fzj7LibO0c=; b=EWtbs9IkOp6wU/39NVRlZWl9yVLqUxCTMO7ox0FuWdNT7S2lhUVf74zrZEXEGKIpgl/WHX oljsgBPWBgcbhvsqfIJ9lCoKxx96usYJ0rf4wOUzdo3h9dkWQE01dgJ43b8FmonNuBt3CT LyvlxM/AYR6La8iLxXPF5PLJpFBAm4Q= X-MC-Unique: H3sCwP5HO6-kU_-GDs2NTA-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v2 4/5] conf: introduce support for Fibre Channel VMID Date: Thu, 5 Aug 2021 15:56:08 +0200 Message-Id: <7eb04c4b057381ef2c50a26e328fc80c0142d1b6.1628171661.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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: 1628171953437100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- docs/formatdomain.rst | 21 +++++++++++++++++++ docs/schemas/domaincommon.rng | 13 ++++++++++++ src/conf/domain_conf.c | 9 +++++++- src/conf/domain_conf.h | 1 + src/conf/domain_validate.c | 19 +++++++++++++++++ .../fibrechannel-vmid.xml | 21 +++++++++++++++++++ tests/genericxml2xmltest.c | 2 ++ 7 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 tests/genericxml2xmlindata/fibrechannel-vmid.xml diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 61ccd8895a..f9ea2de59c 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, 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`` attribute of ``fibrechannel`` element. The attribute 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 CPU model and topology diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 9b669d9de5..1087269fc7 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -576,6 +576,16 @@ =20 + + + + + .{1,128} + + + + +