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 1052835 - keep track of interfaces passed through to guests
Summary: keep track of interfaces passed through to guests
Keywords:
Status: CLOSED WONTFIX
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: Ján Tomko
QA Contact: yalzhang@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-14 07:29 UTC by Xuesong Zhang
Modified: 2018-05-25 11:41 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-25 11:41:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Xuesong Zhang 2014-01-14 07:29:40 UTC
Description of problem:
The error message should be improved while start two guests with same one macvtap passthrough interface.

Version-Release number of selected component (if applicable):
libvirt-1.1.1-18.el7.x86_64
qemu-img-1.5.3-35.el7.x86_64
kernel-3.10.0-67.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. prepare 2 shutoff gusts, add the following xml to the 2 guests
<interface type='direct'>
      <source dev='enp4s0' mode='passthrough'/>
    </interface> 

2. start one guest, it will be started up.
# virsh start a
Domain a started

3. start the other one guest, it will failed with the following error message.
# virsh start b
Error starting domain: error creating macvtap type of interface attach to enp4s0: Invalid argument


Actual results:
as step 3

Expected results:
Since the macvtap passthrough mode is exclusive, other guest can not be used one same interface with this mode.
The error message in step 3 should be more clearly for debugging, should be some message like the following one:
The interface enp4s0 is used by guest a with macvtap passthrough mode, can't be used by other guest.

Comment 5 Ján Tomko 2015-05-05 15:01:57 UTC
The error message was changed to include the requested interface name and mac address upstream by:

commit 72423df9920491f8f59455a4161a7c31d1e15c8a
Author:     Laine Stump <laine>
CommitDate: 2015-03-18 14:49:29 -0400

    util: more verbose error when failing to create macvtap device
    
    Investigation of a problem with creating passthrough macvtap devices
    (https://bugzilla.redhat.com/show_bug.cgi?id=1185501) has shown that
    this slightly more verbose failure message is useful. In particular,
    the mac address can be used to determine the domain. You could also
    figure this out by looking at preceding messages in a debug log, but
    this gets it in a single place.

git describe: v1.2.13-241-g72423df contains: v1.2.14-rc1~87

Comment 7 yalzhang@redhat.com 2016-05-25 06:12:24 UTC
verify on libvirt-1.3.4-1.el7.x86_64, the result is as the patch says. But I think it helps a little compared with original error messages: 
"Error starting domain: error creating macvtap type of interface attach to enp4s0: Invalid argument".

error messages on libvirt-1.3.4-1.el7.x86_64:
# virsh start rhel7.2-new
error: Failed to start domain rhel7.2-new
error: error creating macvtap interface macvtap1@enp0s25 (52:54:00:9b:97:08): Invalid argument

# virsh domiflist rhel7.2-new
Interface  Type       Source     Model       MAC
-------------------------------------------------------
-          direct     enp0s25    rtl8139     52:54:00:9b:97:08

What about you think? 
This is the error message I tired with hostdev(pci passthrough) for your reference, it tells the vf is used by other guest named R7.2.

# virsh attach-interface R7.2 hostdev 0000:03:10.1 --managed
Interface attached successfully

# virsh attach-interface t_rhel7.2 hostdev 0000:03:10.1 --managed
error: Failed to attach interface
error: Requested operation is not valid: PCI device 0000:03:10.1 is in use by driver QEMU, domain R7.2

Comment 8 Ján Tomko 2016-05-31 15:22:40 UTC
Yes, a more helpful message like that is the goal of this bug.

Comment 9 Ján Tomko 2018-05-25 11:41:49 UTC
This requires non-trivial amount of work just for a better error message.


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