[libvirt] [PATCH 0/3] Behave better for users of virStream

Martin Kletzander posted 3 patches 6 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1496318548.git.mkletzan@redhat.com
src/remote/remote_driver.c   | 42 +++++++++++-------------------------------
src/rpc/virnetclientstream.c | 10 +++++++---
src/rpc/virnetclientstream.h |  3 ++-
src/util/virfdstream.c       | 12 ++++++++++++
4 files changed, 32 insertions(+), 35 deletions(-)
[libvirt] [PATCH 0/3] Behave better for users of virStream
Posted by Martin Kletzander 6 years, 10 months ago
So I was playing with one program and I was getting weird behaviour.
It was also mentioned on the list by someone for some other client
they were writing.  I found out what we were both missing was callback
removal before/after finish/abort was called.  The problem is that was
not intuitive at all.  In the docs we only have an example for
blocking streams, there is no mention of the callbacks and the
behaviour that libvirt has.  I first wanted to fix the documentation,
but then I realized it should never make sense to have a callback
after stream has ended, so why not behave nicely for callers.  Since
they should be removing the callback right before the finish, there
shouldn't even be any error message after they upgrade.  To be even
nicer we could make RemoveCallback() not fail when there is no
callback registered (like DomainSuspend() when the domain is already
suspended).

Martin Kletzander (3):
  Make virNetClientStreamEventRemoveCallback's errors optional
  remote: Consolidate remoteStream{Abort,Finish} functions
  virStream: Remove callbacks on Abort/Finish

 src/remote/remote_driver.c   | 42 +++++++++++-------------------------------
 src/rpc/virnetclientstream.c | 10 +++++++---
 src/rpc/virnetclientstream.h |  3 ++-
 src/util/virfdstream.c       | 12 ++++++++++++
 4 files changed, 32 insertions(+), 35 deletions(-)

--
2.13.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list