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 1012824 - the virtual interface can't be hotpluged with command "attach-interface" while the guest contains VF
Summary: the virtual interface can't be hotpluged with command "attach-interface" whil...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Laine Stump
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1012834
TreeView+ depends on / blocked
 
Reported: 2013-09-27 08:33 UTC by Xuesong Zhang
Modified: 2014-06-18 00:56 UTC (History)
5 users (show)

Fixed In Version: libvirt-1.1.1-9.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1012834 (view as bug list)
Environment:
Last Closed: 2014-06-13 10:08:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Xuesong Zhang 2013-09-27 08:33:11 UTC
Description
After hot-plug/cold-plug one hostdev network interface, can't attach the interface from default network. This issue is about command "attach-interface".

Version:
libvirt-1.1.1-5.el7.x86_64
qemu-kvm-1.5.3-3.el7.x86_64
kernel-3.10.0-23.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. prepare 2 types network on the SR-IOV host: one is default network, the other one is the hostdev network.
# virsh net-dumpxml hostnet
<network connections='2'>
  <name>hostnet</name>
  <uuid>c1fb4ead-21b8-4d69-8ad9-669c55b3dfc7</uuid>
  <forward mode='hostdev' managed='yes'>
    <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x1'/>
    <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x0'/>
  </forward>
</network>

# virsh net-dumpxml default
<network>
  <name>default</name>
  <uuid>74b8fbe6-87d3-4e75-90e9-0a92623e1040</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr0' stp='on' delay='0' />
  <mac address='52:54:00:6d:3f:27'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254' />
    </dhcp>
  </ip>
</network>

2. prepare one running guest

3. prepare one guest, cold-plug the vf to the guest like following:
# virsh dumpxml a
......
<interface type='network'>
      <mac address='52:54:00:e6:1f:fe'/>
      <source network='hostnet'/>
      <model type='rtl8139'/>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
......

4. start the guest

5. hot-plug the interface of default network to the guest:
# virsh attach-interface a network default
error: Failed to attach interface
error: internal error: Unable to determine device index for network device

6. hot-plug the interface of hostdev network to the guest:
# virsh attach-interface a network hostnet
Interface attached successfully

7. destroy the guest, then edit the guest and delete the VF, start the guest again.

8. hot-plug the interface of default network to the guest:
# virsh attach-interface a network default
Interface attached successfully

9. hot-plug the interface of hostdev network to the guest:
# virsh attach-interface a network hostnet
Interface attached successfully

10. hot-plug the interface of default network to the guest:
# virsh attach-interface a network default
error: Failed to attach interface
error: internal error: Unable to determine device index for network device

Actual results:
In step5 and step10, after the guest cold-plug/hot-plug one VF, the interface of default network can't be hot-plug to the guest.

Expected results:
In step5 and step10, the interface of default network should be hot-plug successfully to the guest whether there is other type network interface or not.

Additional info:

Comment 2 Laine Stump 2013-10-03 11:30:25 UTC
Fix posted upstream:

https://www.redhat.com/archives/libvir-list/2013-October/msg00152.html

Comment 3 Laine Stump 2013-10-03 15:11:59 UTC
Pushed upstream:

commit 9881bfed2541faa428372b4513518b4b9ae1ab15
Author: Laine Stump <laine>
Date:   Thu Oct 3 13:02:35 2013 +0300

    qemu: check actual netdev type rather than config netdev type during init

Comment 6 Hu Jianwei 2013-10-17 03:07:34 UTC
I can reproduce it with libvirt-1.1.1-8.el7.x86_64, can not reproduce it with libvirt-1.1.1-9.el7.x86_64.

version:
libvirt-1.1.1-9.el7.x86_64
qemu-kvm-rhev-1.5.3-9.el7.x86_64
kernel-3.10.0-33.el7.x86_64

