[libvirt] [PATCH 08/10] Re-write virsh console to use streams

Eric Blake eblake at redhat.com
Mon Nov 1 21:55:08 UTC 2010


On 11/01/2010 10:12 AM, Daniel P. Berrange wrote:
> This re-writes the 'virsh console' command so that it uses
> the new streams API. This lets it run remotely and/or as a
> non-root user. This requires that virsh be linked against
> the simple event loop from libvirtd in daemon/event.c
> As an added bonus, it can now connect to any console device,
> not just the first one.
> 
> * tools/Makefile.am: Link to event.c
> * tools/console.c, tools/console.h: Rewrite to use the
>   virDomainOpenConsole() APIs with streams
> * tools/virsh.c: Support choosing the console name
>   via --devname $NAME
> ---
>  .x-sc_avoid_write |    1 +
>  tools/Makefile.am |    1 +
>  tools/console.c   |  330 ++++++++++++++++++++++++++++++++++++++++-------------
>  tools/console.h   |    2 +-
>  tools/virsh.c     |   76 ++++---------

tools/virsh.pod changes?

> +        if (con->terminalToStream.data[con->terminalToStream.offset] == CTRL_CLOSE_BRACKET) {
> +            con->quit = true;
> +            return;
> +        }

Is there any way to type an escape sequence, such as ^v in common stty
usage, in order to allow sending a literal ^] through to the console
instead of always making it quit?

>  
> +    if (con) {
> +        if (con->st)
> +            virStreamFree(con->st);

Should virStreamFree tolerate a NULL argument, at which point it should
be added to the list in cfg.mk of free()-like functions that should not
have an extra if() preceding usage?

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101101/410da76d/attachment-0001.sig>


More information about the libvir-list mailing list