Bug 1420668
| Summary: | Hotplug of 'user' type interface is not supported any more unexpectedly | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Dan Zheng <dzheng> | |
| Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> | |
| Status: | CLOSED ERRATA | QA Contact: | yalzhang <yalzhang> | |
| Severity: | medium | Docs Contact: | ||
| Priority: | high | |||
| Version: | 7.4 | CC: | dyuan, jreznik, jsuchane, mprivozn, mtessun, pkrempa, rbalakri, xuzhang, yalzhang, zpeng | |
| Target Milestone: | rc | Keywords: | Regression, ZStream | |
| Target Release: | --- | |||
| Hardware: | x86_64 | |||
| OS: | Linux | |||
| Whiteboard: | ||||
| Fixed In Version: | libvirt-3.1.0-1.el7 | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1445231 (view as bug list) | Environment: | ||
| Last Closed: | 2017-08-01 17:21:45 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: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1445231 | |||
|
Description
Dan Zheng
2017-02-09 09:21:45 UTC
The hotplug of the interface type was denied by commit:
commit c266b6044003ac2f10f4cd15e58164d629508ccb
Author: Michal Privoznik <mprivozn>
Date: Mon Sep 26 11:53:58 2016 +0200
qemuDomainAttachNetDevice: Explicitly list allowed types for hotplug
Instead of blindly claim support for hot-plugging of every
interface type out there we should copy approach we have for
device types: white listing supported types and explicitly error
out on unsupported ones.
For instance, trying to hotplug vhostuser interface results in
nothing usable from guest currently. vhostuser typed interfaces
require additional work on our side.
Michal, is this expected behavior?
No, it is not. Patch proposed upstream: https://www.redhat.com/archives/libvir-list/2017-February/msg01593.html To POST:
commit 9d87f769726bd5714eb6a930379d8b4c53311196
Author: Michal Privoznik <mprivozn>
AuthorDate: Tue Feb 28 17:49:49 2017 +0100
Commit: Michal Privoznik <mprivozn>
CommitDate: Wed Mar 1 09:05:53 2017 +0100
qemuDomainAttachNetDevice: Support attach of type="user"
https://bugzilla.redhat.com/show_bug.cgi?id=1420668
This has worked in previous releases.
My commit c266b60440 broke it.
Signed-off-by: Michal Privoznik <mprivozn>
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 97fb272f6..0c0885695 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1104,6 +1104,9 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
break;
case VIR_DOMAIN_NET_TYPE_USER:
+ /* No preparation needed. */
+ break;
+
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
v3.1.0-rc2-2-g9d87f7697
Test as below scenarios, the result is as expected, set this bug as verified.
1. unprivileged user
$ rpm -q libvirt
libvirt-3.1.0-1.el7.x86_64
$ virsh start rhel7.2
Domain rhel7.2 started
$ cat /tmp/user.xml
<interface type='user'/>
$ virsh attach-device rhel7.2 /tmp/user.xml
Device attached successfully
$ virsh dumpxml rhel7.2 | grep /interface -B5
<interface type='user'>
<mac address='52:54:00:81:eb:1e'/>
<model type='rtl8139'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
log in the guest, and check the network function, it works well.
$ cat /tmp/user1.xml
<interface type='user'>
<mac address='52:54:00:81:eb:1e'/>
<model type='rtl8139'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
$ virsh detach-device rhel7.2 /tmp/user1.xml
Device detached successfully
2. use root
# virsh attach-device rhel /tmp/user.xml
Device attached successfully
# virsh dumpxml rhel | grep /interface -B6
...
<interface type='user'>
<mac address='52:54:00:30:02:5a'/>
<model type='rtl8139'/>
<alias name='net1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</interface>
log in the guest, and check the network function, it works well.
# virsh detach-interface rhel user 52:54:00:30:02:5a
Interface detached successfully
Hi Michal, will this patch be backport to rhel7.3 z stream? 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, 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/RHEA-2017:1846 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, 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/RHEA-2017:1846 |