[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libvirt-users
Subject:    Re: CAN virtualization
From:       Martin Kletzander <mkletzan () redhat ! com>
Date:       2023-08-29 7:16:17
Message-ID: ZO2bQc3-X21k3oSs () wheatley ! k8r ! cz
[Download RAW message or body]


On Wed, Aug 23, 2023 at 01:15:36PM +0000, S=E1nta, M=E1rton (ext) wrote:
>Dear Users,
>
>I use KVM with libvirt 9.0.0. The host and guest OS-es are also AGL needle=
fish images. I am currently trying to virtualize a CAN driver and provide v=
irtual machines access to the physical CAN channels.
>
>I started with the virtual network handling as CAN interface is a network =
interface, I tried to find analogies, solutions like "traditional" network =
handling but it did not work.
>I also tried out to define a nodedev device via .xml config file. The inte=
resting thing is, that when I list all the available nodedev devices with '=
virsh nodedev-list', I can see 'net_can0' and 'net_can1' on the output as '=
net' type device but I cannot attach these devices to the guests, and I do =
not know how to define it in the guest .xml file. I tried out many differen=
t things, but when I try to add it as a 'hostdev' device with different mod=
e and type settings, I always get an error (e.g. not a PCI device or not su=
pported device type etc.). It would be long to write down all the configura=
tions I tried out, so my first question would be that does anybody know how=
 could I provide access to guests to the physical CAN interfaces? The aim i=
s to be able to send CAN messages from guest OS-es. If no direct access is =
possible, it would be also OK to have access to virtual CAN interfaces on t=
he host and then transfer messages to the physical CAN channel.
>

Hi.  CAN devices need a couple more specifications for how the device
should be created and even though your analogy went the right way
libvirt does not (yet) support CAN device emulation for any hypervisor
driver.  I had a plan to write it at some point, but I saw nobody
requesting that and did not have enough free time to do that.

For completeness sake; the fact that you see the devices in nodedev-list
is a consequence of us not filtering the devices at all, just reporting
on what we find on the host.

Patches would be appreciated, I myself won't probably get to adding such
support any time soon.

Have a nice day,
Martin

>Thank you in advance for an early reply!
>
>Best regard,
>
>M=E1rton S=E1nta
>
>
>This transmission is intended solely for the addressee and contains confid=
ential information.
>If you are not the intended recipient, please immediately inform the sende=
r and delete the message and any attachments from your system.
>Furthermore, please do not copy the message or disclose the contents to an=
yone unless agreed otherwise. To the extent permitted by law we shall in no=
 way be liable for any damages, whatever their nature, arising out of trans=
mission failures, viruses, external influence, delays and the like.

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic