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 <pkrempa(a)redhat.com>
---
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 = virDomainIOThreadIDFind(def, iothread_id))) {
virReportError(VIR_ERR_INVALID_ARG,
@@ -5019,11 +5018,8 @@ qemuDomainPinIOThread(virDomainPtr dom,
goto endjob;
}
- if (!(cpumask = virBitmapNewData(cpumap, maplen)))
- goto endjob;
-
virBitmapFree(iothrid->cpumask);
- iothrid->cpumask = cpumask;
+ iothrid->cpumask = virBitmapNewCopy(pcpumap);
iothrid->autofill = false;
/* Configure the corresponding cpuset cgroup before set affinity. */
@@ -5060,7 +5056,6 @@ qemuDomainPinIOThread(virDomainPtr dom,
if (persistentDef) {
virDomainIOThreadIDDef *iothrid;
- virBitmap *cpumask;
if (!(iothrid = virDomainIOThreadIDFind(persistentDef, iothread_id))) {
virReportError(VIR_ERR_INVALID_ARG,
@@ -5068,11 +5063,8 @@ qemuDomainPinIOThread(virDomainPtr dom,
goto endjob;
}
- if (!(cpumask = virBitmapNewData(cpumap, maplen)))
- goto endjob;
-
virBitmapFree(iothrid->cpumask);
- iothrid->cpumask = cpumask;
+ iothrid->cpumask = virBitmapNewCopy(pcpumap);
iothrid->autofill = false;
ret = virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir);
--
2.34.1