[Libvir] [PATCH] add a ttyconsole command

It was pointed out that we have a vncdisplay command but none for extracting the TTY console device: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=239687 the trivial associated patch adds it as well as the doc in the man page Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

Daniel Veillard wrote:
It was pointed out that we have a vncdisplay command but none for extracting the TTY console device:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=239687
the trivial associated patch adds it as well as the doc in the man page
I wonder if it should print some error message if the <console> node doesn't exist? I tried your patch on a FV domain, before remembering that FV domains don't have consoles, and it prints an empty line (but the return code is 1, which is good): $ src/.libs/virsh ttyconsole debian32fv $ echo $? 1 Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Wed, Jul 25, 2007 at 03:24:15PM +0100, Richard W.M. Jones wrote:
Daniel Veillard wrote:
It was pointed out that we have a vncdisplay command but none for extracting the TTY console device:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=239687
the trivial associated patch adds it as well as the doc in the man page
I wonder if it should print some error message if the <console> node doesn't exist? I tried your patch on a FV domain, before remembering that FV domains don't have consoles, and it prints an empty line (but the return code is 1, which is good):
$ src/.libs/virsh ttyconsole debian32fv
$ echo $? 1
Why not, but in that case we should be consistent and do the same for vncdisplay : paphio:~ -> virsh vncdisplay rhel5 paphio:~ -> echo $? 1 paphio:~ -> I must admit I'm not suggesting one or the other, the vncdisplay status-quo didn't seems to bother anybody. It's trivial and I have no preference, opinion welcome :-) Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Wed, 2007-07-25 at 10:33 -0400, Daniel Veillard wrote:
I must admit I'm not suggesting one or the other, the vncdisplay status-quo didn't seems to bother anybody. It's trivial and I have no preference, opinion welcome :-)
How about documenting the behavior in the man page (exit with status 1 if there is no console/vncdisplay) ? Sometimes docs can save you from implementation choices ;) David

On Wed, Jul 25, 2007 at 06:47:52PM +0000, David Lutterkort wrote:
On Wed, 2007-07-25 at 10:33 -0400, Daniel Veillard wrote:
I must admit I'm not suggesting one or the other, the vncdisplay status-quo didn't seems to bother anybody. It's trivial and I have no preference, opinion welcome :-)
How about documenting the behavior in the man page (exit with status 1 if there is no console/vncdisplay) ? Sometimes docs can save you from implementation choices ;)
Thanks for the suggestion :-), status quo remains, but I added this to the documentation for both commands. This is in CVS now, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (3)
-
Daniel Veillard
-
David Lutterkort
-
Richard W.M. Jones