From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qu6xT-0001wk-Fk for qemu-devel@nongnu.org; Thu, 18 Aug 2011 14:04:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qu6xR-000572-NQ for qemu-devel@nongnu.org; Thu, 18 Aug 2011 14:04:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25266) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qu6xR-00056w-GM for qemu-devel@nongnu.org; Thu, 18 Aug 2011 14:04:45 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7II4idi030121 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 18 Aug 2011 14:04:44 -0400 Date: Thu, 18 Aug 2011 11:04:41 -0700 From: "Daniel P. Berrange" Message-ID: <20110818180441.GB2973@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Subject: [Qemu-devel] VMState assertion for USB devices on multiple buses Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hans de Goede , Gerd Hoffman I've been experimenting with multiple USB2 buses, and device physical port addressing. It seems if you have 2 devices of the same type on the same port, but in different buses, you get a bogus VMState assertion failure # qemu-system-x86_64 \ -nodefconfig -nodefaults \ -vnc 127.0.0.1:0 -vga cirrus -monitor stdio \ -device ich9-usb-ehci1,addr=1d.7,multifunction=on,id=ehci0 \ -device ich9-usb-uhci1,addr=1d.0,multifunction=on,id=uhci0-1,masterbus=ehci0.0,firstport=0 \ -device ich9-usb-uhci2,addr=1d.1,multifunction=on,id=uhci0-2,masterbus=ehci0.0,firstport=2 \ -device ich9-usb-uhci3,addr=1d.2,multifunction=on,id=uhci0-3,masterbus=ehci0.0,firstport=4 \ -device usb-tablet,bus=ehci0.0,port=1,id=t1 \ -device ich9-usb-ehci1,addr=1c.7,multifunction=on,id=ehci1 \ -device ich9-usb-uhci1,addr=1c.0,multifunction=on,id=uhci1-1,masterbus=ehci1.0,firstport=0 \ -device ich9-usb-uhci2,addr=1c.1,multifunction=on,id=uhci1-2,masterbus=ehci1.0,firstport=2 \ -device ich9-usb-uhci3,addr=1c.2,multifunction=on,id=uhci1-3,masterbus=ehci1.0,firstport=4 \ -device usb-tablet,bus=ehci1.0,port=1,id=t2 *** EHCI support is under development *** *** EHCI support is under development *** qemu-system-x86_64: savevm.c:1260: vmstate_register_with_alias_id: Assertion `!se->compat || se->instance_id == 0' failed. Aborted If I have a CCID on one bus, and tablet on the other it works # qemu-system-x86_64 \ -nodefconfig -nodefaults \ -vnc 127.0.0.1:0 -vga cirrus -monitor stdio \ -device ich9-usb-ehci1,addr=1d.7,multifunction=on,id=ehci0 \ -device ich9-usb-uhci1,addr=1d.0,multifunction=on,id=uhci0-1,masterbus=ehci0.0,firstport=0 \ -device ich9-usb-uhci2,addr=1d.1,multifunction=on,id=uhci0-2,masterbus=ehci0.0,firstport=2 \ -device ich9-usb-uhci3,addr=1d.2,multifunction=on,id=uhci0-3,masterbus=ehci0.0,firstport=4 \ -device usb-tablet,bus=ehci0.0,port=1,id=t1 \ -device ich9-usb-ehci1,addr=1c.7,multifunction=on,id=ehci1 \ -device ich9-usb-uhci1,addr=1c.0,multifunction=on,id=uhci1-1,masterbus=ehci1.0,firstport=0 \ -device ich9-usb-uhci2,addr=1c.1,multifunction=on,id=uhci1-2,masterbus=ehci1.0,firstport=2 \ -device ich9-usb-uhci3,addr=1c.2,multifunction=on,id=uhci1-3,masterbus=ehci1.0,firstport=4 \ -device usb-ccid,bus=ehci1.0,port=1,id=t2 But if I have 2 CCID devices, then I see failure again # qemu-system-x86_64 \ -nodefconfig -nodefaults \ -vnc 127.0.0.1:0 -vga cirrus -monitor stdio \ -device ich9-usb-ehci1,addr=1d.7,multifunction=on,id=ehci0 \ -device ich9-usb-uhci1,addr=1d.0,multifunction=on,id=uhci0-1,masterbus=ehci0.0,firstport=0 \ -device ich9-usb-uhci2,addr=1d.1,multifunction=on,id=uhci0-2,masterbus=ehci0.0,firstport=2 \ -device ich9-usb-uhci3,addr=1d.2,multifunction=on,id=uhci0-3,masterbus=ehci0.0,firstport=4 \ -device usb-ccid,bus=ehci0.0,port=1,id=t1 \ -device ich9-usb-ehci1,addr=1c.7,multifunction=on,id=ehci1 \ -device ich9-usb-uhci1,addr=1c.0,multifunction=on,id=uhci1-1,masterbus=ehci1.0,firstport=0 \ -device ich9-usb-uhci2,addr=1c.1,multifunction=on,id=uhci1-2,masterbus=ehci1.0,firstport=2 \ -device ich9-usb-uhci3,addr=1c.2,multifunction=on,id=uhci1-3,masterbus=ehci1.0,firstport=4 \ -device usb-ccid,bus=ehci1.0,port=1,id=t2 *** EHCI support is under development *** *** EHCI support is under development *** qemu-system-x86_64: savevm.c:1260: vmstate_register_with_alias_id: Assertion `!se->compat || se->instance_id == 0' failed. Aborted AFAICT, the problem is that the 'se->idstr' field in the SaveStateEntry struct is not getting a unique enough value. Both the USB devices get idstr named "1/usb-ccid", which IIUC is a combination of the device type and the port number. IMHO, it needs to have the USB bus name in there too eg. in this example it should have been ehci0.0/1/usb-ccid ehci1.0/1/usb-ccid Regrads, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|