From 5828080f7121627ca02e971c2f44c12ea8f5e16e Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Fri, 19 Oct 2012 12:09:20 +0800 Subject: [PATCH] qemu: Cleanup the unused 'nodeinfo' "nodeinfo" is not used in these two functions, and it's waste of goto in qemuProcessSetEmulatorAffinites --- src/qemu/qemu_process.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 9a35b29c82..eef1ddb964 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2004,14 +2004,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; @@ -2042,23 +2037,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; }