The function doesn't make sense. There's a simpler way to achieve the same. --- src/qemu/qemu_cgroup.c | 16 ---------------- src/qemu/qemu_cgroup.h | 4 ---- src/qemu/qemu_driver.c | 8 +++----- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index bd768ef..50546a1 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -942,22 +942,6 @@ qemuSetupCgroupVcpuBW(virCgroupPtr cgroup, return -1; } -int -qemuSetupCgroupVcpuPin(virCgroupPtr cgroup, - virDomainPinDefPtr *vcpupin, - int nvcpupin, - int vcpuid) -{ - size_t i; - - for (i = 0; i < nvcpupin; i++) { - if (vcpuid == vcpupin[i]->id) - return qemuSetupCgroupCpusetCpus(cgroup, vcpupin[i]->cpumask); - } - - return -1; -} - int qemuSetupCgroupCpusetCpus(virCgroupPtr cgroup, diff --git a/src/qemu/qemu_cgroup.h b/src/qemu/qemu_cgroup.h index cdeb307..711a6de 100644 --- a/src/qemu/qemu_cgroup.h +++ b/src/qemu/qemu_cgroup.h @@ -52,10 +52,6 @@ int qemuSetupCpusetMems(virDomainObjPtr vm); int qemuSetupCgroupVcpuBW(virCgroupPtr cgroup, unsigned long long period, long long quota); -int qemuSetupCgroupVcpuPin(virCgroupPtr cgroup, - virDomainPinDefPtr *vcpupin, - int nvcpupin, - int vcpuid); int qemuSetupCgroupCpusetCpus(virCgroupPtr cgroup, virBitmapPtr cpumask); int qemuSetupCgroupForVcpu(virDomainObjPtr vm); int qemuSetupCgroupForIOThreads(virDomainObjPtr vm); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index fc44ef1..58fa3c6 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -4768,9 +4768,8 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver, } if (cgroup_vcpu) { - if (qemuSetupCgroupVcpuPin(cgroup_vcpu, - vm->def->cputune.vcpupin, - vm->def->cputune.nvcpupin, i) < 0) { + if (qemuSetupCgroupCpusetCpus(cgroup_vcpu, + vcpupin->cpumask) < 0) { virReportError(VIR_ERR_OPERATION_INVALID, _("failed to set cpuset.cpus in cgroup" " for vcpu %zu"), i); @@ -5136,8 +5135,7 @@ qemuDomainPinVcpuFlags(virDomainPtr dom, if (virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) { if (virCgroupNewVcpu(priv->cgroup, vcpu, false, &cgroup_vcpu) < 0) goto endjob; - if (qemuSetupCgroupVcpuPin(cgroup_vcpu, newVcpuPin, newVcpuPinNum, - vcpu) < 0) { + if (qemuSetupCgroupCpusetCpus(cgroup_vcpu, pcpumap) < 0) { virReportError(VIR_ERR_OPERATION_INVALID, _("failed to set cpuset.cpus in cgroup" " for vcpu %d"), vcpu); -- 2.2.2 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list