RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1066825 - failed to start guest with "<interface type='hostdev'>" type vf
Summary: failed to start guest with "<interface type='hostdev'>" type vf
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: kernel
Version: 7.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Virtualization Maintenance
QA Contact: William Gomeringer
URL:
Whiteboard:
: 1069548 (view as bug list)
Depends On:
Blocks: 1067873 1069548 1073810
TreeView+ depends on / blocked
 
Reported: 2014-02-19 07:43 UTC by Xuesong Zhang
Modified: 2018-07-18 05:12 UTC (History)
19 users (show)

Fixed In Version: kernel-3.10.0-105.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1069548 (view as bug list)
Environment:
Last Closed: 2014-06-13 13:17:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Xuesong Zhang 2014-02-19 07:43:53 UTC
Description of problem:
Failed to start one guest, while assign one vf with "<interface='hostdev'>" type.

Version-Release number of selected component (if applicable):
libvirt-1.1.1-23.el7.x86_64
qemu-kvm-rhev-1.5.3-45.el7.x86_64
kernel-3.10.0-86.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. find one SR-IOV host.
# lspci|grep 82576
03:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
03:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
03:10.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
03:10.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
03:10.2 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
03:10.3 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
03:10.4 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
03:10.5 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
03:10.6 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
03:10.7 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
03:11.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
03:11.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
03:11.2 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
03:11.3 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
03:11.4 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
03:11.5 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)

2. add one vf to the guest, note use the type "<interface type='hostdev'>"
    <interface type='hostdev'>
       <mac address='52:54:00:a5:e7:f6'/>
      <driver name='vfio'/>
      <source>
        <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x6'/>
      </source>
    </interface>

3. start the guest
# virsh start b
error: Failed to start domain b
error: internal error: couldn't find IFLA_VF_INFO for VF 3 in netlink response

4. if change the vf to the first vf 03:10.0, the start error is different, it is the following one:
# virsh start b
error: Failed to start domain b
error: Path '/dev/vfio/22' is not accessible: No such file or directory

5. while hot-plug one vf from hostdev network, will also meet the error in step3, seem like same root reason.
5.1 prepare one hostdev network:
# virsh net-dumpxml hostnet
<network>
  <name>hostnet</name>
  <uuid>c64f5418-4287-4152-83af-e944215fb824</uuid>
  <forward mode='hostdev' managed='yes'>
    <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x0'/>
    <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x1'/>
    <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x2'/>
    <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x3'/>
  </forward>
</network>

5.2 hot-plug one vf from hostdev network via attach-interface command.
# virsh attach-interface b network hostnet
error: Failed to attach interface
error: internal error: couldn't find IFLA_VF_INFO for VF 1 in netlink response

Actual results:
as step 3, 4 and 5.2

Expected results:
It should be successfully in step 3, 4 and 5.2, the guest should be start up successfully or hot-plug vf successfully.

Additional info:
This scenarios is working well before in build libvirt-1.1.1-17.el7, please see the other bug comment for reference: https://bugzilla.redhat.com/show_bug.cgi?id=1046337#c3

Comment 1 Xuesong Zhang 2014-02-20 06:36:40 UTC
I change the libvirt version to libvirt-1.1.1-17.el7.x86_64 only, other package keep same version with the bug description. The issue is still occurred.

Sorry, it seems not one libvirt bug, like some other component issue.


Here is the package version:
libvirt-1.1.1-17.el7.x86_64------(Which one is working well before)
qemu-kvm-rhev-1.5.3-48.el7.x86_64
libnl-1.1.4-3.el7.x86_64
kernel-3.10.0-89.el7.x86_64

Comment 2 Yulong Pei 2014-02-25 07:08:44 UTC
also bumped into this issue on I350

[root@ibm-x3650m4-01 sriov_test]# uname -r
3.10.0-89.el7.x86_64

[root@ibm-x3650m4-01 sriov_test]# lspci |grep -i i350
06:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
06:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
06:00.2 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
06:00.3 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
07:10.0 Ethernet controller: Intel Corporation I350 Ethernet Controller Virtual Function (rev 01)
07:10.1 Ethernet controller: Intel Corporation I350 Ethernet Controller Virtual Function (rev 01)
07:10.2 Ethernet controller: Intel Corporation I350 Ethernet Controller Virtual Function (rev 01)
07:10.3 Ethernet controller: Intel Corporation I350 Ethernet Controller Virtual Function (rev 01)
07:10.4 Ethernet controller: Intel Corporation I350 Ethernet Controller Virtual Function (rev 01)
07:10.5 Ethernet controller: Intel Corporation I350 Ethernet Controller Virtual Function (rev 01)
07:10.6 Ethernet controller: Intel Corporation I350 Ethernet Controller Virtual Function (rev 01)
07:10.7 Ethernet controller: Intel Corporation I350 Ethernet Controller Virtual Function (rev 01)

[root@ibm-x3650m4-01 sriov_test]# cat igb_vf.xml 
<interface type='hostdev' managed='yes'>
  <mac address='00:13:93:23:32:61'/>
  <source>
    <address type='pci' domain='0x0000' bus='0x07' slot='0x10' function='0x5'/>
  </source>
</interface>

[root@ibm-x3650m4-01 sriov_test]# virsh attach-device vm1 igb_vf.xml 
error: Failed to attach device from igb_vf.xml
error: internal error: couldn't find IFLA_VF_INFO for VF 1 in netlink response

Comment 3 Yulong Pei 2014-02-25 07:13:15 UTC
it blocked igb driver sr-iov feature testing, so set it TestBlocker.

Comment 4 Laine Stump 2014-02-26 12:28:37 UTC
(In reply to Zhang Xuesong from comment #1)
> I change the libvirt version to libvirt-1.1.1-17.el7.x86_64 only, other
> package keep same version with the bug description. The issue is still
> occurred.
> 
> Sorry, it seems not one libvirt bug, like some other component issue.
> 
> 
> Here is the package version:
> libvirt-1.1.1-17.el7.x86_64------(Which one is working well before)
> qemu-kvm-rhev-1.5.3-48.el7.x86_64
> libnl-1.1.4-3.el7.x86_64
> kernel-3.10.0-89.el7.x86_64

The most likely candidate is the kernel (since it appears that the only rebuilds of libnl have been as a part of the mass auto-rebuilds, and qemu isn't involved at all with the netlink commands to get the VFINFO - it's not even running yet at that point).

Please boot with an older kernel and see if the problem goes away. If so, move this BZ to kernel.

Comment 5 Laine Stump 2014-02-26 12:38:05 UTC
BTW, in RHEL7, it is the "libnl3" package that is used by libvirt, not "libnl" (which is deprecated, and really should be removed, but can't be because I believe some packages are still using it).

Comment 6 Thomas Graf 2014-02-26 15:49:29 UTC
Fixed in libnl3-3.2.21-5.el7

*** This bug has been marked as a duplicate of bug 1069548 ***

Comment 7 Laine Stump 2014-02-26 19:37:53 UTC
I'm actually not so sure that this is the same libnl problem (unfortunately I'm not in the room with my RHEL7 mahcine right now, and it is currently running Fedora, so I can't test to verify until tomorrow morning).

Here's why:

1) the "ip" command doesn't use libnl, it directly calls netlink.

2) With kernel-3.10.0-50 on my test machine, the output of "ip link show" for one of my PFs is:

11: enp4s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000
    link/ether a0:36:9f:24:c2:53 brd ff:ff:ff:ff:ff:ff
    vf 0 MAC e2:b0:f2:8e:eb:53, spoof checking on, link-state auto
    vf 1 MAC ea:7f:82:72:1b:6b, spoof checking on, link-state auto
    vf 2 MAC 16:06:3f:0b:3a:f7, spoof checking on, link-state auto
    vf 3 MAC ee:7b:e4:ca:52:4d, spoof checking on, link-state auto
    vf 4 MAC 2a:d1:1a:ea:9c:86, spoof checking on, link-state auto
    vf 5 MAC ba:e6:99:95:07:42, spoof checking on, link-state auto
    vf 6 MAC aa:1c:22:24:65:7f, spoof checking on, link-state auto

