* On 2012-07-06 15:24:19 +0200, Gerd Hoffmann ([email protected]) 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.
>
> Signed-off-by: Gerd Hoffmann <[email protected]>
Oh, it's really nice.
Tested on my fedora box by installing a f17 guest, this patch works
well.
Ack.
> ---
> 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"):
> --
> 1.7.1
>
> _______________________________________________
> Autotest mailing list
> [email protected]
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest