From nobody Tue Oct 22 22:17:38 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=1694699875; cv=none; d=zohomail.com; s=zohoarc; b=LhS44WOJ44bAbJ8o4nFk21cHevM+jgIiliTlNTIL/0YpTvT9dUrB3yXAvSgJr9YeKoXtmGzSbPiqbS2V7sp6qof8xXlAJR7KlEbQUhz9Utm/Fsm6ov7RCA7/z0LU7lJ08BDqO0uxWqCS2UVHOUU8kGGVa205QFZGK95Wk7PX/64= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694699875; 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=g/+aRJ6xyqMPw7bji8yxzEyKXB2S8+NI2Ck6nfqKtCc=; b=dOuvDgN6sBXWaGBT0qDA1qqaMWDemU+mmwU7f11OZXY5UZgU2vbtlZpYlg4BQ0C7B1nJZn366HJhMrmsWUXQrwQ+ytTroTp9pLXFQs6bTsTL1fdrLQxh8alBN1CfeEkfHJ9U/DqyJDKPReLC34l/OxIo2/ma4u/1nK+6ArDyS3A= 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 1694699875849920.5684975102512; Thu, 14 Sep 2023 06:57:55 -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-634-rrBfKkthNFW1OBI0-ijVuQ-1; Thu, 14 Sep 2023 09:57:51 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8743D9291E4; Thu, 14 Sep 2023 13:57:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 724CA2026D4B; Thu, 14 Sep 2023 13:57:48 +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 0C6021949742; Thu, 14 Sep 2023 13:56:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4826D19465B8 for ; Thu, 14 Sep 2023 13:56:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 441A540C6EA8; Thu, 14 Sep 2023 13:56:37 +0000 (UTC) Received: from maggie.brq.redhat.com (unknown [10.43.2.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id DFFFA40C6ECD for ; Thu, 14 Sep 2023 13:56:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694699874; 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=g/+aRJ6xyqMPw7bji8yxzEyKXB2S8+NI2Ck6nfqKtCc=; b=MxOt0CsQaHA8s0k93XQhLoEbdL4HfigasHDCOEC1RNECbj1f13TkNrObJoF8krbbygDv0P BRIYF/mOy5NNPB0hJEQjV3Q/bLb6MaLah1k+hbBz3gUoHpt1zl8jnqinfPoMQL46kJCaiW 6NF0D3qWcVzGzlqqGYGfVPtFf+t8ff8= X-MC-Unique: rrBfKkthNFW1OBI0-ijVuQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 20/20] virDomainDiskSourceNVMeParse: Use virXMLPropULongLong() Date: Thu, 14 Sep 2023 15:56:21 +0200 Message-ID: <91793103c6534392f5eea70e230beb7d4be7be3a.1694699683.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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.4 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: 1694699876983100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Inside of virDomainDiskSourceNVMeParse() we have virXMLPropString() + virStrToLong_ull() combo. Switch to virXMLPropULongLong() which does the same thing. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5f4146b4e3..0efac66f61 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7229,7 +7229,6 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node, { g_autoptr(virStorageSourceNVMeDef) nvme =3D NULL; g_autofree char *type =3D NULL; - g_autofree char *namespc =3D NULL; xmlNodePtr address; =20 nvme =3D g_new0(virStorageSourceNVMeDef, 1); @@ -7247,16 +7246,9 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node, return -1; } =20 - if (!(namespc =3D virXMLPropString(node, "namespace"))) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("missing 'namespace' attribute to disk source")); - return -1; - } - - if (virStrToLong_ull(namespc, NULL, 10, &nvme->namespc) < 0) { - virReportError(VIR_ERR_XML_ERROR, - _("malformed namespace '%1$s'"), - namespc); + if (virXMLPropULongLong(node, "namespace", 10, + VIR_XML_PROP_REQUIRED, + &nvme->namespc) < 0) { return -1; } =20 --=20 2.41.0