From: Fam Zheng <famz@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
qemu-devel@nongnu.org, "Kamil Rytarowski" <kamil@netbsd.org>,
stefanha@redhat.com, "Cleber Rosa" <crosa@redhat.com>,
pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v6 04/12] tests: Add vm test lib
Date: Sat, 9 Sep 2017 12:10:36 +0800 [thread overview]
Message-ID: <20170909041036.GF18677@lemon.lan> (raw)
In-Reply-To: <6e624d60-c8ed-54f5-a2ca-9caf9d9c489f@amsat.org>
On Fri, 09/08 22:25, Philippe Mathieu-Daudé wrote:
> Hi Fam, Alex,
>
> > >
> > > If this fails it's fairly cryptic:
> > >
> > > /home/alex/lsrc/qemu/qemu.git/tests/vm/openbsd --debug --image "tests/vm/openbsd.img" --build-qemu /home/alex/lsrc/qemu/qemu.git
> > > DEBUG:root:Creating archive ./vm-test-fxejnB.tmp/data-2de24.tar for src_dir dir: /home/alex/lsrc/qemu/qemu.git
> > > DEBUG:root:QEMU args: -nodefaults -m 2G -cpu host -netdev user,id=vnet,hostfwd=:0.0.0.0:0-:22 -device virtio-net-pci,netdev=vnet -vnc :0,to=20 -serial file:./vm-test-fxejnB.tmp/serial.out -smp 4 -enable-kvm -device VGA -drive file=tests/vm/openbsd.img,snapshot=on,if=none,id=drive0,cache=writeback -device virtio-blk,drive=drive0,bootindex=0 -drive file=./vm-test-fxejnB.tmp/data-2de24.tar,if=none,id=data-2de24,cache=writeback,format=raw -device virtio-blk,drive=data-2de24,serial=data-2de24,bootindex=1
> > > Failed to prepare guest environment
> > > Traceback (most recent call last):
> > > File "/home/alex/lsrc/qemu/qemu.git/tests/vm/basevm.py", line 260, in main
> > > vm.boot(args.image + ",snapshot=on")
> > > File "/home/alex/lsrc/qemu/qemu.git/tests/vm/basevm.py", line 184, in boot
> > > guest.launch()
> > > File "/home/alex/lsrc/qemu/qemu.git/tests/vm/../../scripts/qemu.py", line 151, in launch
> > > self._post_launch()
> > > File "/home/alex/lsrc/qemu/qemu.git/tests/vm/../../scripts/qemu.py", line 135, in _post_launch
> > > self._qmp.accept()
> > > File "/home/alex/lsrc/qemu/qemu.git/tests/vm/../../scripts/qmp/qmp.py", line 147, in accept
> > > return self.__negotiate_capabilities()
> > > File "/home/alex/lsrc/qemu/qemu.git/tests/vm/../../scripts/qmp/qmp.py", line 60, in __negotiate_capabilities
> > > raise QMPConnectError
> > > QMPConnectError
> > >
> > > I assume QEMU failed to boot and might have given us a message that
> > > would be useful.
> >
> > It's a separate issue of qemu.py, I didn't try to fix it here because currently
> > there are many patches touching that file on the list, there is a high chance of
> > conflict.
> >
> > In your case which qemu version are you using? If not master it probably is
> > failing because of the hostfwd syntax.
>
> very likely.
>
> one simple way to handle this could be having this script catching
> QMPConnectError and restart with older command line format,
The error reporting definitely needs improving (like saying which version of
QEMU is needed), but I'm not sure about adding fallbacks here and there are
worth the effort, see below.
>
> but I prefer starting QEMU binding a QMP socket, then initialize the options
> via QMP packets, this should be more portable, this is cleaner.
This is just different, but not necessarily cleaner. When you want to manually
start such a VM, it will be very painful. Nor does "ps | grep | less" etc works.
Command line is simpler and more user friendly in this respect.
>
> also I think we don't want to run those images with bleeding edge
> qemu-system, we want a stable QEMU to be able to compile the bleeding edge
> codebase inside a working VM.
You are right we are not testing that bleeding edge qemus can run the VM, but we
need the features of the bleeding edge qemu to write simpler test code. I think
this is reasonable for both CI and developers. So unless there is an
alternative way to do the hostfwd port allocation, I think we can live with this
requirement.
>
> another note: currently when a VM fails, it closes and what I've left is
> only the last stderr.
> I'd rather see 2 modes:
> - run from some CI when only the final return value is useful, the stderr
> being extra value.
> - in user-dev mode if the build fails I'd like to have access to the
> terminal, eventually some msg like "this build failed, you can connect to
> this VM copy/pasting the following ssh command: ... or hit ^C to gracefully
> shutdown the VM"
> But in this mode I'd rather mount my current workdir via a read-writable
> netshare rather than a one-time temporary read-only tarball, so I could
> modify my repo and just run 'make' inside the VM.
Like the docker tests, this is what DEBUG=1 is for.
Fam
next prev parent reply other threads:[~2017-09-09 4:10 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-05 2:11 [Qemu-devel] [PATCH v6 00/12] tests: Add VM based build tests (for non-x86_64 and/or non-Linux) Fam Zheng
2017-09-05 2:11 ` [Qemu-devel] [PATCH v6 01/12] gitignore: Ignore vm test images Fam Zheng
2017-09-08 14:12 ` Alex Bennée
2017-09-08 23:12 ` Fam Zheng
2017-09-05 2:11 ` [Qemu-devel] [PATCH v6 02/12] qemu.py: Add "wait()" method Fam Zheng
2017-09-08 14:13 ` Alex Bennée
2017-09-05 2:11 ` [Qemu-devel] [PATCH v6 03/12] scripts: Add archive-source.sh Fam Zheng
2017-09-08 14:42 ` Alex Bennée
2017-09-08 23:14 ` Fam Zheng
2017-09-11 13:43 ` Alex Bennée
2017-09-12 0:06 ` Fam Zheng
2017-09-08 14:56 ` Peter Maydell
2017-09-08 23:13 ` Fam Zheng
2017-09-05 2:11 ` [Qemu-devel] [PATCH v6 04/12] tests: Add vm test lib Fam Zheng
2017-09-08 15:22 ` Alex Bennée
2017-09-08 23:29 ` Fam Zheng
2017-09-09 1:25 ` Philippe Mathieu-Daudé
2017-09-09 4:10 ` Fam Zheng [this message]
2017-09-11 10:44 ` Alex Bennée
2017-09-12 0:10 ` Fam Zheng
2017-09-05 2:11 ` [Qemu-devel] [PATCH v6 05/12] tests: Add ubuntu.i386 image Fam Zheng
2017-09-05 2:11 ` [Qemu-devel] [PATCH v6 06/12] tests: Add FreeBSD image Fam Zheng
2017-09-05 2:11 ` [Qemu-devel] [PATCH v6 07/12] tests: Add NetBSD image Fam Zheng
2017-09-05 2:11 ` [Qemu-devel] [PATCH v6 08/12] tests: Add OpenBSD image Fam Zheng
2017-09-05 2:11 ` [Qemu-devel] [PATCH v6 09/12] Makefile: Add rules to run vm tests Fam Zheng
2017-09-05 2:11 ` [Qemu-devel] [PATCH v6 10/12] MAINTAINERS: Add tests/vm entry Fam Zheng
2017-09-05 2:12 ` [Qemu-devel] [PATCH v6 11/12] tests: Add README for vm tests Fam Zheng
2017-09-05 2:12 ` [Qemu-devel] [PATCH v6 12/12] docker: Use archive-source.py Fam Zheng
2017-09-08 16:20 ` [Qemu-devel] [PATCH v6 00/12] tests: Add VM based build tests (for non-x86_64 and/or non-Linux) Alex Bennée
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170909041036.GF18677@lemon.lan \
--to=famz@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=crosa@redhat.com \
--cc=f4bug@amsat.org \
--cc=kamil@netbsd.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.