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

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



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


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