]> xenbits.xensource.com Git - libvirt.git/commit
virsh: common code for waiting for an event
authorEric Blake <eblake@redhat.com>
Fri, 14 Feb 2014 22:30:23 +0000 (15:30 -0700)
committerEric Blake <eblake@redhat.com>
Thu, 20 Feb 2014 23:23:27 +0000 (16:23 -0700)
commit4c29530d8ebee6d5ea8322207d1a93c13dc09f7e
treea80cd1418f491e81c393bfba8273cd2bf5bd9ba4
parent5093b047eaff2596848c32cbe280207996c86b42
virsh: common code for waiting for an event

I plan to add 'virsh event' to virsh-domain.c and 'virsh
net-event' to virsh-network.c; but as they will share quite
a bit of common boilerplate, it's better to set that up now
in virsh.c.

* tools/virsh.h (_vshControl): Add fields.
(vshEventStart, vshEventWait, vshEventDone, vshEventCleanup): New
prototypes.
* tools/virsh.c (vshEventFd, vshEventOldAction, vshEventInt)
(vshEventTimeout): New helper variables and functions.
(vshEventStart, vshEventWait, vshEventDone, vshEventCleanup):
Implement new functions.
(vshInit, vshDeinit, main): Manage event timeout.

Signed-off-by: Eric Blake <eblake@redhat.com>
tools/virsh.c
tools/virsh.h