[libvirt-users] failure when trying to add a channel device via virsh attach-device

Hi, On a KVM host installed with following packages versions : [root@rhel6-roadster test_channels_OK]# rpm -qa | grep libvirt libvirt-devel-0.10.2-29.el6.x86_64 libvirt-0.10.2-29.el6.x86_64 libvirt-client-0.10.2-29.el6.x86_64 libvirt-java-0.4.9-1.el6.noarch libvirt-java-devel-0.4.9-1.el6.noarch libvirt-python-0.10.2-29.el6.x86_64 [root@rhel6-roadster test_channels_OK]# rpm -qa | grep qemu qemu-kvm-0.12.1.2-2.415.el6.x86_64 gpxe-roms-qemu-0.9.7-6.10.el6.noarch qemu-img-0.12.1.2-2.415.el6.x86_64 [root@rhel6-roadster test_channels_OK]# virsh --version 0.10.2 [root@rhel6-roadster test_channels_OK]# When trying to add a channel device via virsh attach-device , I got following errors : <channel type='unix'> <source mode='bind' path='//var/lib/libvirt/qemu/omnivision_123456.agent'/> <target type='virtio' name='omnivision_123456.agent' state='disconnected'/> <alias name='channel_OmniVision'/> <address type='virtio-serial' controller='0' bus='0' port='30'/> </channel> Guest is off : [root@rhel6-roadster test_channels_OK]# virsh attach-device Linux_2 add_channel_device.xml error: Failed to attach device from add_channel_device.xml error: Requested operation is not valid: cannot do live update a device on inactive domain [root@rhel6-roadster test_channels_OK]# Guest is running : [root@rhel6-roadster test_channels_OK]# virsh attach-device Linux_2 add_channel_device.xml error: Failed to update device from add_channel_device.xml error: XML error: unknown device type [root@rhel6-roadster test_channels_OK] Did I miss something ? Thanks for help. J.P. Ribeauville P: +33.(0).1.47.17.27.87 Puteaux 3 Etage 5 Bureau 4 jpribeauville@axway.com<mailto:jpribeauville@axway.com> http://www.axway.com<http://www.axway.com/> P Pensez à l'environnement avant d'imprimer.

On Mon, Sep 21, 2015 at 08:16:17 +0000, Jean-Pierre Ribeauville wrote:
Hi, On a KVM host installed with following packages versions :
[root@rhel6-roadster test_channels_OK]# rpm -qa | grep libvirt libvirt-devel-0.10.2-29.el6.x86_64 libvirt-0.10.2-29.el6.x86_64 libvirt-client-0.10.2-29.el6.x86_64 libvirt-java-0.4.9-1.el6.noarch libvirt-java-devel-0.4.9-1.el6.noarch libvirt-python-0.10.2-29.el6.x86_64 [root@rhel6-roadster test_channels_OK]# rpm -qa | grep qemu qemu-kvm-0.12.1.2-2.415.el6.x86_64 gpxe-roms-qemu-0.9.7-6.10.el6.noarch qemu-img-0.12.1.2-2.415.el6.x86_64 [root@rhel6-roadster test_channels_OK]# virsh --version 0.10.2 [root@rhel6-roadster test_channels_OK]#
When trying to add a channel device via virsh attach-device , I got following errors :
<channel type='unix'> <source mode='bind' path='//var/lib/libvirt/qemu/omnivision_123456.agent'/> <target type='virtio' name='omnivision_123456.agent' state='disconnected'/> <alias name='channel_OmniVision'/> <address type='virtio-serial' controller='0' bus='0' port='30'/> </channel>
Guest is off :
[root@rhel6-roadster test_channels_OK]# virsh attach-device Linux_2 add_channel_device.xml error: Failed to attach device from add_channel_device.xml error: Requested operation is not valid: cannot do live update a device on inactive domain
This was a bug in older versions. In case when the VM is offline you'll need to explicitly use the '--config' flag so that only the configuration is updated.
[root@rhel6-roadster test_channels_OK]#
Guest is running :
[root@rhel6-roadster test_channels_OK]# virsh attach-device Linux_2 add_channel_device.xml error: Failed to update device from add_channel_device.xml error: XML error: unknown device type
The libvirt version you are using does not support character device hotplug, so you'll not be able to hotplug a channel at this point. You'll need to use at least libvirt-1.1.1 or a version that backported commit: commit 24b0821926ead364a625210940773d7da43f1577 Author: Michal Privoznik <mprivozn@redhat.com> Date: Wed Mar 13 11:08:55 2013 +0100 qemu: Implement chardev hotplug on live level Since previous patches has prepared everything for us, we may now implement live hotplug of a character device. and the preliminary fixes. Peter