3) When I boot with everything else identical, but using kernel-3.10.0-95, I get this:

4: enp4s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000
    link/ether a0:36:9f:24:c2:53 brd ff:ff:ff:ff:ff:ff
    vf 0 MAC a6:7e:03:f4:60:c7, spoof checking on, link-state auto

4) In both cases, ip link show gives output for all 7 VFs, but with the newer kernel, there is no VF info in the PF.

(I have "options igb max_vfs=7" in /etc/modprobe.d/local.conf)

Since iproute2 doesn't use libnl, and it is also not showing all the VFs, I think there may be a completely different problem in the kernel itself.

I will check again tomorrow after upgrading libnl3.

Comment 8 Xuesong Zhang 2014-02-27 06:34:27 UTC
hi, Laine,

From the test result, it seems you are right, this bug reason is not the same with BZ 104626 (libnl3 issue).
After update the libnl3 package to the fixed version libnl3-3.2.21-5.el7.x86_64, this issue is still there, note that I also update all other package included the kernel.
I notice you mentioned the "ip" command, is it the iproute component issue? or kernel component?

# which ip
/usr/sbin/ip
# rpm -qf /usr/sbin/ip
iproute-3.10.0-13.el7.x86_64


Package version:
libvirt-1.1.1-25.el7.x86_64
qemu-kvm-rhev-1.5.3-50.el7.x86_64
kernel-3.10.0-97.el7.x86_64
libnl3-3.2.21-5.el7.x86_64
iproute-3.10.0-13.el7.x86_64

Test result:
1. failed to hot-plug one vf to the guest.Note: the vf is not the 1st generated vf.
# virsh attach-device b inter-hostdev-vfio.xml 
error: Failed to attach device from inter-hostdev-vfio.xml
error: internal error: couldn't find IFLA_VF_INFO for VF 1 in netlink response

2. failed to hot-plug vf to guest. Note: the vf is the 1st generated vf.
#virsh attach-device b inter-hostdev-vfio.xml 
error: Failed to attach device from inter-hostdev-vfio.xml
error: Path '/dev/vfio/22' is not accessible: No such file or directory

