Python virStorageVolUpload binding fails on i386

Bug #1248394 reported by Robie Basak
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
uvtool
Fix Released
High
Unassigned
libvirt (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
High
Unassigned

Bug Description

[Impact]

uvtool fails to work on Precise i386, which means that juju's upcoming KVM container feature won't work when a guest is on the current LTS, which is our current recommendation.

[Test Case]

0. Start with Precise on i386
1. sudo add-apt-repository cloud-archive:tools
2. sudo apt-get update
3. sudo apt-get install uvtool-libvirt
4. sg libvirtd
5. uvt-simplestreams-libvirt sync arch=i386 release=precise

Expected results: zero exit status (some spurious errors printed)
Actual results: non-zero exit status, "libvirt.libvirtError" with "unable to seek" to a ridiculously long offset.

[Upstream Fix]

http://libvirt.org/git/?p=libvirt.git;a=commit;h=d78035d06aab73a76a82c525f41580cf986cce7b

[Development Fix]

Already on an upstream version that has the fix.

[Stable Fix]

Trivial backport of the upstream fix.

[Regression Potential]

The only change is in the Python bindings, so API calls involving 64-bit integer parameters are affected. The fix is obviously correct; upstream and Saucy both have it and so this fix has been extensively tested.

[Details]

Root cause: in the libvirt source, python/generator.py maps "unsigned long long" to PyArg_ParseTuple parameter "l", instead of "L" or "K".

Upstream fix: http://libvirt.org/git/?p=libvirt.git;a=commit;h=d78035d06aab73a76a82c525f41580cf986cce7b
Development fix: packaged from upstream
Stable fix: a trivial backport of this fix.

python-libvirt 0.9.8-2ubuntu17.13

uvtool cannot sync images using libvirt on Precise. This is limited to i386. The error looks something like:

[...]
  File "/usr/lib/python2.7/dist-packages/uvtool/libvirt/__init__.py", line 88, in _create_volume_from_fobj_with_size
    vol.upload(stream, 0, fobj_size, 0)
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 2073, in upload
    if ret == -1: raise libvirtError ('virStorageVolUpload() failed', vol=self)
libvirt.libvirtError: Unable to seek /var/lib/uvtool/libvirt/images/x-uvt-b64-Y29tLnVidW50dS5jbG91ZDpzZXJ2ZXI6MTIuMDQ6aTM4NiAyMDEzMTAyNA== to 654696742695993344: Invalid argument

Note that this ignores the signed/unsigned distinction. I think the correct fix should be "K", but upstream are using "L", which will suffice for the actual problem. To avoid diverging I think "L" is better for an SRU if we have to do it today. I have raised this separately with upstream.

Robie Basak (racb)
Changed in libvirt (Ubuntu):
importance: Undecided → High
Robie Basak (racb)
Changed in uvtool:
importance: Undecided → High
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks, I'll push the SRU as soon as you attach the debdiff.

Changed in libvirt (Ubuntu):
status: New → Confirmed
status: Confirmed → Fix Released
Changed in libvirt (Ubuntu Precise):
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Robie Basak (racb) wrote :

Debdiff attached. Thanks!

Changed in libvirt (Ubuntu Precise):
status: Confirmed → Triaged
Robie Basak (racb)
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Robie, 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.16 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
Robie Basak (racb)
description: updated
Revision history for this message
Robie Basak (racb) wrote :

Reproduced in 0.9.8-2ubuntu17.15. Confirmed fixed in 0.9.8-2ubuntu17.16. I've also checked that the amd64 binding still works (it does).

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

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

  * d/p/ubuntu/properly-parse-unsigned-long-long.patch: fix i386 Python
    binding integer length mismatch for long longs (LP: #1248394).
 -- Robie Basak <email address hidden> Fri, 08 Nov 2013 09:30:15 +0000

Changed in libvirt (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for libvirt 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.

Revision history for this message
Robie Basak (racb) wrote :

Verified fixed for Precise uvtool users using the cloud archive.

Changed in uvtool:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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