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 2166235 - vm start successfully even there is a pre-created tap device with the same name (type="direct")
Summary: vm start successfully even there is a pre-created tap device with the same na...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libvirt
Version: 9.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: yalzhang@redhat.com
URL:
Whiteboard:
Depends On: 2144738
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-01 09:01 UTC by Michal Privoznik
Modified: 2023-11-07 09:40 UTC (History)
8 users (show)

Fixed In Version: libvirt-9.1.0-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2144738
Environment:
Last Closed: 2023-11-07 08:30:47 UTC
Type: Bug
Target Upstream Version: 9.1.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-147247 0 None None None 2023-02-01 09:04:47 UTC
Red Hat Product Errata RHSA-2023:6409 0 None None None 2023-11-07 08:31:29 UTC

Description Michal Privoznik 2023-02-01 09:01:59 UTC
+++ This bug was initially created as a clone of Bug #2144738 +++

Scenario 2: direct type interface

1. create a macvtap device:
# ip l add l eno1 name test type macvtap mode bridge
# ip l show test 
13: test@eno1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 500
    link/ether f2:dc:83:ac:a5:fb brd ff:ff:ff:ff:ff:ff

# virsh dumpxml rhel --xpath //interface 
<interface type="direct">
  <mac address="52:54:00:55:34:bc"/>
  <source dev="eno1" mode="bridge"/>
  <target dev="test"/>
  <model type="virtio"/>
  <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
</interface>

# virsh start rhel 
error: Failed to start domain 'rhel'
error: error creating macvtap interface test@eno1 (52:54:00:55:34:bc): File exists

# ip l show test 
Device "test" does not exist.

Try to start the vm the 2nd time, as the pre-created tap device is deleted, the vm start successfully:
# virsh start rhel 
Domain 'rhel' started

--- Additional comment from Michal Privoznik on 2023-01-30 10:40:46 CET ---

(In reply to yalzhang from comment #14) 
> Test on libvirt-9.0.0-2.el9.x86_64, for network interface, the result is as
> expected; 
> but for direct type interface, the pre-created tap device will be deleted,
> please check the scenario 2 below. Thank you.

Yeah, this type isn't fixed. Let me write and post patches.

--- Additional comment from Michal Privoznik on 2023-02-01 09:59:02 CET ---

Alright, so after I started working on patches, I came up with a wide variety of cleanup patches which would need to be backported as well. So let us track that issue in a separate bug and leave this one only for <interface type="network"/>.

Comment 1 Michal Privoznik 2023-02-01 13:50:08 UTC
Patches posted on the list:

https://listman.redhat.com/archives/libvir-list/2023-February/237479.html

Comment 2 Michal Privoznik 2023-02-01 14:52:54 UTC
Merged upstream as:

61d1b9e659 qemu: Don't remove macvtaps on failed start
db4ea3986a conf: Format and parse private data for virDomainNetDef
c0f671e7c9 virnetdevmacvlan: Drop G_GNUC_WARN_UNUSED_RESULT annotation for virNetDevMacVLanDeleteWithVPortProfile()
714af1a50c domain_conf: Rewrite virDomainChrSourceModeTypeFromString() using VIR_ENUM_IMPL()
69db3bd954 domain_conf: Move virDomainNetVhostuserMode enum declaration

v9.0.0-147-g61d1b9e659

Comment 4 yalzhang@redhat.com 2023-03-15 02:27:34 UTC
Test on libvirt-9.1.0-1.el9.x86_64, the result is as expected:
# ip l add l eno1 name test type macvtap mode bridge
# ip l show test 
10: test@eno1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 500
    link/ether 72:54:a0:4b:b6:e5 brd ff:ff:ff:ff:ff:ff
# virsh dumpxml rhel --xpath //interface 
<interface type="direct">
  <mac address="52:54:00:55:34:bc"/>
  <source dev="eno1" mode="bridge"/>
  <target dev="test"/>
  <model type="virtio"/>
  <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
</interface>
# virsh start rhel 
error: Failed to start domain 'rhel'
error: error creating macvtap interface test@eno1 (52:54:00:55:34:bc): File exists
# ip l show test
10: test@eno1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 500
    link/ether 72:54:a0:4b:b6:e5 brd ff:ff:ff:ff:ff:ff
# virsh start rhel 
error: Failed to start domain 'rhel'
error: error creating macvtap interface test@eno1 (52:54:00:55:34:bc): File exists
# ip l show test
10: test@eno1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 500
    link/ether 72:54:a0:4b:b6:e5 brd ff:ff:ff:ff:ff:ff

Comment 8 yalzhang@redhat.com 2023-05-19 02:17:27 UTC
Test on libvirt-9.3.0-2.el9.x86_64 with the scenario in comment 4, the result is the same as comment 4, which is as expected.

Comment 10 errata-xmlrpc 2023-11-07 08:30:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: libvirt security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:6409


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