[libvirt] [PATCH 0/2] tweak iothread/emulator pinning setting

Per review feedback ... Peter Krempa (2): qemu: emulatorpin: Always set affinity when pinning emulator thread qemu: iothreadpin: Always set affinity when pinning iothread src/qemu/qemu_driver.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) -- 2.6.2

Similarly to VM startup always set the legacy affinity. Additionally we don't need to report an explicit error since virProcessSetAffinity reports them themselves. --- src/qemu/qemu_driver.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1927b3c..4861254 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5276,15 +5276,11 @@ qemuDomainPinEmulator(virDomainPtr dom, " for emulator threads")); goto endjob; } - } else { - if (virProcessSetAffinity(vm->pid, pcpumap) < 0) { - virReportError(VIR_ERR_SYSTEM_ERROR, "%s", - _("failed to set cpu affinity for " - "emulator thread")); - goto endjob; - } } + if (virProcessSetAffinity(vm->pid, pcpumap) < 0) + goto endjob; + virBitmapFree(def->cputune.emulatorpin); def->cputune.emulatorpin = NULL; -- 2.6.2

Similarly to VM startup always set the legacy affinity. Additionally we don't need to report an explicit error since virProcessSetAffinity reports them themselves. --- src/qemu/qemu_driver.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 4861254..45ff3c0 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5765,15 +5765,11 @@ qemuDomainPinIOThread(virDomainPtr dom, " for iothread %d"), iothread_id); goto endjob; } - } else { - if (virProcessSetAffinity(iothrid->thread_id, pcpumap) < 0) { - virReportError(VIR_ERR_SYSTEM_ERROR, - _("failed to set cpu affinity for IOThread %d"), - iothread_id); - goto endjob; - } } + if (virProcessSetAffinity(iothrid->thread_id, pcpumap) < 0) + goto endjob; + if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) goto endjob; -- 2.6.2

On 02/19/2016 10:24 AM, Peter Krempa wrote:
Per review feedback ...
Peter Krempa (2): qemu: emulatorpin: Always set affinity when pinning emulator thread qemu: iothreadpin: Always set affinity when pinning iothread
src/qemu/qemu_driver.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-)
ACK - series John
participants (2)
-
John Ferlan
-
Peter Krempa