[PATCH] Fix for parallel port passtrough for QEMU

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

 



Hi

 

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:
https://www.redhat.com/archives/libvirt-users/2011-September/msg00095.html
 
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
Beat
 
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 @@
         break;
 
     case VIR_DOMAIN_CHR_TYPE_DEV:
-        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);
+        }
         break;
 
     case VIR_DOMAIN_CHR_TYPE_FILE:

 

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