From nobody Mon Feb 9 00:30:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1685705318; cv=none; d=zohomail.com; s=zohoarc; b=T+OObmq5Ct1wAtbuRNss9pQrEbvzH2mHt+Qs1t/unS47eFmzvbt/U/MCQdl/D9tLLj9UDn2tXeQKjpV9nZuETrH+Cegu4oE+1+lSA2ej0LezalF0hM5WmiUXk34vm40hBJVnEnsUjwYHhF3+w1kJGx+FMqSAZZJlXRb6f+bWBrc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685705318; 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=PnhugTYum9M03OAiT/Fxn/kWCJ5DBMM3URTWSGmfvLA=; b=bmLcEaldIlTl76DMUFMZ6z0yqnQrotFtzmftpkxENrGEzV0dwnV1m0Q8KI0/+Re3TtN/Jeu0JgBwbq/ohp88kxr+Wf1fCgMbDoDgi8U/m02qiY0ykFdKdJ1MgnhdAkeDVmervM19t2ETbI2eQFlmCrwFLY2kFgIyW5gNpbyTGUA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1685705318481776.7386296150511; Fri, 2 Jun 2023 04:28:38 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-25-xPcoe6lrMdW6q7VJqJ7tEQ-1; Fri, 02 Jun 2023 07:28:35 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EF6D3185A7A7; Fri, 2 Jun 2023 11:28:31 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58C5740D1B60; Fri, 2 Jun 2023 11:28:31 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5AD2419465A0; Fri, 2 Jun 2023 11:28:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8586D194658C for ; Fri, 2 Jun 2023 11:28:28 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 68CBB8162; Fri, 2 Jun 2023 11:28:28 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id E60CC9E60 for ; Fri, 2 Jun 2023 11:28:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685705317; 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=PnhugTYum9M03OAiT/Fxn/kWCJ5DBMM3URTWSGmfvLA=; b=G+XVruAnamQJMR+5YdotE6g8IESvrKx8oQGlKFYSkFO3lLfSj4qPZsq1BVfarvITzUEytu PJqu8plyd0Ox0dHTE/Z5HYXdSSrKKcr52tXvwg12EPpDe9o0I57qreFcIYAmUkrft2axEk crxkMnymx7df0mYLblapO/nLILsHn4w= X-MC-Unique: xPcoe6lrMdW6q7VJqJ7tEQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 02/15] virNetDevBandwidthParse: Use 'virXMLPropUInt' to parse 'classID' Date: Fri, 2 Jun 2023 13:28:12 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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: 1685705320121100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa --- src/conf/netdev_bandwidth_conf.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/conf/netdev_bandwidth_conf.c b/src/conf/netdev_bandwidth_c= onf.c index 48be9d2f38..2ac1983dce 100644 --- a/src/conf/netdev_bandwidth_conf.c +++ b/src/conf/netdev_bandwidth_conf.c @@ -108,24 +108,24 @@ virNetDevBandwidthParse(virNetDevBandwidth **bandwidt= h, g_autoptr(virNetDevBandwidth) def =3D NULL; xmlNodePtr cur; xmlNodePtr in =3D NULL, out =3D NULL; - g_autofree char *class_id_prop =3D NULL; + unsigned int class_id_value; + int rc; def =3D g_new0(virNetDevBandwidth, 1); - class_id_prop =3D virXMLPropString(node, "classID"); - if (class_id_prop) { + + if ((rc =3D virXMLPropUInt(node, "classID", 10, VIR_XML_PROP_NONE, &cl= ass_id_value)) < 0) + return -1; + + if (rc =3D=3D 1) { if (!class_id) { virReportError(VIR_ERR_XML_DETAIL, "%s", _("classID attribute not supported on " "in this usage context")); return -1; } - if (virStrToLong_ui(class_id_prop, NULL, 10, class_id) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to parse class id '%1$s'"), - class_id_prop); - return -1; - } + + *class_id =3D class_id_value; } cur =3D node->children; --=20 2.40.1