Re: [PATCH 4/4] virsh: add net-event command

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

 



On Fri, Feb 14, 2014 at 05:21:41PM -0700, Eric Blake wrote:
> Add 'virsh net-event --list' and 'virsh net-event [net] --event=name
> [--loop] [--timeout]'.  Very similar to 'virsh event'.
> 
> * tools/virsh.pod (net-event): Document new command.
> * tools/virsh-network.c (vshNetworkEventToString, vshNetEventData)
> (vshEventLifecyclePrint, cmdNetworkEvent): New struct and
> functions.
> 
> Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
> ---
>  tools/virsh-network.c | 171 +++++++++++++++++++++++++++++++++++++++++++++++++-
>  tools/virsh.pod       |  15 +++++
>  2 files changed, 185 insertions(+), 1 deletion(-)


> +
> +/*
> + * "net-event" command
> + */
> +static const char *
> +vshNetworkEventToString(int event)
> +{
> +    const char *ret = _("unknown");
> +    switch ((virNetworkEventLifecycleType) event) {
> +    case VIR_NETWORK_EVENT_DEFINED:
> +        ret = _("Defined");
> +        break;
> +    case VIR_NETWORK_EVENT_UNDEFINED:
> +        ret = _("Undefined");
> +        break;
> +    case VIR_NETWORK_EVENT_STARTED:
> +        ret = _("Started");
> +        break;
> +    case VIR_NETWORK_EVENT_STOPPED:
> +        ret = _("Stopped");
> +        break;
> +    case VIR_NETWORK_EVENT_LAST:
> +        break;
> +    }
> +    return ret;
> +}

Another enum use case I think

> +By default, tihs command is one-shot, and returns success once an event

Yay, copy+paste mistakes :-)

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]