On Fri, 2012-07-06 at 15:24 +0200, Gerd Hoffmann wrote:
> Anaconda in recent fedora versions sends logs to the virtio serial port named
> 'org.fedoraproject.anaconda.log.0' if present.  Wind up autotest logging for 
> it.

Ok, looks good, applied to next, thanks!

> Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
> ---
>  client/virt/guest-os.cfg.sample |    1 +
>  client/virt/kvm_vm.py           |   21 +++++++++++++++++++++
>  2 files changed, 22 insertions(+), 0 deletions(-)
> 
> diff --git a/client/virt/guest-os.cfg.sample b/client/virt/guest-os.cfg.sample
> index 93a4495..89fc733 100644
> --- a/client/virt/guest-os.cfg.sample
> +++ b/client/virt/guest-os.cfg.sample
> @@ -99,6 +99,7 @@ variants:
>                  unattended_install:
>                      boot_path = "images/pxeboot"
>                      kernel_params = "ks=cdrom nicdelay=60 
> console=ttyS0,115200 console=tty0"
> +                    anaconda_log = "yes"
>                      # You have to use ks=floppy if you want to use floppies 
> to
>                      # hold your kickstart file
>                      #kernel_params = "ks=floppy nicdelay=60 
> console=ttyS0,115200 console=tty0"
> diff --git a/client/virt/kvm_vm.py b/client/virt/kvm_vm.py
> index aa097ce..c1421a6 100644
> --- a/client/virt/kvm_vm.py
> +++ b/client/virt/kvm_vm.py
> @@ -361,6 +361,25 @@ class VM(virt_vm.BaseVM):
>              return cmd
>  
> 
> +        def add_log_anaconda(help):
> +            chardev_id = "anacondalog_chardev_%s" % self.instance
> +            vioser_id = "anacondalog_vioser_%s" % self.instance
> +            filename = "/tmp/anaconda-%s" % self.instance
> +            self.logs["anaconda"] = filename
> +            cmd = " -chardev socket"
> +            cmd += _add_option("id", chardev_id)
> +            cmd += _add_option("path", filename)
> +            cmd += _add_option("server", "NO_EQUAL_STRING")
> +            cmd += _add_option("nowait", "NO_EQUAL_STRING")
> +            cmd += " -device virtio-serial-pci"
> +            cmd += _add_option("id", vioser_id)
> +            cmd += " -device virtserialport"
> +            cmd += _add_option("bus", "%s.0" % vioser_id)
> +            cmd += _add_option("chardev", chardev_id)
> +            cmd += _add_option("name", "org.fedoraproject.anaconda.log.0")
> +            return cmd
> +
> +
>          def add_mem(help, mem):
>              return " -m %s" % mem
>  
> @@ -907,6 +926,8 @@ class VM(virt_vm.BaseVM):
>  
>          # Add logging
>          qemu_cmd += add_log_seabios(help)
> +        if params.get("anaconda_log", "no") == "yes":
> +            qemu_cmd += add_log_anaconda(help)
>  
>          # Add USB controllers
>          for usb_name in params.objects("usbs"):


_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to