parport passthrough error

Bug #1203620 reported by anonymous on 2013-07-22
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvirt (Fedora)
Fix Released
Medium
libvirt (Ubuntu)
Medium
Unassigned
Precise
Medium
Unassigned

Bug Description

=======================================
1. Impact: parallel ports cannot be passed through to guests
2. Development fix: if the path being passed in starts with '/dev/parport'
   then tell qemu that it is a parport, not a tty.
3. Stable fix: cherrypick of the upstream fix
4. Test case: see below
5. Regression potential: this patch has been upstream for quite some time now
   so there should be no regression.
=======================================

Package: libvirt-bin
Release: 12.04
Version: 0.9.8-2ubuntu17.10

Configure virtual machine to passtrought /dev/parport0

Expect: /dev/parport0 available in guest

Happened: parport is unavailable in guest

Reason: wrong qemu launch string

have:
/usr/bin/kvm -S -M pc-1.0 -cpu qemu32 -enable-kvm -m 128 -smp 1,sockets=1,cores=1,threads=1 \
... skipped ...
-chardev tty,id=charparallel0,path=/dev/parport0 -device isa-parallel,chardev=charparallel0,id=parallel0
... skipped ...

shoud be:
/usr/bin/kvm -S -M pc-1.0 -cpu qemu32 -enable-kvm -m 128 -smp 1,sockets=1,cores=1,threads=1 \
... skipped ...
-chardev parport,id=charparallel0,path=/dev/parport0 -device isa-parallel,chardev=charparallel0,id=parallel0
... skipped ...

Fix in attachment

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

(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.

Created attachment 586043
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.

Would you mind sending the patch to <email address hidden> as well?

Patch posted to the <email address hidden>.

Fix will be in 0.9.13.

commit 7508338ff3b75b39ee9654e3d83bc58c858dc92a
Author: Beat Jörg <email address hidden>
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

anonymous (anonymouz) wrote :

The attachment "Command line generation fix for qemu" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Serge Hallyn (serge-hallyn) wrote :

Marking confirmed for precise based on upstream report (and fix present upstream :)

Changed in libvirt (Ubuntu Precise):
importance: Undecided → Medium
status: New → Triaged
Serge Hallyn (serge-hallyn) wrote :

The fix is in saucy, marking fix released.

Changed in libvirt (Ubuntu):
importance: Undecided → Medium
status: New → Fix Released
Serge Hallyn (serge-hallyn) wrote :

Thanks very much for reporting this bug and providing the buglink and patch. The fix is present as of quantal. It will be SRUd to Precise.

description: updated

Hello anonymous, or anyone else affected,

Accepted libvirt into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/libvirt/0.9.8-2ubuntu17.14 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in libvirt (Ubuntu Precise):
status: Triaged → Fix Committed
tags: added: verification-needed
Serge Hallyn (serge-hallyn) wrote :

There was a failure to build due to a bad testcase. Sorry, investigating.

Stéphane Graber (stgraber) wrote :

Hello anonymous, or anyone else affected,

Accepted libvirt into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/libvirt/0.9.8-2ubuntu17.15 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

anonymous (anonymouz) wrote :

package 0.9.8-2ubuntu17.15 working as expected

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libvirt - 0.9.8-2ubuntu17.15

---------------
libvirt (0.9.8-2ubuntu17.15) precise-proposed; urgency=low

  * update fix-for-parallel-port-passthrough-for-qemu: the xml for the new
    testcase was too modern and caused the test to fail by including new
    keywords.

libvirt (0.9.8-2ubuntu17.14) precise-proposed; urgency=low

  * qemu-delete-usb-devices-on-stop and
    qemu-build-activeusbhostdevs-on-reconnect: ensure that we can re-use
    a usb device after another domain using the device has shut
    down. (LP: #1190387) Backported from upstream git.
  * cherrypick fix-for-parallel-port-passthrough-for-qemu from upstream
    (LP: #1203620)
 -- Serge Hallyn <email address hidden> Mon, 14 Oct 2013 10:32:22 -0500

Changed in libvirt (Ubuntu Precise):
status: Fix Committed → Fix Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Changed in libvirt (Fedora):
importance: Unknown → Medium
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.