Description of problem: ----------------------- With SGA device, libguestfs appliance -- which uses QEMU appliance under the hood -- fails to build, hanging while trying to print TERM size. Version: -------- $ rpm -q seabios-bin sgabios-bin qemu seabios-bin-1.7.2-1.fc19.noarch sgabios-bin-0.20110622svn-5.fc19.noarch qemu-1.4.1-3.fc19.x86_64 How reproducible: Consistently. Steps to Reproduce: ------------------ 1. yum-builddep libguestfs 2. git clone git://github.com/libguestfs/libguestfs.git \ && cd libguestfs 3. ./autogen.sh 4. make 5. make quickcheck Actual results: --------------- "make quickcheck" just hangs, and finally times out: ================= $ make quickcheck [...] libguestfs: command: run: \ -rf /home/kashyap/src/upstream-libguestfs/tmp/guestfs.1CElGF libguestfs: [17481ms] begin testing qemu features libguestfs: command: run: /bin/qemu-kvm libguestfs: command: run: \ -nographic libguestfs: command: run: \ -help libguestfs: command: run: /bin/qemu-kvm libguestfs: command: run: \ -nographic libguestfs: command: run: \ -version libguestfs: qemu version 1.4 libguestfs: command: run: /bin/qemu-kvm libguestfs: command: run: \ -nographic libguestfs: command: run: \ -machine accel=kvm:tcg libguestfs: command: run: \ -device ? libguestfs: [17595ms] finished testing qemu features [17595ms] /bin/qemu-kvm \ -global virtio-blk-pci.scsi=off \ -nodefconfig \ -nodefaults \ -nographic \ -device virtio-scsi-pci,id=scsi \ -drive file=/tmp/libguestfs-test-tool-sda-rOfTzy,format=raw,id=hd0,if=none \ -device scsi-hd,drive=hd0 \ -drive file=/home/kashyap/src/upstream-libguestfs/tmp/.guestfs-1000/root.3815,snapshot=on,id=appliance,if=none,cache=unsafe \ -device scsi-hd,drive=appliance \ -machine accel=kvm:tcg \ -m 500 \ -no-reboot \ -no-hpet \ -device virtio-serial \ -serial stdio \ -device sga \ -chardev socket,path=/home/kashyap/src/upstream-libguestfs/tmp/libguestfseRmt2B/guestfsd.sock,id=channel0 \ -device virtserialport,chardev=channel0,name=org.libguestfs.channel.0 \ -kernel /home/kashyap/src/upstream-libguestfs/tmp/.guestfs-1000/kernel.3815 \ -initrd /home/kashyap/src/upstream-libguestfs/tmp/.guestfs-1000/initrd.3815 \ -append 'panic=1 console=ttyS0 udevtimeout=600 no_timer_check acpi=off printk.time=1 cgroup_disable=memory root=/dev/sdb selinux=0 guestfs_verbose=1 TERM=screen'\x1b[1;256r\x1b[256;256H\x1b[6n Google, Inc. Serial Graphics Adapter 02/18/13 SGABIOS $Id: sgabios.S 8 2010-04-22 00:03:40Z nlaredo $ (mockbuild@) Mon Feb 18 08:29:02 UTC 2013 Term: ================= Expected results: ----------------- libugestfs appliance should build successfully with sgabios. Additional info: ---------------- (1) Rich suggested to disable sgabios: from ../libguestfs/src/launch-direct.c, elide the below two lines, save it: add_cmdline (g, "-device") add_cmdline (g, "sga"); And, then run: make clean make -j 6 make quickcheck is successful. (2) RWMJ: The hang makes no sense because, from here: https://code.google.com/p/sgabios/source/browse/trunk/sgabios.S#2376 the code just prints out Term: followed immediately by the detected terminal size. So it would indicate some sort of flow control problem in virtio-serial.
Created attachment 750566 [details] Successful "make check" of libguestfs, with SGA device disabled
And, I was also able to reproduce this issue with qemu git: $ cd qemu $ git describe v1.4.0-1926-gb9b5df6 In qemu direcotry, qemu-wrapper.sh containing: #!/bin/sh - qemudir=/home/kashyap/src/qemu exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "$@" Give it executable permissions. From libguestfs dir: $ make clean && make -j4 && make quickcheck
I wasn't able to reproduce this, but as the reporter says it does look like it might possibly be a flow-control problem in the new qemu virtio-serial code.
What kernel version? This could be caused by the change in emulate_invalid_guest_state's default setting in the 3.9 kernel. If this is the case, it will be fixed when the host kernel is updated to 3.9.3. Alternatively you can load the kvm_intel module with emulate_invalid_guest_state=0.
Linux iciclelabengpnqredhatcom 3.9.1-301.fc19.x86_64 #1 SMP Wed May 8 18:02:34 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux Will try a different kernel in a minute.
(In reply to Richard W.M. Jones from comment #5) > Linux iciclelabengpnqredhatcom 3.9.1-301.fc19.x86_64 #1 SMP Wed May 8 > 18:02:34 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux > > Will try a different kernel in a minute. http://koji.fedoraproject.org/koji/buildinfo?buildID=420269 is 3.9.3.
Similar bug reported here: http://www.mail-archive.com/kvm@vger.kernel.org/msg90247.html As Paolo points out, it's something to do with emulate_invalid_guest_state.
Excellent, fixed by installing 3.10.0-0.rc1.git6.2.fc20.x86_64. Thanks everyone.