Bug 1230039
Summary: | cannot attach a virtio channel device | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Luyao Huang <lhuang> |
Component: | libvirt | Assignee: | Ján Tomko <jtomko> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.2 | CC: | dyuan, honzhang, jtomko, mzhan, rbalakri, shyu, zhwang |
Target Milestone: | rc | Keywords: | Regression |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.2.17-1.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-11-19 06:41:00 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: |
Description
Luyao Huang
2015-06-10 07:41:41 UTC
First try(send a patch to upstream): https://www.redhat.com/archives/libvir-list/2015-June/msg00480.html Another version: https://www.redhat.com/archives/libvir-list/2015-June/msg01661.html Now pushed upstream: commit f967e7a6690ed20478623b0707b846f81f469ff4 Author: Luyao Huang <lhuang> AuthorDate: 2015-06-10 22:49:37 +0800 Commit: Ján Tomko <jtomko> CommitDate: 2015-07-01 08:09:43 +0200 qemu: fix address allocation on chardev attach Also check the device type when deciding what type the address should be. Commit 9807c47 (aiming to fix another error in address allocation) only checked the target type, but its value is different for different device types. This resulted in an error when trying to attach a channel with target type 'virtio': error: Failed to attach device from channel-file.xml error: internal error: virtio serial device has invalid address type Make the logic for releasing the address dependent only on * the address type * whether it was allocated earlier to avoid copying the device and target type checks. https://bugzilla.redhat.com/show_bug.cgi?id=1230039 Signed-off-by: Luyao Huang <lhuang> Signed-off-by: Ján Tomko <jtomko> git describe: v1.2.17-rc1-20-gf967e7a Verify this bug with libvirt-1.2.17-2.el7.x86_64 1. Prepare a running guest # virsh list Id Name State ---------------------------------------------------- 21 r7 running 2. Attach/detach file type channel without address element # cat channel-1.xml <channel type='file'> <source path='/tmp/file'/> <target type='virtio' name='123'/> </channel> # virsh attach-device r7 channel-1.xml Device attached successfully # virsh dumpxml r7|grep channel -A 4 <channel type='file'> <source path='/tmp/file'/> <target type='virtio' name='123'/> <alias name='channel0'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> # virsh detach-device r7 channel-1.xml Device detached successfully # virsh dumpxml r7|grep channel -A 4 3. Attach/detach file type channel with address element # cat channel-2.xml <channel type='file'> <source path='/tmp/file'/> <target type='virtio' name='123'/> <address type='virtio-serial' controller='0' bus='0' port='2'/> </channel> # virsh attach-device r7 channel-2.xml Device attached successfully # virsh dumpxml r7|grep channel -A 4 <channel type='file'> <source path='/tmp/file'/> <target type='virtio' name='123'/> <alias name='channel0'/> <address type='virtio-serial' controller='0' bus='0' port='2'/> </channel> # virsh detach-device r7 channel-2.xml Device detached successfully # virsh dumpxml r7|grep channel -A 4 So, this bug can be verified. 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://rhn.redhat.com/errata/RHBA-2015-2202.html |