[libvirt] libvirt spice command line appears to be incorrect (was: Re: [virt-tools-list] vdagent does not start with domain defined by virt-manager 0.8.7)

[Copying this to libvir-list] On Mon, Apr 25, 2011 at 01:07:37AM +0400, Emre Erenoglu wrote:
Hi,
I'm the package maintainer for virt-manager and related packages for Pardus distribution. While testing the latest libvirt, virtinst & virt-manager packages, I've come across a strange issue and I would like to get your valuable opinion.
I add all spice related devices and everything works good, except the vdagent inside the windows xp guest. The virtio serial driver is loaded correctly. As I track down the issue, I found out that libvirt is starting qemu-kvm with parameters which do not match the ones adviced by the spice people. Please see below email discussion with them on this. The offending line seems to be the chardev parameter. qemu-kvm is started by virt-manager with the following parameter for chardev:
-chardev null,id=channel0
and the full spice related parameters are:
-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x8 -chardev null,id=channel0 -device virtserialport,bus=virtio-serial0.0,nr=0,chardev=channel0,name=com.redhat.spice.0 -usb -device usb-tablet,id=input0 -spice port=5900,addr=127.0.0.1,disable-ticketing -vga qxl -device qxl,id=video1,bus=pci.0,addr=0x7
while spice people adviced:
-chardev spicevmc,id=channel0,name=vdagent
and the rest of the parameters to match it. See below mail on the details. I don't know if this is really the issue, but I also recognize the following inside the domain XML:
<channel type='null'> <target type='virtio' name='com.redhat.spice.0'/> <address type='virtio-serial' controller='0' bus='0' port='0'/> </channel>
the "channel type" is listed as "null", while I assume it should have been listed as "spicevmc". (not sure of this, I saw this in some other websites). When I edit the domain xml with virsh edit, it saves my changes but the "null" stays the same how many times I try to change it.
Please note that I've applied the following patches to virtinst 0.500.6:
constrain-spicevmc-usage-correct.patch virtinst-fix-channel-parse.patch virtinst-spicevmc-fixes.patch
which I obtained from the git. I also patched virt-manager 0.8.7 with the following I obtained from the git:
chardev-hide-unsupported-params-for-selected-type.patch only-show-relevant-char-device-fields.patch show-char-device-target-name.patch chardev-propose-to-add-remove-spice-agent.patch allow-setting-char-device-target-name.patch fix-adding-removing-channel-device.patch
Any idea what I might be missing to get the vdagent run inside the windows guest?
Many thanks,
Emre Erenoglu
---------- Forwarded message ---------- From: Marian Krcmarik <mkrcmari@redhat.com> Date: Mon, Apr 18, 2011 at 5:56 PM Subject: Re: [Spice-devel] vdagent does not start To: Emre Erenoglu <erenoglu@gmail.com> Cc: spice-devel@lists.freedesktop.org
----- Original Message -----
From: "Emre Erenoglu" <erenoglu@gmail.com> To: spice-devel@lists.freedesktop.org Sent: Sunday, April 17, 2011 1:10:16 PM Subject: [Spice-devel] vdagent does not start Dear Developers,
I have a virtual XP system with the spice channel enabled through the serial port. The command line that runs qemu has (reduced):
-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x8 -chardev null,id=channel0 -device
virtserialport,bus=virtio-serial0.0,nr=0,chardev=channel0,name=com.redhat.spice.0
-usb -device usb-tablet,id=input0 -spice port=5900,addr=127.0.0.1,disable-ticketing -vga qxl -device qxl,id=video1,bus=pci.0,addr=0x7
I think you may need to specify chardev for spice so I would modify:
-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x8 -chardev spicevmc,id=channel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=0,chardev=channel0,name=com.redhat.spice.0 -usb -device usb-tablet,id=input0 -spice port=5900,addr=127.0.0.1,disable-ticketing -vga qxl -device qxl,id=video1,bus=pci.0,addr=0x7
with agent and virtio-serial driver installed on guest.
However, the vdagent services does not start. when I give it a start control, it reports to start then stop immediately. Here are the logs I've found:
-- Emre
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora

