Bug 1020135
Summary: | Libvirt should not reduce the connections value on hostdev network after attaching interface failed | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Hu Jianwei <jiahu> | |
Component: | libvirt | Assignee: | Laine Stump <laine> | |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Virtualization Bugs <virt-bugs> | |
Severity: | medium | Docs Contact: | ||
Priority: | medium | |||
Version: | 7.0 | CC: | acathrow, dallan, dyuan, honzhang, jishao, laine, mzhan, shyu | |
Target Milestone: | rc | |||
Target Release: | --- | |||
Hardware: | x86_64 | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | libvirt-1.1.1-12.el7 | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1300843 (view as bug list) | Environment: | ||
Last Closed: | 2014-06-13 10:33:41 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: |
Description
Hu Jianwei
2013-10-17 06:11:57 UTC
I can see where the problem is, but need to think awhile about the cleanest way to fix it. Explanation: qemuDomainAttachNetDevice() calls networkAllocateActualDevice() to allocate a device from the pool. If that call fails, qemuDomainAttachNetDevice() goes to its cleanup: label, and ends up calling networkReleaseActualDevice(). The problem is that when networkReleaseActualDevice() sees that the netdev's "actual" pointer is NULL, it says "oh, so there is nothing to release!" and jumps down to its success: label, where the connections count for the network is decremented. Most of the time this is what should be done, but there are times when networkAllocateActualDevice() has failed but networkReleaseActualDevice() is still called as part of the error cleanup, and in that case the count *shouldn't* be decremented. A fix has been pushed upstream: commit b4e0299d4ff059c8707a760b7ec2063ccd57cc21 Author: Laine Stump <laine> Date: Mon Nov 4 17:01:17 2013 +0200 network: fix connections count in case of allocate failure Verify it as follows. The result is expected. Version libvirt-1.1.1-12.el7.x86_64 [root@sriov2 ~]# virsh net-start hostnet Network hostnet started [root@sriov2 ~]# virsh attach-interface r7 network hostnet Interface attached successfully [root@sriov2 ~]# virsh attach-interface r7 network hostnet Interface attached successfully [root@sriov2 ~]# virsh attach-interface r7 network hostnet Interface attached successfully [root@sriov2 ~]# virsh attach-interface r7 network hostnet Interface attached successfully [root@sriov2 ~]# virsh net-dumpxml hostnet <network connections='4'> <name>hostnet</name> <uuid>c1fb4ead-21b8-4d69-8ad9-669c55b3dfc7</uuid> <forward mode='hostdev' managed='yes'> <address type='pci' domain='0x0000' bus='0x0f' slot='0x10' function='0x0'/> <address type='pci' domain='0x0000' bus='0x0f' slot='0x10' function='0x2'/> <address type='pci' domain='0x0000' bus='0x0f' slot='0x10' function='0x4'/> <address type='pci' domain='0x0000' bus='0x0f' slot='0x10' function='0x6'/> </forward> </network> [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 [root@sriov2 ~]# virsh net-dumpxml hostnet <network connections='4'> <name>hostnet</name> <uuid>c1fb4ead-21b8-4d69-8ad9-669c55b3dfc7</uuid> <forward mode='hostdev' managed='yes'> <address type='pci' domain='0x0000' bus='0x0f' slot='0x10' function='0x0'/> <address type='pci' domain='0x0000' bus='0x0f' slot='0x10' function='0x2'/> <address type='pci' domain='0x0000' bus='0x0f' slot='0x10' function='0x4'/> <address type='pci' domain='0x0000' bus='0x0f' slot='0x10' function='0x6'/> </forward> </network> [root@sriov2 ~]# virsh detach-interface r7 network --mac 52:54:00:78:02:07 Interface detached successfully [root@sriov2 ~]# virsh net-dumpxml hostnet <network connections='3'> <name>hostnet</name> <uuid>c1fb4ead-21b8-4d69-8ad9-669c55b3dfc7</uuid> <forward mode='hostdev' managed='yes'> <address type='pci' domain='0x0000' bus='0x0f' slot='0x10' function='0x0'/> <address type='pci' domain='0x0000' bus='0x0f' slot='0x10' function='0x2'/> <address type='pci' domain='0x0000' bus='0x0f' slot='0x10' function='0x4'/> <address type='pci' domain='0x0000' bus='0x0f' slot='0x10' function='0x6'/> </forward> </network> 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. Hi Laine, The bug can be reproduced rhel6.7 with libvirt-0.10.2-55.el6.x86_64 Is it need be fixed on rhel6.8 or not? Yes, and as a matter of fact I had backported the patch locally last week as part of a scratch build, and it's on my list to clone the bug to RHEL6 this week. |