[libvirt] [RFC 0/2] util: introduce timeout mode in virCommandRun/Async and virKModLoad

Shi Lei posted 2 patches 5 years, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1534141939-5199-1-git-send-email-shilei.massclouds@gmx.com
Test syntax-check passed
docs/internals/command.html.in |  68 +++++++
src/Makefile.am                |   4 +-
src/libvirt_private.syms       |   2 +
src/util/vircommand.c          | 110 ++++++++++-
src/util/vircommand.h          |   4 +
src/util/virkmod.c             |  43 ++++-
src/util/virprocess.c          | 107 ++++++++---
src/util/virprocess.h          |   4 +
src/virt-command.conf          |  10 +
tests/commandtest.c            | 411 ++++++++++++++++++++++++++++++++++++++---
10 files changed, 706 insertions(+), 57 deletions(-)
create mode 100644 src/virt-command.conf
[libvirt] [RFC 0/2] util: introduce timeout mode in virCommandRun/Async and virKModLoad
Posted by Shi Lei 5 years, 8 months ago
Hi, everyone!
It's possible that the running-time of a command is long than its caller
expected. Perhaps, it's useful to provide timeout mode for virCommandRun or
virCommandRunAsync + virCommandWait. And The caller can restrict the
running time of the command if necessary. I introduce a new function
virCommandSetTimeout for that.

And then, virKModLoad will get a default timeout of 3 seconds. I hope it
could solve the problem of "strange delay" as John mentioned.

Thanks!

Shi Lei (2):
  introduce timeout mode in virCommandRun/Async
  introduce timeout mode in virKModLoad

 docs/internals/command.html.in |  68 +++++++
 src/Makefile.am                |   4 +-
 src/libvirt_private.syms       |   2 +
 src/util/vircommand.c          | 110 ++++++++++-
 src/util/vircommand.h          |   4 +
 src/util/virkmod.c             |  43 ++++-
 src/util/virprocess.c          | 107 ++++++++---
 src/util/virprocess.h          |   4 +
 src/virt-command.conf          |  10 +
 tests/commandtest.c            | 411 ++++++++++++++++++++++++++++++++++++++---
 10 files changed, 706 insertions(+), 57 deletions(-)
 create mode 100644 src/virt-command.conf

-- 
2.7.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [RFC 0/2] util: introduce timeout mode in virCommandRun/Async and virKModLoad
Posted by Daniel P. Berrangé 5 years, 8 months ago
On Mon, Aug 13, 2018 at 02:32:17PM +0800, Shi Lei wrote:
> Hi, everyone!
> It's possible that the running-time of a command is long than its caller
> expected. Perhaps, it's useful to provide timeout mode for virCommandRun or
> virCommandRunAsync + virCommandWait. And The caller can restrict the
> running time of the command if necessary. I introduce a new function
> virCommandSetTimeout for that.
> 
> And then, virKModLoad will get a default timeout of 3 seconds. I hope it
> could solve the problem of "strange delay" as John mentioned.

I'm not really see what this is hoping to solve. If something in libvirt
is running virKModLoad, I cannot see how it will work better by not waiting
for it to complete.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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