[libvirt] [PATCH] PHYP: Bad comparison when checking for existing domain name

Eduardo Otubo otubo at linux.vnet.ibm.com
Tue Aug 17 19:04:49 UTC 2010


When creating a new domain from an XML, the check for an existing
domain name should compare the return of the function to a a valid
LPAR ID (!= -1) and not to error (== -1).
---
 src/phyp/phyp_driver.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index 251111d..8eeba73 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -3759,7 +3759,7 @@ phypDomainCreateAndStart(virConnectPtr conn,
         goto err;
 
     /* checking if this name already exists on this system */
-    if (phypGetLparID(session, managed_system, def->name, conn) == -1) {
+    if (phypGetLparID(session, managed_system, def->name, conn) != -1) {
         VIR_WARN0("LPAR name already exists.");
         goto err;
     }
-- 
1.7.0.4




More information about the libvir-list mailing list