[libvirt] [PATCH] qemu: Don't fail without emulatorpin or cpumask

This unbreaks qemu:///session that got broken by ba63d8f7d843461f77a8206c1ef9da38388713e5. --- src/qemu/qemu_process.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index e08ec67..293ffe9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2041,8 +2041,10 @@ qemuProcessSetEmulatorAffinites(virConnectPtr conn, cpumask = def->cputune.emulatorpin->cpumask; else if (def->cpumask) cpumask = def->cpumask; - else + else { + ret = 0; goto cleanup; + } ret = virProcessInfoSetAffinity(vm->pid, cpumask); cleanup: -- 1.7.10.4

On 10/18/2012 04:32 PM, Guido Günther wrote:
This unbreaks qemu:///session that got broken by
ba63d8f7d843461f77a8206c1ef9da38388713e5. --- src/qemu/qemu_process.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index e08ec67..293ffe9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2041,8 +2041,10 @@ qemuProcessSetEmulatorAffinites(virConnectPtr conn, cpumask = def->cputune.emulatorpin->cpumask; else if (def->cpumask) cpumask = def->cpumask; - else + else {
Almost. Our coding style says that if you have {} on one side of 'else', then you need it on the other side as well. ACK if you update the patch to add {} to the rest of the if/else chain. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Thu, Oct 18, 2012 at 04:35:31PM -0600, Eric Blake wrote:
On 10/18/2012 04:32 PM, Guido Günther wrote:
This unbreaks qemu:///session that got broken by
ba63d8f7d843461f77a8206c1ef9da38388713e5. --- src/qemu/qemu_process.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index e08ec67..293ffe9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2041,8 +2041,10 @@ qemuProcessSetEmulatorAffinites(virConnectPtr conn, cpumask = def->cputune.emulatorpin->cpumask; else if (def->cpumask) cpumask = def->cpumask; - else + else {
Almost. Our coding style says that if you have {} on one side of 'else', then you need it on the other side as well. ACK if you update the patch to add {} to the rest of the if/else chain.
I always forget about that, sorry. Pushed now. Cheers, -- Guido
participants (2)
-
Eric Blake
-
Guido Günther