Hi, I was aware of the fact that I cannot do device hotplug with this version.. By using my "old" version , is it possible via virsh (without using virsh edit) to add a device when the guest is shutdown ? Thanks for help.. J.P. -----Message d'origine----- De : Peter Krempa [mailto:pkrempa@redhat.com] Envoyé : lundi 21 septembre 2015 11:19 À : Jean-Pierre Ribeauville Cc : libvirt-users@redhat.com Objet : Re: [libvirt-users] failure when trying to add a channel device via virsh attach-device On Mon, Sep 21, 2015 at 08:16:17 +0000, Jean-Pierre Ribeauville wrote:
Hi, On a KVM host installed with following packages versions :
[root@rhel6-roadster test_channels_OK]# rpm -qa | grep libvirt libvirt-devel-0.10.2-29.el6.x86_64 libvirt-0.10.2-29.el6.x86_64 libvirt-client-0.10.2-29.el6.x86_64 libvirt-java-0.4.9-1.el6.noarch libvirt-java-devel-0.4.9-1.el6.noarch libvirt-python-0.10.2-29.el6.x86_64 [root@rhel6-roadster test_channels_OK]# rpm -qa | grep qemu qemu-kvm-0.12.1.2-2.415.el6.x86_64 gpxe-roms-qemu-0.9.7-6.10.el6.noarch qemu-img-0.12.1.2-2.415.el6.x86_64 [root@rhel6-roadster test_channels_OK]# virsh --version 0.10.2 [root@rhel6-roadster test_channels_OK]#
When trying to add a channel device via virsh attach-device , I got following errors :
<channel type='unix'> <source mode='bind' path='//var/lib/libvirt/qemu/omnivision_123456.agent'/> <target type='virtio' name='omnivision_123456.agent' state='disconnected'/> <alias name='channel_OmniVision'/> <address type='virtio-serial' controller='0' bus='0' port='30'/> </channel>
Guest is off :
[root@rhel6-roadster test_channels_OK]# virsh attach-device Linux_2 add_channel_device.xml error: Failed to attach device from add_channel_device.xml error: Requested operation is not valid: cannot do live update a device on inactive domain
This was a bug in older versions. In case when the VM is offline you'll need to explicitly use the '--config' flag so that only the configuration is updated.
[root@rhel6-roadster test_channels_OK]#
Guest is running :
[root@rhel6-roadster test_channels_OK]# virsh attach-device Linux_2 add_channel_device.xml error: Failed to update device from add_channel_device.xml error: XML error: unknown device type
The libvirt version you are using does not support character device hotplug, so you'll not be able to hotplug a channel at this point. You'll need to use at least libvirt-1.1.1 or a version that backported commit: commit 24b0821926ead364a625210940773d7da43f1577 Author: Michal Privoznik <mprivozn@redhat.com> Date: Wed Mar 13 11:08:55 2013 +0100 qemu: Implement chardev hotplug on live level Since previous patches has prepared everything for us, we may now implement live hotplug of a character device. and the preliminary fixes. Peter
participants (2)
-
Jean-Pierre Ribeauville
-
Peter Krempa