]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Don't return a fatal error if receiving unexpected stream data
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 9 Nov 2011 13:54:01 +0000 (13:54 +0000)
committerCole Robinson <crobinso@redhat.com>
Thu, 14 Jun 2012 21:32:48 +0000 (17:32 -0400)
Due to the asynchronous nature of streams, we might continue to
receive some stream packets from the server even after we have
shutdown the stream on the client side. These should be discarded
silently, rather than raising an error in the RPC layer.

* src/rpc/virnetclient.c: Discard stream data silently
(cherry picked from commit a38710bd652c1a4a79df7d4ef171d20ff322e566)

src/rpc/virnetclient.c

index b2c528a10f2b36e1a9e98f3599d6fd54e1b77c12..a56efb7b0916e8fc24063cb6f12541902b2837b3 100644 (file)
@@ -604,7 +604,9 @@ static int virNetClientCallDispatchStream(virNetClientPtr client)
         VIR_DEBUG("No stream found for packet with prog=%d vers=%d serial=%u proc=%u",
                   client->msg.header.prog, client->msg.header.vers,
                   client->msg.header.serial, client->msg.header.proc);
-        return -1;
+        /* Don't return -1, because we expect to see further stream packets
+         * after we've shut it down sometimes */
+        return 0;
     }
 
     /* Finish/Abort are synchronous, so also see if there's an