From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>,
qemu-devel@nongnu.org, Cleber Rosa <crosa@redhat.com>
Subject: Re: [Qemu-devel] [RFC 6/6] device-crash-test: Multi-device device_add test
Date: Wed, 27 Sep 2017 17:47:36 +0100 [thread overview]
Message-ID: <20170927164735.GE2108@work-vm> (raw)
In-Reply-To: <92296b86-9676-c4a8-cf54-537e3641609a@redhat.com>
* Thomas Huth (thuth@redhat.com) wrote:
> On 27.09.2017 01:07, Eduardo Habkost wrote:
> > When running device_add tests, test all devices in a single run
> > instead of restarting QEMU every time.
> >
> > There's a plug_all testcase argument that can be used to make the
> > test code plug all devices at once. I'm adding this mode because
> > there's a crash that was detected while testing the script
> > without any device_del command, but the crash goes away if we
> > device_del every device immediately:
> >
> > $ ../scripts/device-crash-test ./x86_64-softmmu/qemu-system-x86_64 --quick -t method=device_add --strict -t plug_all=1
> > INFO: running test case: binary=./x86_64-softmmu/qemu-system-x86_64 plug_all=1 accel=kvm machine=pc-0.12 device=* method=device_add
> > WARNING: qemu received signal -6: ./x86_64-softmmu/qemu-system-x86_64 -chardev socket,id=mon,path=/var/tmp/qemu-23578-monitor.sock -mon chardev=mon,mode=control -display none -vga none -S -machine pc-0.12,accel=kvm
> > ERROR: result: binary=./x86_64-softmmu/qemu-system-x86_64 plug_all=1 accel=kvm machine=pc-0.12 device=* method=device_add
> > ERROR: cmdline: ./x86_64-softmmu/qemu-system-x86_64 -S -machine pc-0.12,accel=kvm
> > ERROR: log: audio: Could not init `oss' audio driver
> > ERROR: log: qemu-system-x86_64: .../qemu/migration/savevm.c:721: vmstate_register_with_alias_id: Assertion `!se->compat || se->instance_id == 0' failed.
> > ERROR: last device_add device: usb-net
>
> FWIW, I've seen similar crashes while working on my HMP device_add
> tester, when I skipped the device_del and plugged-in the devices a
> couple of times instead. I think this happens because some devices are
> doing a vmstate_register() in their instance_init() or realize()
> function, instead of using dc->vmsd as they should. However, with the
> git master branch as of today (31bc1d8481af414cfa2857f905e), I am
> currently not able anymore to reproduce the problem with the HMP
> device_add tester, so one of the recent "set user_creatable = false"
> patches might have fixed the issue for me already...
I think I've seen this problem when two things end up trying to register
with the same migration name; I'll be honest I can't remember the
details, but I think the choice is either between having a full bus
name, e.g.
pci-xx:yy.z:aa:bb:.c:...... then similar for the USB chain
or
mydevice + number
where number is the instance=id. So to hit this I think
it's typically a case of messing up that long path and it no
longer being unique.
Printing the path in vmstate_register_with_alias_id after the
pstrcat might help.
I did add some sanity checking in there for a case I'd
previously hit where the name just got truncated, but I don't
think you should be able to hit that any more.
Dave
> Thomas
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
prev parent reply other threads:[~2017-09-27 16:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-26 23:07 [Qemu-devel] [RFC 0/6] device-crash-test: device_add test mode Eduardo Habkost
2017-09-26 23:07 ` [Qemu-devel] [RFC 1/6] device-crash-test: Make whitelist code a bit more flexible Eduardo Habkost
2017-09-26 23:07 ` [Qemu-devel] [RFC 2/6] device-crash-test: Log detailed info on success too Eduardo Habkost
2017-09-26 23:07 ` [Qemu-devel] [RFC 3/6] device-crash-test: Allow checkOneCase() to report multiple results Eduardo Habkost
2017-09-26 23:07 ` [Qemu-devel] [RFC 4/6] device-crash-test: Exit immediately on fatal failures on quick mode Eduardo Habkost
2017-09-26 23:07 ` [Qemu-devel] [RFC 5/6] device-crash-test: Basic device_add support Eduardo Habkost
2017-09-26 23:07 ` [Qemu-devel] [RFC 6/6] device-crash-test: Multi-device device_add test Eduardo Habkost
2017-09-27 11:17 ` Thomas Huth
2017-09-27 16:47 ` Dr. David Alan Gilbert [this message]
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=20170927164735.GE2108@work-vm \
--to=dgilbert@redhat.com \
--cc=crosa@redhat.com \
--cc=ehabkost@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).