From nobody Mon Feb 9 00:56:16 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=1601628986; cv=none; d=zohomail.com; s=zohoarc; b=bFEMTrngyHpPbU1UqtxcxnpJwyaV6mU/KRzDD+Ui7Pa1fg7aHLmjwrjBKk2sG0UntqjrJQWQcIUFwLWTOf8dJv9a7jLCvufb6bq8zYelr7+Jih4dxuAEORaaqFYT58OCVAvgP5cxVVEwHKJCXLBnUye+htky6mqi+jg8Go6Tli0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601628986; 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=OWRyGtpwv2pJs6o8M8XEQolPevd6q4k9NsSI6dzeEf4=; b=bNfRrhzUpdC2bA+XhRoJ4NKbQrs3PQqPlL9T3gde6WQlqGkjrAruIMMRRs7BCCpX1ZYgGn18/s0Swrg0I0p0O/rS4jIHZs3UVzliDhJqZLDU4nAC+3gtMJhKEBRhzV2mjagJ6COBPIn0+PNLq+2d18qZe5Tn4ErKnblf2qLxFJQ= 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 1601628986424407.61203760073613; Fri, 2 Oct 2020 01:56:26 -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-286-B0OwtMIdM_2drz7GGgO4dw-1; Fri, 02 Oct 2020 04:56:23 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 506871019635; Fri, 2 Oct 2020 08:56:15 +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 29BDD19931; Fri, 2 Oct 2020 08:56:15 +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 E69B744A5E; Fri, 2 Oct 2020 08:56:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0928uAQh014688 for ; Fri, 2 Oct 2020 04:56:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id F12B75C1D7; Fri, 2 Oct 2020 08:56:10 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49B3B5C1D0 for ; Fri, 2 Oct 2020 08:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601628985; 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=OWRyGtpwv2pJs6o8M8XEQolPevd6q4k9NsSI6dzeEf4=; b=Ti9I1QkbgMu3YmnDiVpsHALs9MoCqavG9Qx9AaT5OSzok6IV1kOfJQn5YVvnx5ME+929xm XxYacmea0dCmX9+vjLQjHbyugMYyRUaKKONmJHeeIfHDeJPRW4dJ85lttKC9GpsB9xARhB nP/pk24GFoEJ8Rhc4M6quhrio7HuH+s= X-MC-Unique: B0OwtMIdM_2drz7GGgO4dw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/6] Use 'virBitmapNewCopy' instead of 'virBitmapCopy' Date: Fri, 2 Oct 2020 10:55:59 +0200 Message-Id: <9331caba899751ab638278ad64168ddd4781a5be.1601628908.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.84 on 10.5.11.23 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" There are only 3 places using the function. Two can use virBitmapNewCopy directly. In case of the qemu capabilities code we need to free the old bitmap first. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/capabilities.c | 3 +-- src/qemu/qemu_capabilities.c | 3 ++- src/util/virresctrl.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index da2633761d..0ba7323ee8 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -1589,8 +1589,7 @@ virCapabilitiesHostNUMAInitFake(virCapsHostNUMAPtr ca= ps) cpus[cid].die_id =3D 0; cpus[cid].socket_id =3D s; cpus[cid].core_id =3D c; - cpus[cid].siblings =3D virBitmapNew(ncpus); - virBitmapCopy(cpus[cid].siblings, siblings); + cpus[cid].siblings =3D virBitmapNewCopy(siblings); cid++; } diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e3a934363b..29cb78a388 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1932,7 +1932,8 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemu= Caps) ret->ctime =3D qemuCaps->ctime; - virBitmapCopy(ret->flags, qemuCaps->flags); + virBitmapFree(ret->flags); + ret->flags =3D virBitmapNewCopy(qemuCaps->flags); ret->version =3D qemuCaps->version; ret->kvmVersion =3D qemuCaps->kvmVersion; diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index dabfa9990e..aea3fe8687 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -1158,9 +1158,9 @@ virResctrlAllocUpdateMask(virResctrlAllocPtr alloc, return -1; if (!a_type->masks[cache]) - a_type->masks[cache] =3D virBitmapNew(virBitmapSize(mask)); + a_type->masks[cache] =3D virBitmapNewCopy(mask); - return virBitmapCopy(a_type->masks[cache], mask); + return 0; } --=20 2.26.2