"nodeinfo" is not used in these two functions, and it's waste of goto in qemuProcessSetEmulatorAffinites --- src/qemu/qemu_process.c | 20 ++++---------------- 1 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index d3951d1..9b7be08 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1993,14 +1993,9 @@ qemuProcessSetVcpuAffinites(virConnectPtr conn, { qemuDomainObjPrivatePtr priv = vm->privateData; virDomainDefPtr def = vm->def; - virNodeInfo nodeinfo; int vcpu, n; int ret = -1; - if (virNodeGetInfo(conn, &nodeinfo) != 0) { - return -1; - } - if (!def->cputune.nvcpupin) return 0; @@ -2031,23 +2026,16 @@ qemuProcessSetEmulatorAffinites(virConnectPtr conn, { virBitmapPtr cpumask; virDomainDefPtr def = vm->def; - virNodeInfo nodeinfo; int ret = -1; - if (virNodeGetInfo(conn, &nodeinfo) != 0) - return -1; - - if (def->cputune.emulatorpin) { + if (def->cputune.emulatorpin) cpumask = def->cputune.emulatorpin->cpumask; - } else if (def->cpumask) { + else if (def->cpumask) cpumask = def->cpumask; - } else { - ret = 0; - goto cleanup; - } + else + return 0; ret = virProcessInfoSetAffinity(vm->pid, cpumask); -cleanup: return ret; } -- 1.7.7.6 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list