render / rpms / libvirt

Forked from rpms/libvirt 7 months ago
Clone
486963
From 73439e9284f4c7101721ee081d5ca6249d284ed0 Mon Sep 17 00:00:00 2001
486963
Message-Id: <73439e9284f4c7101721ee081d5ca6249d284ed0@dist-git>
486963
From: Michal Privoznik <mprivozn@redhat.com>
486963
Date: Mon, 21 Mar 2022 17:10:15 +0100
486963
Subject: [PATCH] qemu_command: Generate prealloc-threads property
486963
486963
Let's generate prealloc-threads property onto the cmd line if
486963
domain configuration requests so.
486963
486963
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
486963
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
486963
(cherry picked from commit b8d6ecc70c8a8e9c90bab48b6829b42d8b77c748)
486963
486963
Conflicts:
486963
tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args:
486963
Upstream has moved some cmd line arguments
486963
(v8.0.0-260-gaf23241cfe) but that is not backported.
486963
486963
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2075628
486963
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
486963
---
486963
 src/qemu/qemu_command.c                                     | 5 ++++-
486963
 tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args | 4 ++--
486963
 2 files changed, 6 insertions(+), 3 deletions(-)
486963
486963
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
486963
index ee0e611513..9166317895 100644
486963
--- a/src/qemu/qemu_command.c
486963
+++ b/src/qemu/qemu_command.c
486963
@@ -3856,7 +3856,10 @@ qemuBuildMemoryBackendProps(virJSONValue **backendProps,
486963
             return -1;
486963
     } else {
486963
         if (!priv->memPrealloc &&
486963
-            virJSONValueObjectAdd(&props, "B:prealloc", prealloc, NULL) < 0)
486963
+            virJSONValueObjectAdd(&props,
486963
+                                  "B:prealloc", prealloc,
486963
+                                  "p:prealloc-threads", def->mem.allocation_threads,
486963
+                                  NULL) < 0)
486963
             return -1;
486963
     }
486963
 
486963
diff --git a/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args b/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
486963
index 04a320d469..9b2e6086c3 100644
486963
--- a/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
486963
+++ b/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
486963
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-instance-00000092/.config \
486963
 -m size=14680064k,slots=16,maxmem=1099511627776k \
486963
 -overcommit mem-lock=off \
486963
 -smp 8,sockets=1,dies=1,cores=8,threads=1 \
486963
--object '{"qom-type":"memory-backend-memfd","id":"ram-node0","hugetlb":true,"hugetlbsize":2097152,"share":true,"prealloc":true,"size":15032385536,"host-nodes":[3],"policy":"preferred"}' \
486963
+-object '{"qom-type":"memory-backend-memfd","id":"ram-node0","hugetlb":true,"hugetlbsize":2097152,"share":true,"prealloc":true,"prealloc-threads":8,"size":15032385536,"host-nodes":[3],"policy":"preferred"}' \
486963
 -numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \
486963
 -uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \
486963
 -display none \
486963
@@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-instance-00000092/.config \
486963
 -no-acpi \
486963
 -boot strict=on \
486963
 -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
486963
--object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":true,"prealloc":true,"size":536870912,"host-nodes":[3],"policy":"preferred"}' \
486963
+-object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":true,"prealloc":true,"prealloc-threads":8,"size":536870912,"host-nodes":[3],"policy":"preferred"}' \
486963
 -device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
486963
 -audiodev '{"id":"audio1","driver":"none"}' \
486963
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
486963
-- 
486963
2.35.1
486963