]> xenbits.xensource.com Git - libvirt.git/commitdiff
rpc: silence coverity warning
authorEric Blake <eblake@redhat.com>
Mon, 4 Jul 2011 02:26:05 +0000 (10:26 +0800)
committerDaniel Veillard <veillard@redhat.com>
Mon, 4 Jul 2011 02:26:05 +0000 (10:26 +0800)
Coverity noted that 4 out of 5 calls to virNetClientStreamRaiseError
checked the return value.  This case expects a particular value, so
warn if our expectations went wrong due to some bug elsewhere.

* src/rpc/virnetclient.c (virNetClientCallDispatchStream): Warn on
  unexpected scenario.

src/rpc/virnetclient.c

index b551b99a0087cc1088b7ddce7e7eb4bf16460808..615de6c2c837ebdde8f2493d222976770f9ac453 100644 (file)
@@ -602,7 +602,8 @@ static int virNetClientCallDispatchStream(virNetClientPtr client)
         if (thecall && thecall->expectReply) {
             VIR_DEBUG("Got a synchronous error");
             /* Raise error now, so that this call will see it immediately */
-            virNetClientStreamRaiseError(st);
+            if (!virNetClientStreamRaiseError(st))
+                VIR_DEBUG("unable to raise synchronous error");
             thecall->mode = VIR_NET_CLIENT_MODE_COMPLETE;
         }
         return 0;