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

Eduardo Otubo otubo at linux.vnet.ibm.com
Wed Aug 25 16:54:57 UTC 2010


On 08/17/2010 04:04 PM, Eduardo Otubo wrote:
> 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;
>       }

Any comments on this?
I would be glad!

Thanks,

-- 
Eduardo Otubo
Software Engineer
Linux Technology Center
IBM Systems & Technology Group
Mobile: +55 19 8135 0885
eotubo at linux.vnet.ibm.com




More information about the libvir-list mailing list