Python virStorageVolUpload binding fails on i386

Bug #1248394 reported by Robie Basak on 2013-11-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)

Bug Description


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


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

Upstream fix:;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/", line 88, in _create_volume_from_fobj_with_size
    vol.upload(stream, 0, fobj_size, 0)
  File "/usr/lib/python2.7/dist-packages/", 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) on 2013-11-06
Changed in libvirt (Ubuntu):
importance: Undecided → High
Robie Basak (racb) on 2013-11-06
Changed in uvtool:
importance: Undecided → High
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
Robie Basak (racb) wrote :

Debdiff attached. Thanks!

Changed in libvirt (Ubuntu Precise):
status: Confirmed → Triaged
Robie Basak (racb) on 2013-11-08
description: updated

Hello Robie, or anyone else affected,

Accepted libvirt into precise-proposed. The package will build now and be available at in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See 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 . Thank you in advance!

Changed in libvirt (Ubuntu Precise):
status: Triaged → Fix Committed
tags: added: verification-needed
Robie Basak (racb) on 2013-11-19
description: updated
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
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

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.

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  Edit
Everyone can see this information.

Other bug subscribers