On 04/25/2011 04:27 AM, Richard W.M. Jones wrote:
[Copying this to libvir-list]
On Mon, Apr 25, 2011 at 01:07:37AM +0400, Emre Erenoglu wrote:
Hi,
I'm the package maintainer for virt-manager and related packages for Pardus distribution. While testing the latest libvirt, virtinst & virt-manager packages, I've come across a strange issue and I would like to get your valuable opinion.
I add all spice related devices and everything works good, except the vdagent inside the windows xp guest. The virtio serial driver is loaded correctly. As I track down the issue, I found out that libvirt is starting qemu-kvm with parameters which do not match the ones adviced by the spice people. Please see below email discussion with them on this. The offending line seems to be the chardev parameter. qemu-kvm is started by virt-manager with the following parameter for chardev:
-chardev null,id=channel0
and the full spice related parameters are:
-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x8 -chardev null,id=channel0 -device virtserialport,bus=virtio-serial0.0,nr=0,chardev=channel0,name=com.redhat.spice.0 -usb -device usb-tablet,id=input0 -spice port=5900,addr=127.0.0.1,disable-ticketing -vga qxl -device qxl,id=video1,bus=pci.0,addr=0x7
while spice people adviced:
-chardev spicevmc,id=channel0,name=vdagent
and the rest of the parameters to match it. See below mail on the details. I don't know if this is really the issue, but I also recognize the following inside the domain XML:
<channel type='null'> <target type='virtio' name='com.redhat.spice.0'/> <address type='virtio-serial' controller='0' bus='0' port='0'/> </channel>
the "channel type" is listed as "null", while I assume it should have been listed as "spicevmc". (not sure of this, I saw this in some other websites). When I edit the domain xml with virsh edit, it saves my changes but the "null" stays the same how many times I try to change it.
Please note that I've applied the following patches to virtinst 0.500.6:
constrain-spicevmc-usage-correct.patch virtinst-fix-channel-parse.patch virtinst-spicevmc-fixes.patch
which I obtained from the git. I also patched virt-manager 0.8.7 with the following I obtained from the git:
chardev-hide-unsupported-params-for-selected-type.patch only-show-relevant-char-device-fields.patch show-char-device-target-name.patch chardev-propose-to-add-remove-spice-agent.patch allow-setting-char-device-target-name.patch fix-adding-removing-channel-device.patch
Any idea what I might be missing to get the vdagent run inside the windows guest?
Many thanks,
Emre Erenoglu
What libvirt version are you using? spicevmc requires libvirt 0.8.8. However if libvirt is silently reverting to 'null' it's a bug either way. - Cole

