Bug 1480251 - Setting network backend-specific options can be hotplug with hostdev / user / direct type interfaces
Setting network backend-specific options can be hotplug with hostdev / user ...
Status: ASSIGNED
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.4
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Laine Stump
yalzhang@redhat.com
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-10 09:40 EDT by yalzhang@redhat.com
Modified: 2017-11-24 04:20 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description yalzhang@redhat.com 2017-08-10 09:40:29 EDT
Description of problem:
Setting network backend-specific options in hostdev/user/direct type interfaces, and hotplug the interface to a guest, it will succeed, but the backend-specific option is not supported in such types

Version-Release number of selected component (if applicable):
libvirt-3.2.0-14.el7_4.2.x86_64
qemu-kvm-rhev-2.9.0-16.el7_4.3.x86_64

How reproducible:
100%

Steps to Reproduce:
1.
# cat direct.xml 
    <interface type='direct'>
      <source dev='ens1f1' mode='bridge'/>
      <backend tap='/dev/net/tun' vhost='/dev/vhost-net'/>
      <model type='rtl8139'/>
    </interface>

# virsh start rhel7.4
Domain rhel7.4 started

2.
# virsh attach-device rhel7.4 direct.xml
Device attached successfully
# virsh dumpxml rhel7.4 | grep /interface -B8
    <interface type='direct'>
      <mac address='52:54:00:63:d7:98'/>
      <source dev='ens1f1' mode='bridge'/>
      <target dev='macvtap0'/>
      <model type='rtl8139'/>
      <backend tap='/dev/net/tun'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

3. but start a guest with "<backend tap='/dev/net/tun'/>" in direct type interface will fail

# virsh dumpxml rhel7.4 | grep /interface -B6
    <interface type='direct'>
      <mac address='52:54:00:63:d7:98'/>
      <source dev='ens1f1' mode='bridge'/>
      <model type='rtl8139'/>
      <backend tap='/dev/net/tun'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

# virsh start rhel7.4
error: Failed to start domain rhel7.4
error: unsupported configuration: Custom tap device path is not supported for: direct


Actual results:
The backend element are not supported on these type of interfaces, but hotplug succeed, make an invalid xml. May be a doc fix is ok?

Expected results:
hotplug failed or ignore the setting, or do not use backend settings in these type of interface documented somewhere.

Additional info:
The same with user type interface, hostdev interface

for user type interface, 
$ virsh start rhel7.2
Domain rhel7.2 started

$ cat user.xml 
<interface type='user'>
 <backend tap='/dev/net/tun' vhost='/dev/vhost-net'/>
</interface>

$ virsh attach-device rhel7.2 user.xml 
Device attached successfully

$ virsh dumpxml rhel7.2 | grep /interface -B6
    <interface type='user'>
      <mac address='52:54:00:13:11:f7'/>
      <model type='rtl8139'/>
      <backend tap='/dev/net/tun'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

but a guest with above xml can not start
$ virsh start rhel7.2
error: Failed to start domain rhel7.2
error: unsupported configuration: Custom tap device path is not supported for: user

for hostdev interface:
# cat vf.xml 
  <interface type='hostdev' managed='yes'>
      <source>
 <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x0'/>
      </source>
<backend tap='/dev/net/tun' vhost='/dev/vhost-net'/>
    </interface>
# virsh attach-device rhel vf.xml
Device attached successfully
# virsh dumpxml rhel | grep /interface -B9
    <interface type='hostdev' managed='yes'>
      <mac address='52:54:00:90:dd:07'/>
      <driver name='vfio'/>
      <source>
        <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x0'/>
      </source>
      <backend tap='/dev/net/tun'/>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

start a guest with above xml
# virsh start rhel
error: Failed to start domain rhel
error: unsupported configuration: Custom tap device path is not supported for: hostdev

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