SHA256
1
0
forked from pool/libvirt
libvirt/1a4b21f1-set-EOF-on-end-of-stream.patch
James Fehlig f044c9550b Accepting request 501831 from home:jfehlig:branches:Virtualization
Miscellaneous spec file improvements.

- misc spec file cleanup
  - remove checks for old distros well beyond EOL
  - enable wireshark dissector for Leap >= 42.2 and Factory
  - remove support for old, non-systemd distros
  - replace $RPM_ shell vars with modern macros

  5004f121-virFdStreamThread-dont-exceed-length.patch,
  1a4b21f1-set-EOF-on-end-of-stream.patch

OBS-URL: https://build.opensuse.org/request/show/501831
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=608
2017-06-07 23:56:21 +00:00

40 lines
1.6 KiB
Diff

commit 1a4b21f1c67a3ddf39d11bba39c1dee869131636
Author: Michal Privoznik <mprivozn@redhat.com>
Date: Tue Jun 6 14:45:55 2017 +0200
virNetClientStreamQueuePacket: Set st->incomingEOF on the end of stream
While reworking client side of streams, I had to postpone payload
decoding so that stream holes and stream data can be
distinguished in virNetClientStreamRecvPacket. That's merely what
18944b7aea46d does. However, I accidentally removed one important
bit: when server sends us an empty STREAM packet (with no
payload) - meaning end of stream - st->incomingEOF flag needs to
be set. It used to be before I touched the code. After I removed
it, virNetClientStreamRecvPacket will try to fetch more data from
the stream, but it will never come.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Index: libvirt-3.4.0/src/rpc/virnetclientstream.c
===================================================================
--- libvirt-3.4.0.orig/src/rpc/virnetclientstream.c
+++ libvirt-3.4.0/src/rpc/virnetclientstream.c
@@ -278,6 +278,15 @@ int virNetClientStreamQueuePacket(virNet
VIR_DEBUG("Incoming stream message: stream=%p message=%p", st, msg);
+ if (msg->bufferLength == msg->bufferOffset) {
+ /* No payload means end of the stream. */
+ virObjectLock(st);
+ st->incomingEOF = true;
+ virNetClientStreamEventTimerUpdate(st);
+ virObjectUnlock(st);
+ return 0;
+ }
+
/* Unfortunately, we must allocate new message as the one we
* get in @msg is going to be cleared later in the process. */