Bug 823879 - Parallel port not working in guest, wrong commandline for qemu generated
Summary: Parallel port not working in guest, wrong commandline for qemu generated
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-22 11:19 UTC by Beat Jörg
Modified: 2012-06-04 22:50 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-06-04 22:50:31 UTC
Embargoed:


Attachments (Terms of Use)
Patch that fixes the wrong commandline generated by libvirt for qemu parallel port support (846 bytes, application/octet-stream)
2012-05-22 13:46 UTC, Beat Jörg
no flags Details

Description Beat Jörg 2012-05-22 11:19:11 UTC
Description of problem:
Pass the /dev/parport0 to guest does not work with qemu-kvm

Version-Release number of selected component (if applicable):
libvirt 0.9.4

How reproducible:
always

Steps to Reproduce:
1. Configure /dev/parport0
<parallel type='dev'>
      <source path='/dev/parport0'/>
      <target port='0'/>
</parallel>

2. Start guest and try to use the parallel port.
  
Actual results:
Not working

Expected results:
Working

Additional info:
The commandline produced by libvirt looks like this:

-chardev tty,id=charparallel0,path=/dev/parport0
-device isa-parallel,chardev=charparallel0,id=parallel0

The first parameter is "tty". Should not it be "parport"?
If I start the qemu in the commandline with tty replaced with parport it is working as expected.

I will try to provide a patch that fix this issue.

There was also a post in the libvirt-users mailinglist from an other users a couple of months ago:
https://www.redhat.com/archives/libvirt-users/2011-September/msg00095.html

Comment 1 Dave Allan 2012-05-22 13:35:45 UTC
(In reply to comment #0)
> The first parameter is "tty". Should not it be "parport"?
> If I start the qemu in the commandline with tty replaced with parport it is
> working as expected.
> 
> I will try to provide a patch that fix this issue.

Thanks; if you have questions, I'm sure folks on the list would be glad to answer them.

Comment 2 Beat Jörg 2012-05-22 13:46:20 UTC
Created attachment 586043 [details]
Patch that fixes the wrong commandline generated by libvirt for qemu parallel port support

Not sure if this is fix is very clean, but for my case it works. 
Perhaps it should also be check if similar problems / patches are required for other chardev backends.

Comment 3 Dave Allan 2012-05-22 15:41:45 UTC
Would you mind sending the patch to libvir-list as well?

Comment 4 Beat Jörg 2012-05-23 05:51:47 UTC
Patch posted to the libvir-list.

Comment 5 Eric Blake 2012-06-04 22:50:31 UTC
Fix will be in 0.9.13.

commit 7508338ff3b75b39ee9654e3d83bc58c858dc92a
Author: Beat Jörg <Beat.Joerg>
Date:   Wed May 23 07:50:02 2012 +0200

    Fix for parallel port passthrough for QEMU
    
    I came across a bug that the command line generated for passthrough
    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


Note You need to log in before you can comment on or make changes to this bug.