From nobody Mon Feb 9 03:14:47 2026 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=1642498327; cv=none; d=zohomail.com; s=zohoarc; b=BOH00cbKWiZ7uuqupOHeR33v1Vx4q07F4LcwMlDdimAGU2ZX51pQZxaT2ui1vIc41xK2AYWy5ZNsc0olJEth0EqP9uIAjPkj3wlyjRjkjbeyRLxf9+KBMSzl5FniE0y+yQxSskfXt0QXO6O0QTUQCpHQP65L2FZ5Q6XT+cLwejU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642498327; 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=S1e6GM4+Kbp5BkEOKA3L3bxdrIQToTsDnv2RmztrXww=; b=Jv9KgT9OrEQh+HsTltGYMb21E8UewvIkMhjaDK3Pk24nOagQ1h5nrSAdUugXzVV717JWbO/bl/8FX9inYCB4a09S77/XnDN8ZTVC5OAexsrqFxmpqzTllD0/2HnZsR/gZ/JvXhvndJgOIhbYrSbWyA0UBMkFWP3Kmn+OsWWiXOs= 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 1642498327902481.04229124704284; Tue, 18 Jan 2022 01:32:07 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-520-uyVfzsrAMpy6OfmJRAS-Eg-1; Tue, 18 Jan 2022 04:32:05 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3D3B38143EA; Tue, 18 Jan 2022 09:32:00 +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 DC8B355F6F; Tue, 18 Jan 2022 09:31:59 +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 B4E6C4CA93; Tue, 18 Jan 2022 09:31:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20I9VuOS022977 for ; Tue, 18 Jan 2022 04:31:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3F51D1F2FB; Tue, 18 Jan 2022 09:31:56 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F86D1F2F6 for ; Tue, 18 Jan 2022 09:31:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642498326; 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=S1e6GM4+Kbp5BkEOKA3L3bxdrIQToTsDnv2RmztrXww=; b=bQOlTXCnxJQUa9uScgvFxybUwJWFn3AK8EjOhgJpXbm3rS7RDhorMpw2mCANmtK+1sxP9Y uH6KWyPJObEQwTgybKP/9EeY010EkEwaPbyWmzoM+uJavJi4CQ8LOHM7QWmYqG0CuCqzR9 sYB5VVGPtFGOD9wtaxL0HBqatRvmfEk= X-MC-Unique: uyVfzsrAMpy6OfmJRAS-Eg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/2] qemuDomainPinIOThread: Copy the cpu bitmap instead of re-parsing it Date: Tue, 18 Jan 2022 10:31:45 +0100 Message-Id: <137a4d7b44bb3694bcd30128b76728c1d50dcc04.1642498278.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.13 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: 1642498328854100001 Content-Type: text/plain; charset="utf-8" The bitmap recorded in the live/persistent definition was re-parsed two more times. We can copy it which is cheaper and less verbose. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e150b86cef..077547e1d3 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5011,7 +5011,6 @@ qemuDomainPinIOThread(virDomainPtr dom, if (def) { virDomainIOThreadIDDef *iothrid; - virBitmap *cpumask; if (!(iothrid =3D virDomainIOThreadIDFind(def, iothread_id))) { virReportError(VIR_ERR_INVALID_ARG, @@ -5019,11 +5018,8 @@ qemuDomainPinIOThread(virDomainPtr dom, goto endjob; } - if (!(cpumask =3D virBitmapNewData(cpumap, maplen))) - goto endjob; - virBitmapFree(iothrid->cpumask); - iothrid->cpumask =3D cpumask; + iothrid->cpumask =3D virBitmapNewCopy(pcpumap); iothrid->autofill =3D false; /* Configure the corresponding cpuset cgroup before set affinity. = */ @@ -5060,7 +5056,6 @@ qemuDomainPinIOThread(virDomainPtr dom, if (persistentDef) { virDomainIOThreadIDDef *iothrid; - virBitmap *cpumask; if (!(iothrid =3D virDomainIOThreadIDFind(persistentDef, iothread_= id))) { virReportError(VIR_ERR_INVALID_ARG, @@ -5068,11 +5063,8 @@ qemuDomainPinIOThread(virDomainPtr dom, goto endjob; } - if (!(cpumask =3D virBitmapNewData(cpumap, maplen))) - goto endjob; - virBitmapFree(iothrid->cpumask); - iothrid->cpumask =3D cpumask; + iothrid->cpumask =3D virBitmapNewCopy(pcpumap); iothrid->autofill =3D false; ret =3D virDomainDefSave(persistentDef, driver->xmlopt, cfg->confi= gDir); --=20 2.34.1