From nobody Wed May 1 15:06:37 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=1629192418; cv=none; d=zohomail.com; s=zohoarc; b=lFXNY9yi8om6D2M8qmpyq92BEIu1abGJPL0lT+DHl3tISYsWUsHlnphSopMquV0/8AnW8VsrnaNls4/d5jrxnTZJXxEB/2V76PJO+riRDPEU2oqlIuMV0J14o03WsH3YvHTXqdZkrGCsWcPhhfD3hS1n8CBDxgOe8dkQ0nNV+EU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629192418; 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=N+xP5f1uxsGmG65O0iG6/HRBU2VwVRWVW2WCS+KSNvw=; b=nYToM6bmv1BkFwLpt1OeUff/mJZnd/RZl9PhfRsiErEhStXWOdUk9IEyePz41NtiIV5e3ajoknALZzddqF0E8Ymxx9MzySJG5uIzfoLRqiHcgwOWhKtKrJUoQHTLO2skOEq3HAYh/mscRKqBIxD8gCVeDF4IGLjXUA+cAnAPAtk= 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 1629192418480850.767484775077; Tue, 17 Aug 2021 02:26:58 -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-323--JtjikyHOeiTx_5jduJ48A-1; Tue, 17 Aug 2021 05:26:56 -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 E96BB8799EC; Tue, 17 Aug 2021 09:26:50 +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 C9A161899A; Tue, 17 Aug 2021 09:26:50 +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 42A1E181A2A8; Tue, 17 Aug 2021 09:26:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17H9Qm3K025099 for ; Tue, 17 Aug 2021 05:26:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id ACF213A47; Tue, 17 Aug 2021 09:26:48 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C07B5D6A8 for ; Tue, 17 Aug 2021 09:26:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629192417; 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=N+xP5f1uxsGmG65O0iG6/HRBU2VwVRWVW2WCS+KSNvw=; b=B9GEzTZAdogIbQ6TdUTh1CNVJONsY3OhcbowhGIOZedhRuDmtyR+06H9zoz3BWwIvpEBij KMpeUQdPX/Gm692Fmox4XD8JQTvcKICoHSGHouqLaTxYyzKPSXDOEnWY4/ATQ4kvXVtwHq g3ozfSglqbmpG6Nw+qxipcAI0tYPYGU= X-MC-Unique: -JtjikyHOeiTx_5jduJ48A-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v3 1/5] vircgroup: introduce virCgroupGetInode function Date: Tue, 17 Aug 2021 11:26:38 +0200 Message-Id: <94829d6975134701163f0fa558d38a71f590170a.1629192298.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629192418830100002 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 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 Wed May 1 15:06:37 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=1629192426; cv=none; d=zohomail.com; s=zohoarc; b=mdCTYU1Ab5D0NOkpWUFGEDt8/8r+U55Tjxps5qdivsAEAj02eoFyYlgCHE8thDpVzvoV4XK8Mev7a7zoPiF5MshHPhUZ33GXltr0jrenRdAumAhXjZI6j48SlUm6QJxUYuG5wb50yH9KMUw1SVo44eI7HQRv8bu1UqOgcyOm5A0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629192426; 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=97vMB4cJeG3iBGy33QjyXIQv41WMQDOcMdHTKdMPh2Y=; b=KIK8Jfsf13uZkbULUauhrbgbGbCGV+i52/Q9TWQ2qQMNCoZ4xOxHHs9d0jHgy2v9s0d88AXlwiDbGkPuLiS/nu0NycWwnm+bb6J8V5zfoJJ6YHJSaPmtNFD/AcgTt9xiapNTv9U4Tu4Thu5wpBar5a6w2ydEhIj9K4rxfmQgQHo= 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 1629192426506901.9483222885942; Tue, 17 Aug 2021 02:27:06 -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-95-xb92utciOUSUmn6jhR8rtg-1; Tue, 17 Aug 2021 05:27:03 -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 CEF9F108292B; Tue, 17 Aug 2021 09:26: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 AA83F5D6A8; Tue, 17 Aug 2021 09:26: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 4772A4A7C8; Tue, 17 Aug 2021 09:26:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17H9QnaO025112 for ; Tue, 17 Aug 2021 05:26:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8D50B3A47; Tue, 17 Aug 2021 09:26:49 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C4F55D6A8 for ; Tue, 17 Aug 2021 09:26:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629192425; 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=97vMB4cJeG3iBGy33QjyXIQv41WMQDOcMdHTKdMPh2Y=; b=Y2fEwK7UrafwxGS3/2gXZdVCBWWik/w1nx0YcUfZPlaAOGzLdjj4xiakeJ/30WU+dDNnfs LgH8feH4lw07NScx4JmseN/WMMwTiJFdOXgp+IBfoQYY52gZcJZ4AX5LbKj43ECdThK8CM rlHfCwQNr/Cj8/Sos0zNEkSgOc2C7N8= X-MC-Unique: xb92utciOUSUmn6jhR8rtg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v3 2/5] conf: refactor virDomainResourceDefParse Date: Tue, 17 Aug 2021 11:26:39 +0200 Message-Id: <177af52d05042d6469b3532dd76fc21d333e27dc.1629192298.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1629192427353100001 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 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 Wed May 1 15:06:37 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=1629192430; cv=none; d=zohomail.com; s=zohoarc; b=b1GOwP7Mi2Z0GxYHK1F6q7D1mSCHaFj+RR8OCfo2xGkPQLeMujIYzYYPur/qZHdr9Ynz1i9pEebB7X1xfoH0Tviwf++SYR0jqHE37DKBPhBv1OoyhtKH2VV4K7MQ6rh/GSUqivxHCw8tP+xk2aAf30vZYd2Gwdmpy2gfMj1mo64= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629192430; 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=FX4y/VBEwmGRbu6UmRcYtjZlpDIOQzy0D6gkaZk802A=; b=Ud6KBTJny8tJxIB1ifo9QjrBB92btPlNE5SEdoAosgec7F0QowQhEZHNAlrGPRQC9gfyZDGpha78c4jVa9woue27Zezsol5ICSBOD5SiIBV5wJJVofhGpcGFI+fEVpw0A2NHWoXJI93S1ui9hxOeWLGwegB3Gjyms7+nWz2EPXs= 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 1629192430073792.0097514300904; Tue, 17 Aug 2021 02:27:10 -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-UdYDmcGXOoKNoEI7vL-wHw-1; Tue, 17 Aug 2021 05:27:07 -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 BB465189CD05; Tue, 17 Aug 2021 09:27:02 +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 9C86360FB8; Tue, 17 Aug 2021 09:27:02 +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 64F2F181A2AD; Tue, 17 Aug 2021 09:27:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17H9QoCa025120 for ; Tue, 17 Aug 2021 05:26:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6E5B93A47; Tue, 17 Aug 2021 09:26:50 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id E0B875D6A8 for ; Tue, 17 Aug 2021 09:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629192429; 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=FX4y/VBEwmGRbu6UmRcYtjZlpDIOQzy0D6gkaZk802A=; b=hFdZCjp0bZ3osUL/+9hHYs0h4C4dUa63+VqXVQPWDmZcCJpFqDEeu1QiA31TkHCnylXWyv XqxRWffVQIcsvsEa0LM3aCZz3gEN2eQ0hylJI3PeEtkw6uaM1VivTbuyyNQpBrfs+YJ8lO mLA8LdKHURmRUO9EU+jqhRY6iJ2G7sw= X-MC-Unique: UdYDmcGXOoKNoEI7vL-wHw-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v3 3/5] conf: refactor virDomainResourceDefFormat Date: Tue, 17 Aug 2021 11:26:40 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1629192431630100005 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 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 Wed May 1 15:06:37 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=1629192428; cv=none; d=zohomail.com; s=zohoarc; b=KZZUiQY6vKfxOWJxY7s89HrCY3GpivJdr4smZFhqdGSsKOs+DQ4bPiPTYAxuCo05C2k/e9AP4RD+D/UJE+j3vYjdBRyYRZpYV7H31zw4fH4cdB+px/2BHY23I31YuJpYDbwj+N7HylhQIp/QWbYCWdVG9FBJsx4qf629+xx/AZU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629192428; 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=sv7t7TSWO8EaICh1wSU/P22HekKUuL3zp4uYqLifA4E=; b=nQ2gcNsKOWDqhLWryyY+TMQ8v4DdmE1x15yhJjFMPCGNaJnWnZnwUWmAPSxox/Ronc9w3Vkdsla3LJGlSJKaqBg7kJjkHdbp68zkiX2Fd5U1Aq2nqTtHTxvWBajEStwg2koixBN0XYEHd5+IS2Wn4Y7lRtKukvlq6EzPq4SCblI= 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 1629192428114130.2719348888727; Tue, 17 Aug 2021 02:27: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-482-P8IgOdiQOEeBhrHcYrOoYA-1; Tue, 17 Aug 2021 05:27:05 -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 A4D16A0BE5; Tue, 17 Aug 2021 09:27:00 +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 7C10D5DA2D; Tue, 17 Aug 2021 09:27:00 +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 41496181A2AA; Tue, 17 Aug 2021 09:27:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17H9QpIr025127 for ; Tue, 17 Aug 2021 05:26:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 51CAB3A47; Tue, 17 Aug 2021 09:26:51 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id C2A895D6A8 for ; Tue, 17 Aug 2021 09:26:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629192427; 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=sv7t7TSWO8EaICh1wSU/P22HekKUuL3zp4uYqLifA4E=; b=CQRuiEeOT7xS0nxAg5gAS5sMS3YtYbWPmRzjL8ro/Xcz4HAc1Q9ZO/BbjJIoAjg8A3+ePW 62Pq4gbn4NGuwpCQMfeQsnUMbDkGSB8w3DV4crg6UqMqCjxKH4hDJGbF/j3TV4AmNjG0MH gxShp6ZNbastWpo5ZxF/ybGXJo4J908= X-MC-Unique: P8IgOdiQOEeBhrHcYrOoYA-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v3 4/5] conf: introduce support for Fibre Channel VMID Date: Tue, 17 Aug 2021 11:26:41 +0200 Message-Id: <6ad33ee795123fdabc4c3a7f9ffca09e8a540fae.1629192298.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1629192429437100003 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-appid.xml | 21 +++++++++++++++++++ tests/genericxml2xmltest.c | 2 ++ 7 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 tests/genericxml2xmlindata/fibrechannel-appid.xml diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 61ccd8895a..881a75df87 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 ``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..b32fb8c04c 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -576,6 +576,16 @@ =20 + + + + + .{1,128} + + + + +