Comment 9 Xuesong Zhang 2014-02-27 06:35:47 UTC
(In reply to Zhang Xuesong from comment #8)
> hi, Laine,
> 
> From the test result, it seems you are right, this bug reason is not the
> same with BZ 104626 (libnl3 issue).

Sorry, there is one typo, should be BZ 1040626.

> After update the libnl3 package to the fixed version
> libnl3-3.2.21-5.el7.x86_64, this issue is still there, note that I also
> update all other package included the kernel.
> I notice you mentioned the "ip" command, is it the iproute component issue?
> or kernel component?
> 
> # which ip
> /usr/sbin/ip
> # rpm -qf /usr/sbin/ip
> iproute-3.10.0-13.el7.x86_64
> 
> 
> Package version:
> libvirt-1.1.1-25.el7.x86_64
> qemu-kvm-rhev-1.5.3-50.el7.x86_64
> kernel-3.10.0-97.el7.x86_64
> libnl3-3.2.21-5.el7.x86_64
> iproute-3.10.0-13.el7.x86_64
> 
> Test result:
> 1. failed to hot-plug one vf to the guest.Note: the vf is not the 1st
> generated vf.
> # virsh attach-device b inter-hostdev-vfio.xml 
> error: Failed to attach device from inter-hostdev-vfio.xml
> error: internal error: couldn't find IFLA_VF_INFO for VF 1 in netlink
> response
> 
> 2. failed to hot-plug vf to guest. Note: the vf is the 1st generated vf.
> #virsh attach-device b inter-hostdev-vfio.xml 
> error: Failed to attach device from inter-hostdev-vfio.xml
> error: Path '/dev/vfio/22' is not accessible: No such file or directory

Comment 10 Laine Stump 2014-02-27 09:27:58 UTC
(In reply to Zhang Xuesong from comment #8)
> From the test result, it seems you are right, this bug reason is not the
> same with BZ 104626 (libnl3 issue).
> After update the libnl3 package to the fixed version
> libnl3-3.2.21-5.el7.x86_64, this issue is still there, note that I also
> update all other package included the kernel.

I've also verified that the problem still remains (both with libvirt and with "ip link show" after updating to the latest libnl3 build.

> I notice you mentioned the "ip" command, is it the iproute component issue?
> or kernel component?

Since the behavior is common to both iproute and libvirt+libnl3, the problem is in the kernel (which is the only piece in common.


> Test result:
> 1. failed to hot-plug one vf to the guest.Note: the vf is not the 1st
> generated vf.
> # virsh attach-device b inter-hostdev-vfio.xml 
> error: Failed to attach device from inter-hostdev-vfio.xml
> error: internal error: couldn't find IFLA_VF_INFO for VF 1 in netlink
> response

This is because the IFLA_VF_INFO response contains only the first VF (vf0).

Note that when you list /sys/bus/pci/devices/$PF-directory, you will see all of the VFs listed as "virtfnN".

I also tried writing "0" to sriov_numvfs, then writing "7". No error was indicated, and the virtfnN links disappeared and reappeared, but the vfs were still missing from the ip link show output of the PF.

In light of all this, I am re-opening this bug and assigning it to kernel. (it still has blocker? and the "TestBlocker" tag).

> 
> 2. failed to hot-plug vf to guest. Note: the vf is the 1st generated vf.
> #virsh attach-device b inter-hostdev-vfio.xml 
> error: Failed to attach device from inter-hostdev-vfio.xml
> error: Path '/dev/vfio/22' is not accessible: No such file or directory

In this case, you are attempting to pass through vf0, which *is* in the IFLA_VF_INFO output, so that part is succeeding, but you're hitting a separate problem later on. This error message is one that would previously show up as a side-effect of some other error, for example if vfio wasn't properly loaded, but I thought all those bugs had been fixed. Can you look in your log files for this same message, then see if libvirt has logged some other message just prior?

(fyi, I didn't see this error when I started a domain with vf0 attached)

Comment 11 Alex Williamson 2014-02-27 15:24:46 UTC
(In reply to Laine Stump from comment #10)
> (In reply to Zhang Xuesong from comment #8)
> > 2. failed to hot-plug vf to guest. Note: the vf is the 1st generated vf.
> > #virsh attach-device b inter-hostdev-vfio.xml 
> > error: Failed to attach device from inter-hostdev-vfio.xml
> > error: Path '/dev/vfio/22' is not accessible: No such file or directory
> 
> In this case, you are attempting to pass through vf0, which *is* in the
> IFLA_VF_INFO output, so that part is succeeding, but you're hitting a
> separate problem later on. This error message is one that would previously
> show up as a side-effect of some other error, for example if vfio wasn't
> properly loaded, but I thought all those bugs had been fixed. Can you look
> in your log files for this same message, then see if libvirt has logged some
> other message just prior?
> 
> (fyi, I didn't see this error when I started a domain with vf0 attached)

I suspect this problem is because the xml from the original post does not included managed=yes and the device is therefore not attached to vfio-pci.  The user needs to explicitly virsh nodedev-detach the device without managed=yes.

Comment 12 Alex Williamson 2014-02-27 15:51:00 UTC
Bisecting kernel rpms with the 'ip link show' test, the problem was introduced in kernel 86.  I'll bisect the changes added for that kernel.

Comment 15 Xuesong Zhang 2014-02-28 03:16:33 UTC
(In reply to Alex Williamson from comment #11)
> (In reply to Laine Stump from comment #10)
> > (In reply to Zhang Xuesong from comment #8)
> > > 2. failed to hot-plug vf to guest. Note: the vf is the 1st generated vf.
> > > #virsh attach-device b inter-hostdev-vfio.xml 
> > > error: Failed to attach device from inter-hostdev-vfio.xml
> > > error: Path '/dev/vfio/22' is not accessible: No such file or directory
> > 
> > In this case, you are attempting to pass through vf0, which *is* in the
> > IFLA_VF_INFO output, so that part is succeeding, but you're hitting a
> > separate problem later on. This error message is one that would previously
> > show up as a side-effect of some other error, for example if vfio wasn't
> > properly loaded, but I thought all those bugs had been fixed. Can you look
> > in your log files for this same message, then see if libvirt has logged some
> > other message just prior?
> > 
> > (fyi, I didn't see this error when I started a domain with vf0 attached)
> 
> I suspect this problem is because the xml from the original post does not
> included managed=yes and the device is therefore not attached to vfio-pci. 
> The user needs to explicitly virsh nodedev-detach the device without
> managed=yes.

Sorry, didn't add "managed=yes" in the attached xml. After add it, the first generated VF is working well while both hot-plug and pci passthrough method.

Comment 16 Thomas Graf 2014-03-03 11:25:49 UTC
*** Bug 1069548 has been marked as a duplicate of this bug. ***

Comment 17 Jarod Wilson 2014-03-05 18:36:47 UTC
Patch(es) available on kernel-3.10.0-105.el7

Comment 20 Xuesong Zhang 2014-03-06 08:47:28 UTC
Test with the latest build, this bug is fixed.

Package version:
libvirt-1.1.1-26.el7.x86_64
qemu-kvm-rhev-1.5.3-52.el7.x86_64
kernel-3.10.0-105.el7.x86_64

Scenario 1: assign vf to guest
1. find one SR-IOV host, check the output of the command "ip link show" of one PF.
# ip link show
......
15: ens1f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT qlen 1000
    link/ether 00:1b:21:39:8b:19 brd ff:ff:ff:ff:ff:ff
    vf 0 MAC d2:97:8f:88:9d:a3, spoof checking on, link-state auto
    vf 1 MAC 52:54:00:a5:e7:f6, spoof checking on, link-state auto
    vf 2 MAC 00:00:00:00:00:00, spoof checking on, link-state auto
    vf 3 MAC 00:00:00:00:00:00, spoof checking on, link-state auto
    vf 4 MAC 00:00:00:00:00:00, spoof checking on, link-state auto
    vf 5 MAC 00:00:00:00:00:00, spoof checking on, link-state auto
    vf 6 MAC 00:00:00:00:00:00, spoof checking on, link-state auto
......

2. assign one vf to the guest, note the vf is not the 1st generated vf. Add the following xml to the shutoff guest.

<interface type='hostdev' managed='yes'>
<mac address='52:54:00:a5:e7:f6'/>
      <source>
        <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x3'/>
      </source>
    </interface>

3. start the guest
# virsh start b
Domain b started

4. check the guest dumpxml, make sure the interface is 
# virsh dumpxml b|grep hostdev -A5
    <interface type='hostdev' managed='yes'>
      <mac address='52:54:00:a5:e7:f6'/>
      <driver name='vfio'/>
      <source>
        <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x3'/>
      </source>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </interface>


Scenario 2: hot-plug vf to guest
1. prepare one running guest

2. prepare one vf xml like following:
# cat inter-hostdev-vfio.xml 
<interface type='hostdev' managed='yes'>
<mac address='52:54:00:a5:e7:f6'/>
      <source>
        <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x3'/>
      </source>
    </interface>

3. hot-plug the vf to the running guest.
# virsh attach-device b inter-hostdev-vfio.xml 
Device attached successfully

4. check the guest xml, make sure the vf is in there.
# virsh dumpxml b|grep hostdev -A5
    <interface type='hostdev' managed='yes'>
      <mac address='52:54:00:a5:e7:f6'/>
      <driver name='vfio'/>
      <source>
        <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x3'/>
      </source>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </interface>

scenario 3: assign vf from hostdev network, hot-plug vf from hostdev network.
1. prepare one hostdev network like following one:
# virsh net-list
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 default              active     yes           yes
 hostnet              active     no            yes

# virsh net-dumpxml hostnet
<network>
  <name>hostnet</name>
  <uuid>c64f5418-4287-4152-83af-e944215fb824</uuid>
  <forward mode='hostdev' managed='yes'>
    <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x0'/>
    <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x1'/>
    <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x2'/>
    <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x3'/>
  </forward>
</network>

2. add the following xml to the shutoff guest.
<interface type='network'>
      <source network='hostnet'/>
    </interface>

3. start the guest.
# virsh start b
Domain b started

4. check the guest dumpxml, make sure the interface is in there.
# virsh dumpxml b|grep interface -A5
    <interface type='network'>
      <mac address='52:54:00:89:9a:ec'/>
      <source network='hostnet'/>
      <model type='rtl8139'/>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </interface>

5. hot-plug the interface from hostdev network to running guest.
# virsh attach-interface b network hostnet
Interface attached successfully

6. check the guest xml, make sure another one interface in the hostdev network is attached.
[root@sriov1 xuzhang]# virsh dumpxml b|grep interface -A5
    <interface type='network'>
      <mac address='52:54:00:89:9a:ec'/>
      <source network='hostnet'/>
      <model type='rtl8139'/>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='52:54:00:b6:45:10'/>
      <source network='hostnet'/>
      <model type='rtl8139'/>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </interface>

Comment 21 Xu Han 2014-03-16 13:53:14 UTC
Tested with these components below:
kernel-3.10.0-110.el7.x86_64
qemu-kvm-rhev-1.5.3-53.el7.x86_64

Steps:
1. Generates VFs, and then check them.
# modprobe igb max_vfs=7
# ip link show
...
7: ens1f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000
    link/ether 00:1b:21:39:8b:18 brd ff:ff:ff:ff:ff:ff
    vf 0 MAC 5e:d2:1c:1c:2b:3a, spoof checking on, link-state auto
    vf 1 MAC 6a:09:bf:33:83:00, spoof checking on, link-state auto
    vf 2 MAC 7a:16:0a:a6:9c:e3, spoof checking on, link-state auto
    vf 3 MAC ba:8d:c2:f2:17:53, spoof checking on, link-state auto
    vf 4 MAC 22:d4:42:5e:f3:63, spoof checking on, link-state auto
    vf 5 MAC 5a:84:13:6e:a7:56, spoof checking on, link-state auto
    vf 6 MAC de:3c:c0:42:15:e9, spoof checking on, link-state auto
...
22: ens1f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT qlen 1000
    link/ether 00:1b:21:39:8b:19 brd ff:ff:ff:ff:ff:ff
    vf 0 MAC 00:00:00:00:00:00, spoof checking on, link-state auto
    vf 1 MAC 00:00:00:00:00:00, spoof checking on, link-state auto
    vf 2 MAC 00:00:00:00:00:00, spoof checking on, link-state auto
    vf 3 MAC 00:00:00:00:00:00, spoof checking on, link-state auto
    vf 4 MAC 00:00:00:00:00:00, spoof checking on, link-state auto
    vf 5 MAC 00:00:00:00:00:00, spoof checking on, link-state auto
    vf 6 MAC 00:00:00:00:00:00, spoof checking on, link-state auto

2. Bind one VF to vfio-pci.
# modprobe vfio
# modprobe vfio-pci
# echo "0000:03:10.6" > /sys/bus/pci/drivers/igbvf/unbind
# echo "8086 10ca" > /sys/bus/pci/drivers/vfio-pci/new_id

Scenario 1: Boot guest with assigned VF.
# /usr/libexec/qemu-kvm ... \
-device vfio-pci,host=03:10.6,id=vf0

Scenario 2: Hot plug assigned VF to guest.
(qmp) {"execute": "device_add", "arguments": {"driver": "vfio-pci", "host": "03:10.6", "id": "vf0"}}


Results:
The assigned VF works properly in these two scenarios above.

Comment 23 Ludek Smid 2014-06-13 13:17:14 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Comment 25 nupur priya 2018-07-18 05:12:06 UTC
Still facing the same issue with following kernel version:

Name : kernel
Version : 3.10.0
Release : 327.el7
Architecture: x86_64


Note You need to log in before you can comment on or make changes to this bug.