[libvirt] [PATCH 3/3] qemu: driver: Remove unnecessary condition

Peter Krempa pkrempa at redhat.com
Wed Sep 7 12:04:55 UTC 2016


At this point it's guaranteed that 'persistentDef' is non-NULL so we
don't need to check it again.
---
 src/qemu/qemu_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 07d33d3..d044a8c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4730,7 +4730,7 @@ qemuDomainSetVcpusMax(virQEMUDriverPtr driver,
         goto cleanup;
     }

-    if (persistentDef && persistentDef->cpu && persistentDef->cpu->sockets) {
+    if (persistentDef->cpu && persistentDef->cpu->sockets) {
         /* allow setting a valid vcpu count for the topology so an invalid
          * setting may be corrected via this API */
         if (nvcpus != persistentDef->cpu->sockets *
-- 
2.10.0




More information about the libvir-list mailing list