From nobody Mon Feb 9 09:15:34 2026 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=1647961563; cv=none; d=zohomail.com; s=zohoarc; b=Zfpc/tUIgG+1arS8wPzEXhX4bRYzuZXSe0AYJHH+3gpaQvAb7QzdimNel7LOSwTMPT3gWuiPC0gcGUggoPD1e0eHY15MVUXzoVXMUOrEQnC8mo2lYdeTEh59TbdoJQW50IYrmny2Xo7Ob+ERCgtm0pHYItIOvGpOuK2A0O8tHUU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647961563; 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=JqltoGJRX+2MSwmF0XTLKRFwD7gu13wJPhM6SKICSMA=; b=B2aBouvUGU650IN+llsTbZ4GPLbz2t0fsg0ZQp1TYfh1pRUFq0D/R2UI21NxUFKJXWeM0K0XZcdZX5e/wUB2a8QN3Kxh+qE6bqapVQs/iBmon/ElQRg+z+3i6n98n5oHNRQ81wxYiwsGW2jt8s1jRoP2O68sZXH11nDC9ttoKOE= 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 16479615638711018.585406471929; Tue, 22 Mar 2022 08:06:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-610-qxClyOBpMmCZ1Zxt_yy43Q-1; Tue, 22 Mar 2022 11:05:35 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 17E3110666A2; Tue, 22 Mar 2022 15:05:25 +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 F2EABC27EB0; Tue, 22 Mar 2022 15:05:24 +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 91E651940340; Tue, 22 Mar 2022 15:05:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6FDF11947BBC for ; Tue, 22 Mar 2022 15:05:22 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4375E401E80; Tue, 22 Mar 2022 15:05:22 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id E03DD401052 for ; Tue, 22 Mar 2022 15:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647961562; 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=JqltoGJRX+2MSwmF0XTLKRFwD7gu13wJPhM6SKICSMA=; b=Ee6FAyJsHIXx/WIEG34GICRPH3p4+HuLgJhF4QOK6J8vvXYLQIRdJIvWiouZTGtZvtGJcv NvRk/68I+m8mQQTdkVbafaED1QHlxIk72czYEBXPcuoa1lpmlzsUzqLp8Qayssi8u2GnC3 404fJ3XfIdgXeMYiNBXkX5dtTwEl/lA= X-MC-Unique: qxClyOBpMmCZ1Zxt_yy43Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 4/4] qemu_command: Generate prealloc-threads property Date: Tue, 22 Mar 2022 16:05:17 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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.85 on 10.11.54.8 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: 1647961565464100001 Content-Type: text/plain; charset="utf-8" Let's generate prealloc-threads property onto the cmd line if domain configuration requests so. Signed-off-by: Michal Privoznik Reviewed-by: Martin Kletzander --- src/qemu/qemu_command.c | 5 ++++- tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c836799888..8246ab515a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3806,7 +3806,10 @@ qemuBuildMemoryBackendProps(virJSONValue **backendPr= ops, return -1; } else { if (!priv->memPrealloc && - virJSONValueObjectAdd(&props, "B:prealloc", prealloc, NULL) < = 0) + virJSONValueObjectAdd(&props, + "B:prealloc", prealloc, + "p:prealloc-threads", def->mem.allocatio= n_threads, + NULL) < 0) return -1; } =20 diff --git a/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args b/= tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args index 6f5a983d3a..68bbd73551 100644 --- a/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args +++ b/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args @@ -16,7 +16,7 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-instance-00000092/.c= onfig \ -m size=3D14680064k,slots=3D16,maxmem=3D1099511627776k \ -overcommit mem-lock=3Doff \ -smp 8,sockets=3D1,dies=3D1,cores=3D8,threads=3D1 \ --object '{"qom-type":"memory-backend-memfd","id":"ram-node0","hugetlb":tru= e,"hugetlbsize":2097152,"share":true,"prealloc":true,"size":15032385536,"ho= st-nodes":[3],"policy":"preferred"}' \ +-object '{"qom-type":"memory-backend-memfd","id":"ram-node0","hugetlb":tru= e,"hugetlbsize":2097152,"share":true,"prealloc":true,"prealloc-threads":8,"= size":15032385536,"host-nodes":[3],"policy":"preferred"}' \ -numa node,nodeid=3D0,cpus=3D0-7,memdev=3Dram-node0 \ -uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \ -display none \ @@ -29,7 +29,7 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-instance-00000092/.c= onfig \ -no-acpi \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/= tmp/nvdimm","share":true,"prealloc":true,"size":536870912,"host-nodes":[3],= "policy":"preferred"}' \ +-object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/= tmp/nvdimm","share":true,"prealloc":true,"prealloc-threads":8,"size":536870= 912,"host-nodes":[3],"policy":"preferred"}' \ -device '{"driver":"nvdimm","node":0,"memdev":"memnvdimm0","id":"nvdimm0",= "slot":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","add= r":"0x3"}' \ --=20 2.34.1