[libvirt] Device attach / detach problem for passthrough/SR-IOV in libvirt

Jiri Denemark jdenemar at redhat.com
Fri Mar 28 10:14:11 UTC 2014


On Fri, Mar 28, 2014 at 10:34:59 +0100, Michal Privoznik wrote:
> On 27.03.2014 13:53, Mohsen Ghaemi wrote:
> > Hi all
> >
> > I just encountered a problem in libvirt while was trying to attach and
> > detach a sr-iov vf to my VM
> >
> >
> > The version of my libvirt is 1.1.1-0ubuntu8.5
> >
> >
> > I tried to attach the device using following xml
> >
> >
> > <interface type='hostdev' managed='yes'>
> >
> >     <mac address='5c:01:fd:12:34:58'/>
> >
> >     <source>
> >
> >         <address type='pci' domain='0x0000' bus='0x04' slot='0x01'
> > function='0x1'/>
> >
> >     </source>
> >
> > </interface>
> >
> >
> > When i attached device it worked properly and i managed to ping another
> > host.
> >
> >
> > virsh # attach-device t5 1.xml
> >
> > Device attached successfully
> >
> >
> > But when i detached it still i had network traffic in my VM but libvirt
> > (virsh) said that
> >
> >
> > virsh # detach-device t5 1.xml
> >
> > Device detached successfully

Could you run "virsh dumpxml t5" at this point so that we can see if the
interface was really removed? The message from detach-device is not
always correct (and I'm working on fixing it) since some devices need
guest cooperation to be detached and thus this "Device detached
successfully" may just mean that we successfully asked the guest to
remove the device but it was not in fact removed yet.

Jirka




More information about the libvir-list mailing list