From nobody Sun May 5 08:37:50 2024 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=1652861840; cv=none; d=zohomail.com; s=zohoarc; b=MZsLQa1wGMLNtGU2Ydi4rmYNO9VawyVn4wYEyxfAYwNw6KWcUGoU2fFsvei4jUcMOA2hsgKQ8Q4wZ7q8fHU3Z4VuISdo32CjdlxRYsb8/C3/xRdQkz/Y80uEssOZSliNU69r8SvoseGsRMd8AXDaTAdhNlJhnPVPSIxs6UwH2l8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652861840; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=tviIQccfyda2sr1NPGoVN4FbTh2zDbP9Gwk5UJqQnNM=; b=fOjOscVds+112+67tT8BalDUsKQnLwdU75Y/yAJRt+kwACVa0lMy+By7ahPEottuxTWjauu1dpGts92I+slVuzFgYFK47mzXsKhiDsqDlVaNZwN8mpID8mF3rOktZhhuf/sf1/R7GGyXMYAWCBiPHroYPbS5rXc3eOx0Iktl2+k= 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 1652861840544417.0332259945445; Wed, 18 May 2022 01:17:20 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-507-5iv2P2hCMz64wtSiLdArZQ-1; Wed, 18 May 2022 04:17:14 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D9C831C0896C; Wed, 18 May 2022 08:08:30 +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 68A317774; Wed, 18 May 2022 08:08:30 +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 1FA741947B8E; Wed, 18 May 2022 08:08: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 7A0F01947B84 for ; Wed, 18 May 2022 08:08:29 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 524657774; Wed, 18 May 2022 08:08:29 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.187]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 329577AE4 for ; Wed, 18 May 2022 08:08:26 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 197FD2445E9; Wed, 18 May 2022 10:08:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652861839; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=tviIQccfyda2sr1NPGoVN4FbTh2zDbP9Gwk5UJqQnNM=; b=S962lTPVWfp5V/aj38JJ80eczso+Ygi+qhaayuOleaKjA2HIDYYZISVTmxBhZTme7mZHxE nM6XioCZiMlwxGmonPzp7Uxk+0PogQApFJAhlE3KnxTFo6wvIFNLAmQbvLNvQ5eWHw8SlD kmOatyT/R08eauE213DdguW0JAU6/uA= X-MC-Unique: 5iv2P2hCMz64wtSiLdArZQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH] util: Do not report useless error in virPortAllocatorRelease Date: Wed, 18 May 2022 10:08:23 +0200 Message-Id: <19562943bd4ecaf5bf38db577b86c83fca6f2346.1652861303.git.jdenemar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 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 2.79 on 10.11.54.5 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: 1652861841042100001 Content-Type: text/plain; charset="utf-8" If the port allocator bitmap does not have enough bits to keep the state of the port we're going to release, the port is not reserved and thus is trivially released without doing anything. No need to report an error in such case. Signed-off-by: Jiri Denemark Reviewed-by: Pavel Hrdina --- src/util/virportallocator.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/util/virportallocator.c b/src/util/virportallocator.c index 44edd8f99a..97ab362749 100644 --- a/src/util/virportallocator.c +++ b/src/util/virportallocator.c @@ -254,12 +254,7 @@ virPortAllocatorRelease(unsigned short port) return 0; =20 VIR_WITH_OBJECT_LOCK_GUARD(pa) { - if (virBitmapClearBit(pa->bitmap, port) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to release port %d"), - port); - return -1; - } + ignore_value(virBitmapClearBit(pa->bitmap, port)); } =20 return 0; --=20 2.35.1