RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1179680 - Fail to install a guest if specify a non-spicevmc channel type with option --channel
Summary: Fail to install a guest if specify a non-spicevmc channel type with option --...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-07 10:27 UTC by CongDong
Modified: 2015-11-19 06:07 UTC (History)
7 users (show)

Fixed In Version: libvirt-1.2.17-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 06:07:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description CongDong 2015-01-07 10:27:11 UTC
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:

Comment 2 Giuseppe Scrivano 2015-01-07 16:55:53 UTC
could you please verify if this is a regression?  Does it behave differently on RHEL-7?

Comment 3 CongDong 2015-01-08 06:19:14 UTC
(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"

Comment 5 CongDong 2015-01-08 07:23:08 UTC
(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

Comment 6 Giuseppe Scrivano 2015-01-08 16:00:24 UTC
patch posted upstream:

https://www.redhat.com/archives/virt-tools-list/2015-January/msg00031.html

Comment 7 Giuseppe Scrivano 2015-01-09 17:51:26 UTC
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.

Comment 8 Giuseppe Scrivano 2015-01-10 10:02:13 UTC
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?

Comment 9 Giuseppe Scrivano 2015-01-12 11:11:52 UTC
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

Comment 10 Jiri Denemark 2015-01-12 13:04:17 UTC
This issue can be reproduced with libvirt-1.1.1-29.el7_0.4 which means this is not a regression.

Comment 11 Jiri Denemark 2015-01-12 13:15:18 UTC
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.

Comment 12 Jiri Denemark 2015-01-12 13:45:28 UTC
Commit 3269ee65 was released in v0.9.11 so this is quite an old bug.

Comment 14 Jiri Denemark 2015-06-30 08:35:04 UTC
Sent upstream for review: https://www.redhat.com/archives/libvir-list/2015-June/msg01610.html

Comment 15 Jiri Denemark 2015-06-30 11:37:36 UTC
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>

Comment 17 Shanzhi Yu 2015-07-13 09:12:40 UTC
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.

Comment 19 errata-xmlrpc 2015-11-19 06:07:04 UTC
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


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