Greetings Michal,
I think I might be doing something wrong, all the devices are defined a such:
<interface type='network'>
<mac address='52:54:xx:xx:xx:xx'/>
<source network='mynet'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x10'
slot='0x0x' function='0x0'/>
</interface>
and I still cannot get vfio to attached to them.
they are autobinded to virtio_pci so I had to unbind them first
when I reload the vfio module, I get the same errors below
I'm trying to attach it inside a running guest, in short, I want to be able to pass a
vNIC to a nested guest for development reasons
Thanks,
Dagg
> Sent: Thursday, June 13, 2024 at 5:45 PM
> From: "Michal Prívozník" <mprivozn(a)redhat.com>
> To: "daggs" <daggs(a)gmx.com>, users(a)lists.libvirt.org
> Subject: Re: vfio usage in a vm
>
> On 6/12/24 20:24, daggs via Users wrote:
> > Greetings,
> >
> > I wanted to know if it is possible to attach a virtual nic (shows up as 02:01.0
Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet
Adapter (rev 20)) to the vfio module, when I modprobe it I get this error:
> > [ 854.624668] vfio-pci: probe of 0000:02:01.0 failed with error -22
>
>
> No, you need to declare the vNIC with model 'virtio':
>
> <interface type='network'>
> <mac address='52:54:00:XX:XX:XX'/>
> <source network='default'/>
> <model type='virtio'/>
> </interface>
>
> Virtio is an interface that allows more effective data transfer between
> host and guest [1][2]. It's a paravirtualized device. In other words, if
> you started a guest and told hypervisor to emulate RTL8139 NIC then
> it'll do just that.
>
> 1:
https://wiki.osdev.org/Virtio
> 2:
https://wiki.libvirt.org/Virtio.html
>
> Michal
>
>