amluto / virtme

An easy way to virtualize the running system
GNU General Public License v2.0
330 stars 66 forks source link

s390x: Override serial console arguments for qemu #75

Open jsitnicki opened 2 years ago

jsitnicki commented 2 years ago

As Alice Frosi reported (PR #58), passing

-device sclpconsole,chardev=console

together with

-serial chardev:console

to qemu-system-s390x is not supported.

Following Andrew Lutomirski's suggestion, use the latter as the default for configuring the serial console on all architectures but s390x, where we override it in favor of sclpconsole.

Signed-off-by: Jakub Sitnicki jakub@cloudflare.com

jsitnicki commented 2 years ago

I've been using this patch when recently testing BPF fixes for s390x.

Quick check against Fedora 35 VM image also confirms that console works:

$ guestmount --add Fedora-Cloud-Base-35-1.2.s390x.img --mount /dev/sda5 ./sys-root/
$ virtme-run --arch s390x --kimg sys-root/root/usr/lib/modules/5.14.10-300.fc35.s390x/vmlinuz --root sys-root/root/ --memory 4G --cpu 4 --show-command
/usr/bin/qemu-system-s390x -fsdev local,id=virtfs1,path=sys-root/root/,security_model=none,readonly,multidevs=remap -device virtio-9p-ccw,fsdev=virtfs1,mount_tag=/dev/root -fsdev local,id=virtfs5,path=/home/jkbs/src/virtme/virtme/guest,security_model=none,readonly,multidevs=remap -device virtio-9p-ccw,fsdev=virtfs5,mount_tag=virtme.guesttools -M s390-ccw-virtio -nodefaults -parallel none -net none -echr 1 -serial none -chardev stdio,id=console,signal=off,mux=on -device sclpconsole,chardev=console -mon chardev=console -vga none -display none -m 4G -smp 4 -kernel sys-root/root/usr/lib/modules/5.14.10-300.fc35.s390x/vmlinuz -append 'psmouse.proto=exps "virtme_stty_con=rows 55 cols 237 iutf8" TERM=screen-256color rootfstype=9p rootflags=version=9p2000.L,trans=virtio,access=any raid=noautodetect ro init=/bin/sh -- -c "mount -t tmpfs run /run;mkdir -p /run/virtme/guesttools;/bin/mount -n -t 9p -o ro,version=9p2000.L,trans=virtio,access=any virtme.guesttools /run/virtme/guesttools;exec /run/virtme/guesttools/virtme-init"'
qemu-system-s390x: -fsdev local,id=virtfs1,path=sys-root/root/,security_model=none,readonly,multidevs=remap: warning: short-form boolean option 'readonly' deprecated
Please use readonly=on instead
qemu-system-s390x: -fsdev local,id=virtfs5,path=/home/jkbs/src/virtme/virtme/guest,security_model=none,readonly,multidevs=remap: warning: short-form boolean option 'readonly' deprecated
Please use readonly=on instead
KASLR disabled: CPU has no PRNG
[    0.341931] Linux version 5.14.10-300.fc35.s390x (mockbuild@buildvm-s390x-18.s390.fedoraproject.org) (gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1), GNU ld version 2.37-10.fc35) #1 SMP Thu Oct 7 20:30:59 UTC 2021
…
marcosps commented 2 years ago

@jsitnicki Just tested the patch, and it solved the problem for me too.

@amluto would you mind checking this patch?