[PATCH] Don't return a fatal error if receiving unexpected stream data

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

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
---
 src/rpc/virnetclient.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index 4b7d4a9..4cbdf55 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -621,7 +621,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
-- 
1.7.6.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]