Bug 1169045 - virt-sparsify: libguestfs error: qemu-img info: 'virtual-size' is not representable as a 64 bit integer
Summary: virt-sparsify: libguestfs error: qemu-img info: 'virtual-size' is not represe...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-29 11:39 UTC by Richard W.M. Jones
Modified: 2014-11-29 11:54 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-11-29 11:54:33 UTC
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2014-11-29 11:39:58 UTC
Description of problem:

(Reported by muued on IRC)

Using it for my 10GiB image results in the following message:

  virt-sparsify: libguestfs error: qemu-img info: 'virtual-size' is not representable as a 64 bit integer

From the debug output:

libguestfs: parse_json: qemu-img info JSON output:\n{\n    "virtual-size": 10737418240, \n    
               "filename": "/dev/fd/4", \n    "cluster-size": 65536, \n    "format": "qcow2", \n    "actual-size": 
               9651417088, \n    "format-specific": {\n        "type": "qcow2", \n        "data": {\n            
               "compat": "0.10"\n        }\n    }, \n    "dirty-flag": false\n}\n\n
libguestfs: trace: disk_virtual_size = -1 (error)

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

qemu 2.1.2
yajl 2.0.3
virt-sparsify 1.26.1
64 bit host

How reproducible:

Unknown.

Additional information:

The error message comes from libguestfs.git/src/info.c:

  len = YAJL_GET_OBJECT(tree)->len;
  for (i = 0; i < len; ++i) {
    if (STREQ (YAJL_GET_OBJECT(tree)->keys[i], "virtual-size")) {
      yajl_val node = YAJL_GET_OBJECT(tree)->values[i];
      if (YAJL_IS_NULL (node))
        goto bad_type;
      if (! YAJL_IS_NUMBER (node))
        goto bad_type;
      if (! YAJL_IS_INTEGER (node)) {
        error (g, _("qemu-img info: 'virtual-size' is not representable as a 64 bit integer"));
        return -1;
      }
      return YAJL_GET_INTEGER (node);
    }
  }

Comment 1 Richard W.M. Jones 2014-11-29 11:50:51 UTC
Reproducer:

$ guestfish -N disk:10G disk-virtual-size test1.img

(Note this doesn't reproduce the problem for me, but the
original reporter has confirmed that it is a reproducer)

Comment 2 Richard W.M. Jones 2014-11-29 11:54:33 UTC
Thanks to muued for also chasing up the fix.  It turned out to be
a yajl bug, fixed by:

https://github.com/lloyd/yajl/commit/b0ea41643e411730b8411e282b229d98d5eb38b6

(or updating to yajl >= 2.0.4)


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