Bug 1459091
Summary: | virsh domiflist return NULL for the vhostuser interface name and source | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | chhu | |
Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> | |
Status: | CLOSED ERRATA | QA Contact: | chhu | |
Severity: | high | Docs Contact: | ||
Priority: | high | |||
Version: | 7.4 | CC: | dyuan, jherrman, jraju, jsuchane, mabaakou, rbalakri, rhodain, xuzhang, yalzhang | |
Target Milestone: | rc | Keywords: | Upstream, ZStream | |
Target Release: | --- | |||
Hardware: | x86_64 | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | libvirt-3.7.0-1.el7 | Doc Type: | Bug Fix | |
Doc Text: |
Prior to this update, the name of vhostuser interfaces were in some cases missing from XML configurations of virtual machines (VMs). Now, vhostuser interfaces are queried during VM startup instead of during VM defining, and the interface names are thus set up in the XM configuration correctly.
|
Story Points: | --- | |
Clone Of: | ||||
: | 1627781 (view as bug list) | Environment: | ||
Last Closed: | 2018-04-10 10:46:43 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: | 1397940, 1473046, 1627781 |
Description
chhu
2017-06-06 09:19:36 UTC
I'm guessing this commit is missing: http://libvirt.org/git/?p=libvirt.git;a=commit;h=57b5e27d3d74f8dbb77ac909b405d99d555eca46 (In reply to Mehdi ABAAKOUK from comment #2) > I'm guessing this commit is missing: > http://libvirt.org/git/?p=libvirt.git;a=commit; > h=57b5e27d3d74f8dbb77ac909b405d99d555eca46 Build libvirt-3.2.0-7.el7 contains that commit. Something else might be missing. Per comment https://bugzilla.redhat.com/show_bug.cgi?id=1397940#c10 I am moving this one to rhel-7.5. Patches proposed upstream: https://www.redhat.com/archives/libvir-list/2017-June/msg00392.html I've pushed patches online: commit f3908d8557dc609e2262099d76c57b0bcc4b0917 Author: Michal Privoznik <mprivozn> AuthorDate: Thu Jun 8 14:58:22 2017 +0200 Commit: Michal Privoznik <mprivozn> CommitDate: Thu Jun 8 15:02:23 2017 +0200 virNetDevOpenvswitchGetVhostuserIfname: Fix off by one error https://bugzilla.redhat.com/show_bug.cgi?id=1459091 We try to get the last element of the passed path by calling strrch(path, '/'). However, the pointer that strrchr() returns points at the slash, We want string that starts right after that. Signed-off-by: Michal Privoznik <mprivozn> commit 2a13a0a103340878b05a5ae0b9f454721f67dbb3 Author: Michal Privoznik <mprivozn> AuthorDate: Wed Jun 7 15:43:58 2017 +0200 Commit: Michal Privoznik <mprivozn> CommitDate: Thu Jun 8 15:02:22 2017 +0200 qemu: Query for vhostuser iface names at runtime https://bugzilla.redhat.com/show_bug.cgi?id=1459091 Currently, we are querying for vhostuser interface name in post parse callback. At that time interface might not yet exist. However, it has to exist when starting domain. Therefore it makes more sense to query its name at that point. This partially reverts 57b5e27. Signed-off-by: Michal Privoznik <mprivozn> v3.4.0-66-gf3908d855 Test on libvirt-3.7.0-2.el7.x86_64, the result is as expected, set this bug to be verified. 1. start the guest with vhostuser interface without <target dev=...> element, check the xml # virsh dumpxml vhost1 --inactive | grep /interface -B5 <interface type='vhostuser'> <mac address='52:54:00:93:51:db'/> <source type='unix' path='/var/run/openvswitch/vhost-user1' mode='client'/> <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <== no <target dev=...> set in inactive xml # virsh dumpxml vhost1 | grep /interface -B7 <interface type='vhostuser'> <mac address='52:54:00:93:51:db'/> <source type='unix' path='/var/run/openvswitch/vhost-user1' mode='client'/> <target dev='vhost-user1'/> <model type='virtio'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <== the "<target dev='vhost-user1'/>" will generate automatically in the active xml 2. domiflist get the interface name # virsh domiflist vhost1 Interface Type Source Model MAC ------------------------------------------------------- vhost-user1 vhostuser - virtio 52:54:00:93:51:db # virsh domiflist vhost1 --inactive Interface Type Source Model MAC ------------------------------------------------------- - vhostuser - virtio 52:54:00:93:51:db 3. set <target dev> in xml # virsh dumpxml vhost1 --inactive | grep /interface -B6 <interface type='vhostuser'> <mac address='52:54:00:93:51:db'/> <source type='unix' path='/var/run/openvswitch/vhost-user1' mode='client'/> <target dev='blah'/> <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <=== set <target dev='blah'/> in xml # virsh dumpxml vhost1 | grep /interface -B7 <interface type='vhostuser'> <mac address='52:54:00:93:51:db'/> <source type='unix' path='/var/run/openvswitch/vhost-user1' mode='client'/> <target dev='vhost-user1'/> <model type='virtio'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <=== when the vm start, the target dev will be override 4. check by domiflist for the interface name # virsh domiflist vhost1 Interface Type Source Model MAC ------------------------------------------------------- vhost-user1 vhostuser - virtio 52:54:00:93:51:db # virsh domiflist vhost1 --inactive Interface Type Source Model MAC ------------------------------------------------------- blah vhostuser - virtio 52:54:00:93:51:db # virsh domifstat vhost1 blah error: Failed to get interface stats vhost1 blah error: invalid argument: invalid path, 'blah' is not a known interface # virsh domifstat vhost1 vhost-user1 vhost-user1 rx_bytes 132144 vhost-user1 rx_packets 1375 vhost-user1 rx_drop 0 vhost-user1 tx_bytes 133096 vhost-user1 tx_packets 1387 vhost-user1 tx_errs 0 vhost-user1 tx_drop 0 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-2018:0704 |