From nobody Sun Feb 8 17:41:24 2026 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=1618988599; cv=none; d=zohomail.com; s=zohoarc; b=IrXBq06lU7QMza3esN/LpcfIppQQQHS/p0UeF9RK8iwSMAGQKJOj3pFzGgGhhHL4kyy39O/OtOp1Lb2Lq9jwx9FGKYO4g53fWxmU5NVFWJfJgkFUlWnl0iOhQd5z3jAZUYJ1rf7QSKGsGETimVs2QmUAl2Ckh2ozrsVd9sY0bV0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618988599; 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=3v6Z428diWHhubjUDbFf3iJ4ru3zqeuUm7u5kbpAlK8=; b=cOvAgPMZ4jVRVhwGSdT3uPQ9i2AFI/ftHXlGKu4o7gl/n0vQTEpw0dbbWeX5nfm9WdMjMGO4KcbM03e76CkBdoEXU4kOWxJNJWSnlQ4WT5+xoT+to+F1du2WqsRKlpUMcVGpGOVLVQGgZPz5ZvFLfddG0B0HqtMW4SszZaBdELw= 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) header.from= 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 1618988599338110.1820531505; Wed, 21 Apr 2021 00:03:19 -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-525-jh7RMZzNMsmH38rNC7M6IQ-1; Wed, 21 Apr 2021 03:03:15 -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 143446D257; Wed, 21 Apr 2021 07:03:09 +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 205A55D6A1; Wed, 21 Apr 2021 07:03:07 +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 6AB6544A5B; Wed, 21 Apr 2021 07:03:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13L6xi7W009253 for ; Wed, 21 Apr 2021 02:59:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4FF3210016FD; Wed, 21 Apr 2021 06:59:44 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC82D10016F4 for ; Wed, 21 Apr 2021 06:59:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618988598; 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=3v6Z428diWHhubjUDbFf3iJ4ru3zqeuUm7u5kbpAlK8=; b=G9qcn2fFdv65EmMrcrx9fJNxmX/OeMNB5D0sYBVGSTtefPF+MkYLXBM2VVWUwx02xO58aT wYHQvDr5UcXSNqwhhZle2sm1Tov+q6saDTO61GZkNUam2DEL3gqmk+RHD6W+zjtMVR/HXK wwTZBb17y/w+NTrGypklG7u5oo0DpY8= X-MC-Unique: jh7RMZzNMsmH38rNC7M6IQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/2] util: xml: Remove VIR_XML_PROP_WRAPNEGATIVE Date: Wed, 21 Apr 2021 08:59:37 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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) Content-Type: text/plain; charset="utf-8" As I've pointed out in my review, the negative number wrapping for unsigned variables is an anti-feature which should not be promoted in any way. Remove VIR_XML_PROP_WRAPNEGATIVE which would make it more accessible. Signed-off-by: Peter Krempa --- src/util/virxml.c | 6 +----- src/util/virxml.h | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/util/virxml.c b/src/util/virxml.c index d0d9494009..bfb4005e62 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -734,11 +734,7 @@ virXMLPropUInt(xmlNodePtr node, return -1; } - if (flags & VIR_XML_PROP_WRAPNEGATIVE) { - ret =3D virStrToLong_ui(tmp, NULL, base, &val); - } else { - ret =3D virStrToLong_uip(tmp, NULL, base, &val); - } + ret =3D virStrToLong_uip(tmp, NULL, base, &val); if (ret < 0) { virReportError(VIR_ERR_XML_ERROR, diff --git a/src/util/virxml.h b/src/util/virxml.h index 2b40398eee..a8f088fb43 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -38,7 +38,6 @@ typedef enum { VIR_XML_PROP_OPTIONAL =3D 0, /* Attribute may be absent */ VIR_XML_PROP_REQUIRED =3D 1 << 0, /* Attribute may not be absent */ VIR_XML_PROP_NONZERO =3D 1 << 1, /* Attribute may not be zero */ - VIR_XML_PROP_WRAPNEGATIVE =3D 1 << 2, /* Wrap around negative values */ } virXMLPropFlags; --=20 2.30.2