Verifying steps:
1. Define below two virtual networks.
[root@sriov2 ~]# virsh net-dumpxml hostnet
<network>
  <name>hostnet</name>
  <uuid>c1fb4ead-21b8-4d69-8ad9-669c55b3dfc7</uuid>
  <forward mode='hostdev' managed='yes'>
    <address type='pci' domain='0x0000' bus='0x11' slot='0x10' function='0x1'/>
    <address type='pci' domain='0x0000' bus='0x11' slot='0x10' function='0x0'/>
  </forward>
</network>

[root@sriov2 ~]# virsh net-dumpxml default
<network>
  <name>default</name>
  <uuid>10f211a3-5f62-4f17-8a74-feb385446629</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr0' stp='on' delay='0' />
  <mac address='52:54:00:b9:c9:28'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254' />
    </dhcp>
  </ip>
</network>

2. Prepare one running guest, cold-plug the vf to the guest like following:
[root@sriov2 ~]# virsh start r7
Domain r7 started

[root@sriov2 ~]# virsh dumpxml r7 | grep interface -A10
    <interface type='network'>
      <mac address='52:54:00:f1:17:cc'/>
      <source network='hostnet'/>
      <model type='rtl8139'/>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
...

3. hot-plug the interface of default network to the guest
[root@sriov2 ~]# virsh attach-interface r7 network default
Interface attached successfully

[root@sriov2 ~]# virsh dumpxml r7 | grep interface -A10
    <interface type='network'>
      <mac address='52:54:00:f1:17:cc'/>
      <source network='hostnet'/>
      <model type='rtl8139'/>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='52:54:00:2a:70:fa'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </interface>
...

4. hot-plug the interface of hostdev network to the guest
[root@sriov2 ~]# virsh attach-interface r7 network hostnet
Interface attached successfully

[root@sriov2 ~]# virsh dumpxml r7 | grep interface -A10
    <interface type='network'>
      <mac address='52:54:00:f1:17:cc'/>
      <source network='hostnet'/>
      <model type='rtl8139'/>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='52:54:00:2a:70:fa'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='52:54:00:a8:f1:ec'/>
      <source network='hostnet'/>
      <model type='rtl8139'/>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </interface>
...

5. hot-plug the interface of default network to the guest again
[root@sriov2 ~]# virsh attach-interface r7 network default
Interface attached successfully

[root@sriov2 ~]# virsh dumpxml r7 | grep interface -A10
    <interface type='network'>
      <mac address='52:54:00:f1:17:cc'/>
      <source network='hostnet'/>
      <model type='rtl8139'/>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='52:54:00:2a:70:fa'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='52:54:00:a8:f1:ec'/>
      <source network='hostnet'/>
      <model type='rtl8139'/>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='52:54:00:ab:f5:d9'/>
      <source network='default'/>
      <target dev='vnet1'/>
      <model type='rtl8139'/>
      <alias name='net1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </interface>
...

6. hot-plug the interface of hostdev network to the guest again, due to there are only two VFs in the pool, so we just cold-plug/hot-plug twice.
[root@sriov2 ~]# virsh attach-interface r7 network hostnet
error: Failed to attach interface
error: internal error: network 'hostnet' requires exclusive access to interfaces, but none are available

7. hot-plug the interface of default network to the guest, after this step, we will get three interfaces that source network is default.
[root@sriov2 ~]# virsh attach-interface r7 network default
Interface attached successfully

[root@sriov2 ~]# virsh dumpxml r7 | grep interface -A10
    <interface type='network'>
      <mac address='52:54:00:f1:17:cc'/>
      <source network='hostnet'/>
      <model type='rtl8139'/>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='52:54:00:2a:70:fa'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='52:54:00:a8:f1:ec'/>
      <source network='hostnet'/>
      <model type='rtl8139'/>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='52:54:00:ab:f5:d9'/>
      <source network='default'/>
      <target dev='vnet1'/>
      <model type='rtl8139'/>
      <alias name='net1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='52:54:00:55:49:48'/>
      <source network='default'/>
      <target dev='vnet2'/>
      <model type='rtl8139'/>
      <alias name='net2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
    </interface>
...

We can get expected results, so changed to verified.

Comment 7 Ludek Smid 2014-06-13 10:08:29 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.


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