Bug 1179680
| Summary: | Fail to install a guest if specify a non-spicevmc channel type with option --channel | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | CongDong <codong> |
| Component: | libvirt | Assignee: | Jiri Denemark <jdenemar> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.1 | CC: | dyuan, gscrivan, juzhou, mzhan, rbalakri, shyu, tzheng |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| 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:07:04 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: | |||
could you please verify if this is a regression? Does it behave differently on RHEL-7? (In reply to Giuseppe Scrivano from comment #2) > could you please verify if this is a regression? Does it behave differently > on RHEL-7? I test with virt-install-1.1.0-10.el7.noarch, and can install a guest with pty channel, but fail with rhel7.1 version. so I think it's a regression bug and add keywords with "Regression" (In reply to CongDong from comment #3) > (In reply to Giuseppe Scrivano from comment #2) > > could you please verify if this is a regression? Does it behave differently > > on RHEL-7? > > I test with virt-install-1.1.0-10.el7.noarch, and can install a guest with File the wrong version, the virt-install on rhel7.0 should be virt-install-0.10.0-20.el7.noarch patch posted upstream: https://www.redhat.com/archives/virt-tools-list/2015-January/msg00031.html from the discussion happened after my patch was posted, it seems that the problem is in libvirt as the current XML definition gives the error reported above:
<domain type="kvm">
<name>demo</name>
<uuid>5b7cb920-9d1e-440e-abab-47d353afafe0</uuid>
<memory>1048576</memory>
<currentMemory>1048576</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch="x86_64">hvm</type>
<boot dev="hd"/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<cpu mode="custom" match="exact">
<model>SandyBridge</model>
</cpu>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/bin/qemu-kvm</emulator>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/var/lib/libvirt/images/demo.img"/>
<target dev="vda" bus="virtio"/>
</disk>
<controller type="usb" index="0" model="ich9-ehci1"/>
<controller type="usb" index="0" model="ich9-uhci1">
<master startport="0"/>
</controller>
<controller type="usb" index="0" model="ich9-uhci2">
<master startport="2"/>
</controller>
<controller type="usb" index="0" model="ich9-uhci3">
<master startport="4"/>
</controller>
<interface type="network">
<source network="default"/>
<mac address="52:54:00:b0:9c:fa"/>
<model type="virtio"/>
</interface>
<input type="tablet" bus="usb"/>
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes"/>
<console type="pty"/>
<channel type="pty">
<target type="virtio"/>
</channel>
<channel type="spicevmc">
<target type="virtio" name="com.redhat.spice.0"/>
</channel>
<sound model="ich6"/>
<video>
<model type="qxl"/>
</video>
<redirdev bus="usb" type="spicevmc"/>
<redirdev bus="usb" type="spicevmc"/>
</devices>
</domain>
libvirt should not add the name="com.redhat.spice.0" to channel which type is not "spicevmc" (or at least ensure it is not used twice) as it causes qemu to fail.
the problem seems to be here (src/qemu/qemu_command.c:5670)
if (!(dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
dev->source.type == VIR_DOMAIN_CHR_TYPE_SPICEVMC &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SPICEVMC))) {
virBufferAsprintf(&buf, ",chardev=char%s,id=%s",
dev->info.alias, dev->info.alias);
if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL) {
virBufferAsprintf(&buf, ",name=%s", dev->target.name
? dev->target.name : "com.redhat.spice.0");
}
}
should the "com.redhat.spice.0" name be used only if no SPICEVMC channel is already present?
this is the qemu command line generated by libvirt: LC_ALL=C PATH=/sbin:/bin:/usr/sbin:/usr/bin HOME=/root USER=root LOGNAME=root QEMU_AUDIO_DRV=spice /bin/qemu-kvm -name demo -S -machine pc-i440fx-2.2,accel=kvm,usb=off -cpu SandyBridge -m 1024 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid f86b3815-649c-4e26-a2d1-a357c6ddad14 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/demo.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -no-reboot -boot strict=on -kernel /var/lib/libvirt/boot/virtinst-vmlinuz.eRpSUl -initrd /var/lib/libvirt/boot/virtinst-initrd.img.wu_bwY -append inst.repo=http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-7/7.0/Server/x86_64/os/ -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 -drive file=/var/lib/libvirt/images/demo.img,if=none,id=drive-virtio-disk0,format=qcow2 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=24,id=hostnet0,vhost=on,vhostfd=25 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:49:91:ea,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev pty,id=charchannel0 -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -chardev spicevmc,id=charchannel1,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0 -device usb-tablet,id=input0 -spice port=5901,addr=127.0.0.1,disable-ticketing,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=8,bus=pci.0,addr=0x2 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x8 -msg timestamp=on This issue can be reproduced with libvirt-1.1.1-29.el7_0.4 which means this is not a regression. Caused by commit 3269ee65 which claimed to move the assignment of the default spicevmc channel name from XML parsing to qemu_command.c. However, while the original code (commit b0e2bb33) did that for spicevmc channels only, commit 3269ee65 does it for every channel with undefined name. Commit 3269ee65 was released in v0.9.11 so this is quite an old bug. Sent upstream for review: https://www.redhat.com/archives/libvir-list/2015-June/msg01610.html Fixed upstream by v1.2.17-rc1-2-g365b454:
commit 365b454ed9e86fb5c7125d66924ff95ae526afdc
Author: Jiri Denemark <jdenemar>
Date: Tue Jun 30 10:21:21 2015 +0200
qemu: Fix assignment of the default spicevmc channel name
Make sure we only assign the default spicevmc channel name to spicevmc
virtio channels. Caused by commits 3269ee65 and 1133ee2b, which moved
the assignment from XML parsing code to QEMU but failed to keep the
logic.
https://bugzilla.redhat.com/show_bug.cgi?id=1179680
Signed-off-by: Jiri Denemark <jdenemar>
verify this bug with # rpm -q libvirt virt-manager libvirt-1.2.17-2.el7.x86_64 virt-manager-1.2.1-2.el7.noarch # virt-install -n demo -r 1024 --disk path=/var/lib/libvirt/images/demo.img,size=8,format=qcow2 -l http://download.englab.nay.redhat.com/pub/rhel/rel-eng/latest-RHEL-7/compose/Server/x86_64/os/ --channel pty,target_type=virtio WARNING Graphics requested but DISPLAY is not set. Not running virt-viewer. WARNING No console to launch for the guest, defaulting to --wait -1 Starting install... Retrieving file vmlinuz... | 9.8 MB 00:00:00 !!! Retrieving file initrd.img... | 75 MB 00:00:00 !!! Allocating 'demo.img' | 8.0 GB 00:00:00 Creating domain... | 0 B 00:00:00 Domain installation still in progress. Waiting for installation to complete. 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 |
Description of problem: Cannot install a guest if specify a channel which is not spicevmc type Version-Release number of selected component (if applicable): virt-manager-1.1.0-10.el7.noarch libvirt-1.2.8-11.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. # virt-install \ -n demo \ -r 1024 \ --disk path=/var/lib/libvirt/images/demo.img,size=8,format=qcow2 \ -l http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-7/7.0/Server/x86_64/os/ \ --channel pty,target_type=virtio 2. change the channel type to spicevmc: # virt-install \ -n demo \ -r 1024 \ --disk path=/var/lib/libvirt/images/demo.img,size=8,format=qcow2 \ -l http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-7/7.0/Server/x86_64/os/ \ --channel spicevmc,target_type=virtio Actual results: Step 1, will get an error: Starting install... Retrieving file vmlinuz... | 9.3 MB 00:00:00 !!! Retrieving file initrd.img... | 68 MB 00:00:00 !!! Allocating 'demo.img' | 8.0 GB 00:00:00 ERROR internal error: process exited while connecting to monitor: 2015-01-07T08:41:39.509171Z qemu-kvm: -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0: virtio-serial-bus: A port already exists by name com.redhat.spice.0 2015-01-07T08:41:39.509204Z qemu-kvm: -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0: Device 'virtserialport' could not be initialized Step2, install the guest successfully. Expected results: Can install the guest with specify other channel types Additional info: