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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]