[virt-tools-list] [virt-install] Support for capturing guest serial console to a log file?

Cole Robinson crobinso at redhat.com
Mon Jul 18 19:08:00 UTC 2016


On 07/15/2016 10:58 AM, Kashyap Chamarthy wrote:
> Currently, one could do a `virsh edit vm1`, to redirect guest serial
> console output to a log file:
> 
>     <serial type='pty'>
>       <log file='/var/log/libvirt/qemu/vm1-serial.log' append='off'/>
>       <target port='0'/>
>     </serial>
>     <console type='pty'>
>       <log file='/var/log/libvirt/qemu/vm1-serial.log' append='off'/>
>       <target type='serial' port='0'/>
>     </console>
> 
> But that requires cumbersome manaul editing of the guest XML.  Is it
> possible yet via virt-install?
> 
> Perhaps something like:
> 
>     virt-install \
>     --serial pty, log,file=/tmp/f24-serial.log \
>     --console pty, log,file=/tmp/f24-serial.log \
>     [...]
> 
> The said feature was introduced in libvirt via these commits (by Dan
> Berrange):
> 
>     - http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=06cb0cf -- qemu:
>       add support for logging chardev output to a file
>     - http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=00ce10c --
>       conf: allow use of a logfile with chardev backends
> 

Nope, released virt-install doesn't support it, but I just fixed it upstream:

commit 322d21251630d16ab6664477c10d7442d9f222e7
Author: Cole Robinson <crobinso at redhat.com>
Date:   Mon Jul 18 15:03:06 2016 -0400

    cli: Add --serial log.file= and log.append=

    And for other character devices --console, --parallel, --channel


Thanks,
Cole




More information about the virt-tools-list mailing list