From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsY9C-0006E5-PL for qemu-devel@nongnu.org; Fri, 28 Jun 2013 08:51:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsY9B-0003Zx-KM for qemu-devel@nongnu.org; Fri, 28 Jun 2013 08:51:30 -0400 Received: from cantor2.suse.de ([195.135.220.15]:36551 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsY9B-0003Zi-AQ for qemu-devel@nongnu.org; Fri, 28 Jun 2013 08:51:29 -0400 Message-ID: <51CD86CD.9060809@suse.de> Date: Fri, 28 Jun 2013 14:51:25 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] CAN device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yang Jin Cc: qemu-devel@nongnu.org Hi, Am 28.06.2013 14:19, schrieb Yang Jin: > I try to develop a CAN device on QEMU. And I found pci-serial is simila= r > to CAN.=20 >=20 > Untill now, I have some questions about how to use pci-serial on QEMU. > Actually, QEMU use isa-serial as a default serial device. So I try to > use isa-serial firstly. >=20 > Some useful information we can get from docs/qdev-device-use.txt. I kno= w > that we should use "-chardev" argument to create a host part, and then > use "-device isa-serial,iobase=3DIOADDR,irq=3DIRQ,index=3DIDX" to start= a > isa-serial. I get those arguments from the source file, the following > can work. > "-device isa-serial,chardev=3Disa0,iobase=3D0x3f8,irq=3D4,index=3D0" > However, when I try to create a host through "-chardev > serial,id=3Disa0,path=3D./", error "chardev: opening backend "serial" > failed" occurs. When change it to "-chardev > serial,id=3Disa0,path=3D/dev/ttyS0", it works. Now, I donot know what "= path" > means? Does it have some relation to the host device? Or it's just a > symbol means nothing. Searching man qemu for "chardev serial" should answer that question. :) There you will also find alternative chardev backends you can use. > And some questions about pci bus. On docs/qdev-device-use.txt, we get > Example: device i440FX-pcihost is on the root bus, and provides a PCI > bus named pci.0. To put a FOO device into its slot 4, use -device > FOO,bus=3D/i440FX-pcihost/pci.0,addr=3D4. The abbreviated form bus=3Dp= ci.0 > also works as long as the bus name is unique. > So, how can we get the name of the root device which we use now? You can browse the QOM hierarchy using the ./QMP/qom-list script and an appropriate -qmp option (e.g. unix:./qmp-sock,server,nowait). But leaving out the bus=3D option should work fine just as well. Regards, Andreas > I searched that for some days, but doesnot get some usefull information= . >=20 > Thanks, > Jin yang. --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg