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

[libvirt] [PATCH] Fix for parallel port passtrough for QEMU



As requested by Dave, I send this to the list.


I came across a bug that the command line generated for passtrough of the host parallel port /dev/parport0 by libvirt for QEMU is incorrect.


It currently produces:

-chardev tty,id=charparallel0,path=/dev/parport0

-device isa-parallel,chardev=charparallel0,id=parallel0


The first parameter is "tty". It sould be "parport".
If I launch qemu with –chardev parport,… it works as expected.
I have already filled a bug report ( https://bugzilla.redhat.com/show_bug.cgi?id=823879 ), the topic was already on the list some months ago:
Not sure if this is fix is very clean, but for my case it works. 
Perhaps it should also be checked if similar problems / patches are required for other chardev backends.
Kind regards
diff -Naur libvirt-0.9.4.orig/src/qemu/qemu_command.c libvirt-0.9.4/src/qemu/qemu_command.c
--- libvirt-0.9.4.orig/src/qemu/qemu_command.c       2012-05-22 13:40:16.788633656 +0200
+++ libvirt-0.9.4/src/qemu/qemu_command.c     2012-05-22 13:52:18.453608557 +0200
@@ -2357,8 +2357,14 @@
-        virBufferAsprintf(&buf, "tty,id=char%s,path=%s", alias,
-                          dev->data.file.path);
+        if (STRPREFIX(dev->data.file.path, "/dev/parport")) {
+            virBufferAsprintf(&buf, "parport,id=char%s,path=%s", alias,
+                              dev->data.file.path);
+        }
+        else {
+            virBufferAsprintf(&buf, "tty,id=char%s,path=%s", alias,
+                              dev->data.file.path);
+        }


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