[libvirt] [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 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

On 10/18/2012 10:09 PM, Osier Yang wrote:
"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(-)
ACK. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 2012年10月20日 00:13, Eric Blake wrote:
On 10/18/2012 10:09 PM, Osier Yang wrote:
"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(-)
ACK.
Thanks, pushed.
participants (2)
-
Eric Blake
-
Osier Yang