On Mon, Apr 25, 2011 at 6:28 PM, Cole Robinson <crobinso@redhat.com> wrote:
[Copying this to libvir-list]
On Mon, Apr 25, 2011 at 01:07:37AM +0400, Emre Erenoglu wrote:
Hi,
I'm the package maintainer for virt-manager and related packages for Pardus distribution. While testing the latest libvirt, virtinst & virt-manager packages, I've come across a strange issue and I would like to get your valuable opinion.
I add all spice related devices and everything works good, except the vdagent inside the windows xp guest. The virtio serial driver is loaded correctly. As I track down the issue, I found out that libvirt is starting qemu-kvm with parameters which do not match the ones adviced by the spice people. Please see below email discussion with them on this. The offending line seems to be the chardev parameter. qemu-kvm is started by virt-manager with the following parameter for chardev:
-chardev null,id=channel0
and the full spice related parameters are:
-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x8 -chardev null,id=channel0 -device
virtserialport,bus=virtio-serial0.0,nr=0,chardev=channel0,name=com.redhat.spice.0
-usb -device usb-tablet,id=input0 -spice port=5900,addr=127.0.0.1,disable-ticketing -vga qxl -device qxl,id=video1,bus=pci.0,addr=0x7
while spice people adviced:
-chardev spicevmc,id=channel0,name=vdagent
and the rest of the parameters to match it. See below mail on the
I don't know if this is really the issue, but I also recognize the following inside the domain XML:
<channel type='null'> <target type='virtio' name='com.redhat.spice.0'/> <address type='virtio-serial' controller='0' bus='0' port='0'/> </channel>
the "channel type" is listed as "null", while I assume it should have been listed as "spicevmc". (not sure of this, I saw this in some other websites). When I edit the domain xml with virsh edit, it saves my changes but the "null" stays the same how many times I try to change it.
Please note that I've applied the following patches to virtinst 0.500.6:
constrain-spicevmc-usage-correct.patch virtinst-fix-channel-parse.patch virtinst-spicevmc-fixes.patch
which I obtained from the git. I also patched virt-manager 0.8.7 with
On 04/25/2011 04:27 AM, Richard W.M. Jones wrote: details. the
following I obtained from the git:
chardev-hide-unsupported-params-for-selected-type.patch only-show-relevant-char-device-fields.patch show-char-device-target-name.patch chardev-propose-to-add-remove-spice-agent.patch allow-setting-char-device-target-name.patch fix-adding-removing-channel-device.patch
Any idea what I might be missing to get the vdagent run inside the windows guest?
Many thanks,
Emre Erenoglu
What libvirt version are you using? spicevmc requires libvirt 0.8.8. However if libvirt is silently reverting to 'null' it's a bug either way.
Hi Cole, I recognized that I was using 0.8.7 since our iptables version does not support the newly added "CHECKSUM" parameter that libvirt used for iptables commands. I disabled this by patching it and now libvirt 0.9.0 runs good, with the vdagent in the guest also working OK. Many thanks for all who spent their time to fix this issue. yes, libvirt 0.8.7 was silently reverting the change I made manually in the xml file. Neither virsh edit nor editing the xml and re-defining it worked. Once libvirt saw the "spicevmc" there, it just removed it and put "null" instead. -- Emre

On 04/25/2011 03:54 PM, Emre Erenoglu wrote:
yes, libvirt 0.8.7 was silently reverting the change I made manually in the xml file. Neither virsh edit nor editing the xml and re-defining it worked. Once libvirt saw the "spicevmc" there, it just removed it and put "null" instead.
There has been some upstream work to make libvirt do better at detecting bogus configurations, but I'm not sure off the top of my head if it includes the instance you tripped over. So, the question remains whether we have already fixed the bug in 0.9.0, or whether, if you put in some other random string in place of "spicevmc", then would libvirt still silently change that to "null" instead of rejecting the XML. If the former, great - we've cleaned it up! If the latter, then this is a bug still in libvirt worth fixing. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Tue, Apr 26, 2011 at 2:05 AM, Eric Blake <eblake@redhat.com> wrote:
yes, libvirt 0.8.7 was silently reverting the change I made manually in
On 04/25/2011 03:54 PM, Emre Erenoglu wrote: the
xml file. Neither virsh edit nor editing the xml and re-defining it worked. Once libvirt saw the "spicevmc" there, it just removed it and put "null" instead.
There has been some upstream work to make libvirt do better at detecting bogus configurations, but I'm not sure off the top of my head if it includes the instance you tripped over. So, the question remains whether we have already fixed the bug in 0.9.0, or whether, if you put in some other random string in place of "spicevmc", then would libvirt still silently change that to "null" instead of rejecting the XML. If the former, great - we've cleaned it up! If the latter, then this is a bug still in libvirt worth fixing.
I re-installed 0.8.7. It re-wrote the existing virtual machine channel device definition (which used to be "spicevmc" with 0.9.0) back to 'null'. I tried to edit it by hand, with any string, always reverted to 'null'. In libvirt 0.9.0, editing by hand to replace 'null' with 'spicevmc' works. Editing by hand to an arbitrary string, fails with the following error message (when I put 'emre' instead of 'null'): error: XML description for unknown type presented to host for character device: emre is not well formed or invalid So looks like it's fixed in 0.9.0 but I let you conclude the 0.8.7 behaviour. -- Emre
participants (4)
-
Cole Robinson
-
Emre Erenoglu
-
Eric Blake
-
Richard W.M. Jones