Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1616154

Summary: macvtap interface disappeared on host after starting another guest with same interface
Product: Red Hat Enterprise Linux 7 Reporter: chhu
Component: libvirtAssignee: Laine Stump <laine>
Status: CLOSED NOTABUG QA Contact: chhu
Severity: medium Docs Contact:
Priority: medium    
Version: 7.6CC: lmen, tburke, xuzhang, yalzhang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-04-24 18:52:49 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:
Attachments:
Description Flags
libvirtd log none

Description chhu 2018-08-15 06:42:23 UTC
Version-Release number of selected component (if applicable):
libvirt-4.5.0-6.virtcov.el7.x86_64
qemu-kvm-rhev-2.12.0-8.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Define and start macvtap network
# virsh net-dumpxml direct-macvtap
<network connections='1'>
  <name>direct-macvtap</name>
  <uuid>46913645-f4d1-4137-8151-f1becda13e81</uuid>
  <forward dev='em1' mode='private'>
    <interface dev='em1' connections='1'/>
  </forward>
</network>

2. Start a guest with interface as below:
# virsh start r7
Domain r7 started

# virsh dumpxml r7|grep interface -B 10
    <interface type='direct'>
      <mac address='52:54:00:18:14:13'/>
      <source network='direct-macvtap' dev='em1' mode='private'/>
      <target dev='test'/>
      <model type='virtio'/>
      <link state='up'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>

3. Check there is interface: test on the host, login to the guest, there is interface: eth0,
and can ping outside.

# ping www.baidu.com
PING www.wshifen.com (104.193.88.123) 56(84) bytes of data.
64 bytes from 104.193.88.123 (104.193.88.123): icmp_seq=1 ttl=46 time=179 ms
64 bytes from 104.193.88.123 (104.193.88.123): icmp_seq=2 ttl=46 time=179 ms

4. Try to start another guest with the same interface on the host, hit error as the device test is existed.
# virsh dumpxml r7t|grep interface -B 10
    <interface type='network'>
      <mac address='52:54:00:38:34:33'/>
      <source network='direct-macvtap'/>
      <target dev='test'/>
      <model type='virtio'/>
      <link state='up'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>

# virsh start r7t
error: Failed to start domain r7t
error: Unable to create macvtap device test: File exists

5. Check there is no interface: test on the host, and can't ping outside in the former guest.

Actal results:
In step5: The interface is disappeared on the host.

Expected results:
In step5: The interface should be there, and the former guest network should work well.


Additional info:
- libvirtd log

Comment 2 chhu 2018-08-15 06:55:37 UTC
Created attachment 1476045 [details]
libvirtd log

Comment 3 Laine Stump 2019-04-24 18:52:49 UTC
This isn't a bug. In both cases you have hardcoded the name of the macvtap device to be "test" (with "<target dev='test'/>"). If you manually specify the macvtap device name and that device name is already in use, libvirt will correctly refuse to autogenerate a different name. If you remove <target dev='test'/> then the test will complete successfully.