[virt-tools-list] [virt-manager PATCH] virtinst: do not add default channels if one is already present

Giuseppe Scrivano gscrivan at redhat.com
Fri Jan 9 17:20:43 UTC 2015


Cole Robinson <crobinso at redhat.com> writes:

> On 01/09/2015 06:29 AM, Giuseppe Scrivano wrote:
>> Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1179680
>> 
>
> I don't think that test case would have triggered the original behavior, you'd
> need to use the fake KVM URI, grep clitest.py for xml-comparison
>
> That said, I think the problem is elsewhere? That reproducing command from the
> bug works fine on F21. The idea was that --channel none will turn off all
> default channels, but we only skip adding the spicevmc defaults if a user has
> specified --channel spicevmc. So if someone is adding their own custom
> --channel pty, they don't have to re-specify the spicevmc one as well.
>
> Maybe it's non-intuitive but that's what the code does at the moment (we
> really need some explicit fine grained way of turning off individual defaults
> but that's a larger effort).
>
> I'm not really sure where the error is coming from on RHEL... be useful to see
> the full XML and qemu command line that is being generated.

I was able to reproduce both using the libvirt upstream version and the
version on virt-preview.  It seems that the problem is caused by the
fact that libvirt assigns the name "com.redhat.spice.0" to channels if
it is not already specified and this clashes with the spicevmc channel.
The generating this in libvirt seems to be old, git blame says 2013 for
the last change.  Probably it is something changed in qemu that started
complaining if the same name is used more than once.

Thinking more of it, probably the fix should go into libvirt, the XML
definition that causes the failure here looks like this (omitting
name="com.redhat.spice.0" does not make any difference):

<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>

Thanks,
Giuseppe




More information about the virt-tools-list mailing list