]> xenbits.xensource.com Git - libvirt.git/commitdiff
xenconfig: Properly check retval of virDomainGraphicsListenSetAddress
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 10 Feb 2016 08:34:59 +0000 (09:34 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 10 Feb 2016 13:13:41 +0000 (14:13 +0100)
The function, like others in our code, returns zero on success
and a negative value on error. However, there are two places in
xenconfig source code where we check for non-zero value. While
the function can't currently return a positive value, those
checks look okay, but does not really follow our style.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/xenconfig/xen_sxpr.c

index 252a48b3d4e74df3c8ca31a83b0637c5d6c14b7e..fdfec2b7d77ffb3fb529e6b996eb308258bc2c3e 100644 (file)
@@ -868,7 +868,7 @@ xenParseSxprGraphicsOld(virDomainDefPtr def,
         graphics->data.vnc.port = port;
 
         if (listenAddr &&
-            virDomainGraphicsListenSetAddress(graphics, 0, listenAddr, -1, true))
+            virDomainGraphicsListenSetAddress(graphics, 0, listenAddr, -1, true) < 0)
             goto error;
 
         if (VIR_STRDUP(graphics->data.vnc.auth.passwd, vncPasswd) < 0)
@@ -987,7 +987,7 @@ xenParseSxprGraphicsNew(virDomainDefPtr def,
                 graphics->data.vnc.port = port;
 
                 if (listenAddr &&
-                    virDomainGraphicsListenSetAddress(graphics, 0, listenAddr, -1, true))
+                    virDomainGraphicsListenSetAddress(graphics, 0, listenAddr, -1, true) < 0)
                     goto error;
 
                 if (VIR_STRDUP(graphics->data.vnc.auth.passwd, vncPasswd) < 0)