From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ue3Wm-0005wN-2J for qemu-devel@nongnu.org; Sun, 19 May 2013 09:20:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ue3Wh-0005eA-Ew for qemu-devel@nongnu.org; Sun, 19 May 2013 09:19:56 -0400 Received: from mail-ee0-f54.google.com ([74.125.83.54]:52245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ue3Wh-0005e4-85 for qemu-devel@nongnu.org; Sun, 19 May 2013 09:19:51 -0400 Received: by mail-ee0-f54.google.com with SMTP id e50so3559720eek.13 for ; Sun, 19 May 2013 06:19:50 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5198D16E.4070505@redhat.com> Date: Sun, 19 May 2013 15:19:42 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: , <51978858.3010205@redhat.com> <5198CC88.1090709@redhat.com> In-Reply-To: <5198CC88.1090709@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Writing a CAN driver for QEMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gedare Bloom , Amar Takhar , Petr Benes , Thomas Doerfler , "Sebastian.Huber@embedded-brains.de" , "Rempel, Cynthia" , "qemu-devel@nongnu.org" , Jennifer Averett , Chris Johns , Cl?udio Silva , Joel Sherrill , Pavel Pisa Il 19/05/2013 14:58, Paolo Bonzini ha scritto: > Is this CAN device just an Ethernet device? QEMU does not support other > link-level protocols. Adding them would be possible and interesting, > however it would add a bit to the complexity. > > Both would be the same. In the first case, you'd probably use "-netdev > socket" to share a virtual network between two virtual machines. In the > second, you would use something like "-netdev tap" (again assuming it's > just an Ethernet device). Ok, learnt a bit more... You could probably implement this in two ways: 1) "-netdev socket" would probably work as a CAN->UDP gateway; 2) connecting to a virtual CAN interface in the host, created using SocketCAN (similar to "-netdev tap", e.g. "-netdev cantap"). In the first case, it would probably be useful to write the matching UDP->CAN gateway program. In any case, you have to implement both the backend and the actual device. Paolo