]> xenbits.xensource.com Git - libvirt.git/commitdiff
PHYP: Bad comparison when checking for existing domain name
authorEduardo Otubo <otubo@linux.vnet.ibm.com>
Tue, 17 Aug 2010 19:04:49 +0000 (16:04 -0300)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Fri, 27 Aug 2010 10:19:10 +0000 (12:19 +0200)
When creating a new domain from XML, the check for an existing
domain name should compare the return of the function to a valid
LPAR ID (!= -1) and not to error (== -1).

src/phyp/phyp_driver.c

index 251111d5d0cd5a5af8d1a918040a415d170bb003..8eeba73fb21bc80dd4c82fb4f9566937b39c8182 100644 (file)
@@ -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;
     }