From nobody Sun Feb 8 17:41:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1600884937; cv=none; d=zohomail.com; s=zohoarc; b=VkUZuk5nW4BWRZvM3wttUv+rwQ786DkxP3q4U/FGgKVX7fPhjtR+Rxv4nCnTjXjdDKGj5lN2ityREILxk3Y+rna/rtky3733Twt5Diesc8ugQ0PxXAvX2ayrvJAH30XhIOIlsmuKQAQJxwb4Kiuk/q24Csf86EgUeDrVmvpxzRw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600884937; 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=ueNriNEQEZMMK53R/D2DNJDPwAS2JIX23Mm6Q0VMSIw=; b=HkHejnKEHQ70NsBMcSsfyQALi3eXRxrEM7qbsTMceQnQOBqaiXk6QBw/JiiBM2cgNlLOMcpMqPP8aQGg8jzSj6sf4o+pjK3eGOxiAhzzpoAvWbuf2FCd6foVtQ0J2mVETpKa1m9SXbvrkbXI4Uw90REo6sRfk0yE2DBlVWRy/eM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1600884937305420.37504798757925; Wed, 23 Sep 2020 11:15:37 -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-280-vWpuqcwNObuZ3Bz0unGeQw-1; Wed, 23 Sep 2020 14:15:33 -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 9A60FD6448; Wed, 23 Sep 2020 18:15:27 +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 7872F5D993; Wed, 23 Sep 2020 18:15:27 +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 44E118C7AA; Wed, 23 Sep 2020 18:15:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08NIFErv018064 for ; Wed, 23 Sep 2020 14:15:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4CF9478822; Wed, 23 Sep 2020 18:15:14 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id C858678816 for ; Wed, 23 Sep 2020 18:15:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600884936; 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=ueNriNEQEZMMK53R/D2DNJDPwAS2JIX23Mm6Q0VMSIw=; b=G2bVKp1rZEDM4qSy8NxYsJID3fa+giKTRqi/JJWGaoXxQXf5dqwrDeZvzHdPn3StsSicfj Y3S/QNndyKsPTNYipw0c86szU446GtS4oMMtZW6f1exfVljk+Ui50BFNY68OruXUsv5Hyw MXkp4hiOBPo7MsHVPSdj9NFd4ownZ60= X-MC-Unique: vWpuqcwNObuZ3Bz0unGeQw-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 07/14] Do not check whether unsigned variables are negative Date: Wed, 23 Sep 2020 20:14:56 +0200 Message-Id: <426d370875c4160f4d8bb96d833d45b803443ea4.1600884543.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Martin Kletzander --- src/openvz/openvz_driver.c | 2 +- src/vbox/vbox_common.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 71e270ea09..74d87b1085 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -1215,7 +1215,7 @@ static int openvzDomainSetVcpusFlags(virDomainPtr dom= , unsigned int nvcpus, if (!(vm =3D openvzDomObjFromDomain(driver, dom->uuid))) return -1; =20 - if (nvcpus <=3D 0) { + if (nvcpus =3D=3D 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Number of vCPUs should be >=3D 1")); goto cleanup; diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 2783827012..b9b72e2e02 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -2111,7 +2111,7 @@ vboxStartMachine(virDomainPtr dom, int maxDomID, IMac= hine *machine, vboxIID *iid VBOX_UTF16_TO_UTF8(valueDisplayUtf16, &valueDisplayUtf8); VBOX_UTF16_FREE(valueDisplayUtf16); =20 - if (strlen(valueDisplayUtf8) <=3D 0) + if (strlen(valueDisplayUtf8) =3D=3D 0) VBOX_UTF8_FREE(valueDisplayUtf8); } =20 @@ -2990,7 +2990,7 @@ vboxHostDeviceGetXMLDesc(vboxDriverPtr data, virDomai= nDefPtr def, IMachine *mach gVBoxAPI.UArray.vboxArrayGet(&deviceFilters, USBCommon, gVBoxAPI.UArray.handleUSBGetDeviceFilters= (USBCommon)); =20 - if (deviceFilters.count <=3D 0) + if (deviceFilters.count =3D=3D 0) goto release_filters; =20 /* check if the filters are active and then only @@ -3612,9 +3612,8 @@ vboxDumpSharedFolders(virDomainDefPtr def, vboxDriver= Ptr data, IMachine *machine gVBoxAPI.UArray.vboxArrayGet(&sharedFolders, machine, gVBoxAPI.UArray.handleMachineGetSharedFol= ders(machine)); =20 - if (sharedFolders.count <=3D 0) { - if (sharedFolders.count =3D=3D 0) - ret =3D 0; + if (sharedFolders.count =3D=3D 0) { + ret =3D 0; goto cleanup; } =20 --=20 2.26.2