[PATCH] Fix USB device name mis-conversion from S-Expr to XML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"tablet" and "mouse" are set as a value of the
/local/domain/<domid>/image/hvm/usbdevice,
but libvirt expects "usbdevice" and "usbmouse" as a value.
This causes the following.
If a USB device is attached by virt-manager,
the USB device is not seen from virt-manager.

This patch fixes expected value of libvirt

Thanks,
Hiroyuki Kaguchi

Index: xend_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/xend_internal.c,v
retrieving revision 1.162
diff -u -r1.162 xend_internal.c
--- xend_internal.c	21 Jan 2008 16:29:10 -0000	1.162
+++ xend_internal.c	23 Jan 2008 00:37:02 -0000
@@ -1743,11 +1743,9 @@
             node = cur->u.s.car;
             if (sexpr_lookup(node, "usbdevice")) {
                 tmp = sexpr_node(node, "usbdevice");
-                if (tmp && *tmp) {
-                    if (!strcmp(tmp, "usbtablet"))
-                        virBufferAdd(&buf, "    <input type='tablet'
bus='usb'/>\n", 37);
-                    else if (!strcmp(tmp, "usbmouse"))
-                        virBufferAdd(&buf, "    <input type='mouse'
bus='usb'/>\n", 36);
+                if (!strcmp(tmp, "tablet") ||
+                    !strcmp(tmp, "mouse")) {
+                    virBufferVSprintf(&buf, "    <input type='%s'
bus='usb'/>\n", tmp);
                 }
             }
         }




--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]