]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix race condition in abort of stream
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 16 Aug 2011 16:44:28 +0000 (09:44 -0700)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 16 Aug 2011 21:38:11 +0000 (14:38 -0700)
commitb4633113fc68f8a63d7650e22fd149a4ad1eea58
tree27ed5990110dca37674837f60868044937bd4635
parentf682c2530869b6f7c290537a68808e536c6a72c7
Fix race condition in abort of stream

If a stream gets a server initiated abort, the client may still
send an abort request before it receives the server side abort.
This causes the server to send back another abort for the
stream. Since the protocol defines that abort is the last thing
to be sent, the client gets confused by this second abort from
the server. If the stream is already shutdown, just drop any
client requested abort, rather than sending back another message.
This fixes the regression from previous versions.

Tested as follows

In one virsh session

  virsh # start foo
  virsh # console foo

In other virsh session

  virsh # destroy foo

The first virsh session should be able to continue issuing
commands without error. Prior to this patch it saw

  virsh # list
  error: Failed to list active domains
  error: An error occurred, but the cause is unknown

  virsh # list
  error: Failed to list active domains
  error: no call waiting for reply with prog 536903814 vers 1 serial 9

* src/rpc/virnetserverprogram.c: Drop abort requests
  for streams which no longer exist
src/rpc/virnetserverprogram.c