diff --git a/src/rpc/virnetserverprogram.c b/src/rpc/virnetserverprogram.c index ca80ae09ed845ce660c55f6bdb59a53c6186ad61..63a6b6dc0c89633cf87927eff03f6a51d0f39420 100644 --- a/src/rpc/virnetserverprogram.c +++ b/src/rpc/virnetserverprogram.c @@ -257,14 +257,23 @@ int virNetServerProgramDispatch(virNetServerProgramPtr prog, * stream packets after we closed down a stream. Just drop & ignore * these. */ - VIR_INFO("Ignoring unexpected stream data serial=%d proc=%d status=%d", - msg->header.serial, msg->header.proc, msg->header.status); - /* Send a dummy reply to free up 'msg' & unblock client rx */ - memset(msg, 0, sizeof(*msg)); - msg->header.type = VIR_NET_REPLY; - if (virNetServerClientSendMessage(client, msg) < 0) { - ret = -1; - goto cleanup; + if (msg->header.status == VIR_NET_CONTINUE) { + VIR_INFO("Ignoring unexpected stream data serial=%d proc=%d status=%d", + msg->header.serial, msg->header.proc, msg->header.status); + /* Send a dummy reply to free up 'msg' & unblock client rx */ + memset(msg, 0, sizeof(*msg)); + msg->header.type = VIR_NET_REPLY; + if (virNetServerClientSendMessage(client, msg) < 0) { + ret = -1; + goto cleanup; + } + } else { + VIR_INFO("Unexpected stream control message serial=%d proc=%d status=%d", + msg->header.serial, msg->header.proc, msg->header.status); + virNetError(VIR_ERR_RPC, + _("Unexpected stream control message serial=%d proc=%d status=%d"), + msg->header.serial, msg->header.proc, msg->header.status); + goto error; } ret = 0; break;