qemu-img bug with dynamic vhd

Bug #893956 reported by z22lad
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
QEMU
Won't Fix
Undecided
Unassigned

Bug Description

Hye, i found a problem with qemu-img when trying to get info of a dynamic vhd. I made imgae of my 60GB computer hard drive with disk2vhd. The dynamic vhd is 21gb size.

With 1.0-rc3 version :
running command: qemu-img info 60_GB.VHD
qemu-img: Could not open '60_GB.VHD' : File too large

0.14.1 version give me wrong information :
image: 60_GB.VHD
file format: vpc
virtual size: 127G (136899993600 bytes)
disk size: 21G

Thanks for reply.

Revision history for this message
Stefan Hajnoczi (stefanha) wrote : Re: [Qemu-devel] [Bug 893956] [NEW] qemu-img bug with dynamic vhd

On Wed, Nov 23, 2011 at 11:33 AM, z22lad <email address hidden> wrote:
> Hye, i found a problem with qemu-img when trying to get info of a
> dynamic vhd. I made imgae of my 60GB computer hard drive with disk2vhd.
> The dynamic vhd is 21gb size.
>
> With 1.0-rc3 version :
> running command: qemu-img info 60_GB.VHD
> qemu-img:  Could not open '60_GB.VHD' : File too large
>
> 0.14.1 version give me wrong information :
> image: 60_GB.VHD
> file format: vpc
> virtual size: 127G (136899993600 bytes)
> disk size: 21G

Which host OS are you running qemu-img on? Is it 32- or 64-bit?

I wonder if you get the same behavior when using qemu-img convert
instead of "disk2vhd" to create a vhd file.

Stefan

Revision history for this message
franxico (batuque) wrote :

Hi,

I'm having the same problem. I'm using qemu-img 1.0, running from a Ubuntu Server 12.04 x64 on a SW RAID, ext4.

The .VHD has 29GB and was made using disk2vhd.

Here is the command and the results:
sudo kvm-img convert -f vpc -O raw image.VHD image.img
[sudo] password for sysop:
kvm-img: Could not open 'image.VHD': File too large
kvm-img: Could not open 'image.VHD'

Same error doing a simple qemu-img info image.vhd

Thanks for your help

Revision history for this message
Stefan Hajnoczi (stefanha) wrote : Re: [Qemu-devel] [Bug 893956] Re: qemu-img bug with dynamic vhd

On Mon, Sep 3, 2012 at 10:41 AM, franxico <email address hidden> wrote:
> Hi,
>
> I'm having the same problem. I'm using qemu-img 1.0, running from a
> Ubuntu Server 12.04 x64 on a SW RAID, ext4.
>
> The .VHD has 29GB and was made using disk2vhd.
>
> Here is the command and the results:
> sudo kvm-img convert -f vpc -O raw image.VHD image.img
> [sudo] password for sysop:
> kvm-img: Could not open 'image.VHD': File too large
> kvm-img: Could not open 'image.VHD'
>
> Same error doing a simple qemu-img info image.vhd

Serge Hallyn introduced the size check when VHD files are opened, you
can read about the background here:
http://patchwork.ozlabs.org/patch/106736/

I'm not sure if QEMU has a bug or lacks support for the file format
version used by disk2vhd.

>
> Thanks for your help
>
> --
> You received this bug notification because you are a member of qemu-
> devel-ml, which is subscribed to QEMU.
> https://bugs.launchpad.net/bugs/893956
>
> Title:
> qemu-img bug with dynamic vhd
>
> Status in QEMU:
> New
>
> Bug description:
> Hye, i found a problem with qemu-img when trying to get info of a
> dynamic vhd. I made imgae of my 60GB computer hard drive with
> disk2vhd. The dynamic vhd is 21gb size.
>
> With 1.0-rc3 version :
> running command: qemu-img info 60_GB.VHD
> qemu-img: Could not open '60_GB.VHD' : File too large
>
> 0.14.1 version give me wrong information :
> image: 60_GB.VHD
> file format: vpc
> virtual size: 127G (136899993600 bytes)
> disk size: 21G
>
> Thanks for reply.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/qemu/+bug/893956/+subscriptions
>

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Though that commit and the comments were about 127G images. HIs is only 27G.

Also, 'qemu-img info' is also showing the error, which shows that this is not being done on vpc_create().

So I think this is a case of qemu-img actually failing to properly parse the FHD file.

Revision history for this message
Stefan Hajnoczi (stefanha) wrote :

On Tue, Sep 4, 2012 at 4:00 PM, Serge Hallyn <email address hidden> wrote:
> Though that commit and the comments were about 127G images. HIs is only
> 27G.

The 127 GB limit applies to the virtual disk size, not to the size of
the image file itself.

> Also, 'qemu-img info' is also showing the error, which shows that this
> is not being done on vpc_create().

I'm not sure what you mean. Your commit (efc8243d00) added an -EFBIG
return to vcp_open(), not vpc_create(). This will affect qemu-img
info.

We need the header/footer contents to be sure what's going on here.

Stefan

Revision history for this message
Stefan Hajnoczi (stefanha) wrote :

On Mon, Sep 3, 2012 at 10:41 AM, franxico <email address hidden> wrote:
> Hi,
>
> I'm having the same problem. I'm using qemu-img 1.0, running from a
> Ubuntu Server 12.04 x64 on a SW RAID, ext4.
>
> The .VHD has 29GB and was made using disk2vhd.
>
> Here is the command and the results:
> sudo kvm-img convert -f vpc -O raw image.VHD image.img
> [sudo] password for sysop:
> kvm-img: Could not open 'image.VHD': File too large
> kvm-img: Could not open 'image.VHD'
>
> Same error doing a simple qemu-img info image.vhd

Please post the output of the following commands:

$ hexdump -C -n 512 image.VHD
$ hexdump -C -n 512 -s $(($(ls -l image.VHD | awk '{ print $5 }') -
512)) image.VHD

This will show the file header/footer, which contains fields that are
validated when opening the file.

Thanks,
Stefan

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Quoting Stefan Hajnoczi (<email address hidden>):
> On Tue, Sep 4, 2012 at 4:00 PM, Serge Hallyn <email address hidden> wrote:
> > Though that commit and the comments were about 127G images. HIs is only
> > 27G.
>
> The 127 GB limit applies to the virtual disk size, not to the size of
> the image file itself.

I thought he had converted a roughly 26GB physical disk, assumed (perhaps
wrongly) that was the virtual disk size.

> > Also, 'qemu-img info' is also showing the error, which shows that this
> > is not being done on vpc_create().
>
> I'm not sure what you mean. Your commit (efc8243d00) added an -EFBIG
> return to vcp_open(), not vpc_create(). This will affect qemu-img
> info.

Oops, good point. Thanks.

> We need the header/footer contents to be sure what's going on here.

Revision history for this message
Bobby Dimmette (bjdimmette) wrote :
Download full text (3.2 KiB)

qemu-img fails to read a disk2vhd (VHD) image created from a Windows Server 2003.
qemu-img will read and convert a VDI image created from that VHD

VHD header/footer details:

[root@T3400 ]# qemu-img info vhd/p.vhd
qemu-img: Could not open 'vhd/p.vhd': File too large

[root@T3400 ]# ./vhddump -vv -s vhd/p.vhd
Positioning descriptor to VHD footer...
Reading VHD footer...
------------------------
 VHD Footer (512 bytes)
------------------------
 Cookie = conectix
 Features = 0x00000002
 File Format Version = 0x00010000
 Data Offset = 0x0000000000000200
 Time Stamp = 0x1893342A
 Creator Application = 0x64327600
 Creator Version = 0x00010000
 Creator Host OS = 0x5769326B
 Original Size = 0x000000222E6F4000
                     = 140006 MB + 976 KiB
 Current Size = 0x000000222E6F4000
                     = 140006 MB + 976 KiB
 Disk Geometry = 0xFFFF10FF
           Cylinders = 65535
               Heads = 16
       Sectors/Track = 255
 Disk Type = 0x00000003
                     = Dynamic hard disk
 Checksum = 0xFFFFEDD8
 Unique ID = 765e24b9-1e33-594a-864e-f39aea210f24
 Saved State = 0x00
 Reserved = <...427 bytes...>
===============================================
Detecting disk type...
Dynamic hard disk detected.
Positioning descriptor to read VHD footer copy...
Reading VHD footer copy...
------------------------
 VHD Footer (512 bytes)
------------------------
 Cookie = conectix
 Features = 0x00000002
 File Format Version = 0x00010000
 Data Offset = 0x0000000000000200
 Time Stamp = 0x1893342A
 Creator Application = 0x64327600
 Creator Version = 0x00010000
 Creator Host OS = 0x5769326B
 Original Size = 0x000000222E6F4000
                     = 140006 MB + 976 KiB
 Current Size = 0x000000222E6F4000
                     = 140006 MB + 976 KiB
 Disk Geometry = 0xFFFF10FF
           Cylinders = 65535
               Heads = 16
       Sectors/Track = 255
 Disk Type = 0x00000003
                     = Dynamic hard disk
 Checksum = 0xFFFFEDD8
 Unique ID = 765e24b9-1e33-594a-864e-f39aea210f24
 Saved State = 0x00
 Reserved = <...427 bytes...>
===============================================
Reading VHD dynamic disk header...
--------------------------------------
 VHD Dynamic Disk Header (1024 bytes)
--------------------------------------
 Cookie = cxsparse
 Data Offset = 0xFFFFFFFFFFFFFFFF
 Table Offset = 0x0000000000000600
 Header Version = 0x00010000
 Max Table Entries = 0x00011174
 Block Size = 0x00200000
 Checksum = 0xFFFFF3F1
 Parent UUID = 00000000-0000-0000-0000-000000000000
 Parent TS = 0x00000000
                       0 (10)
 Reserved = <...4 bytes...>
 Parent Unicode Name = <...512 bytes...>
 Parent Loc Entry 1 = <...24 bytes...>
 Parent Loc Entry 2 = <...24 bytes...>
 Parent Loc Entry 3 = <...24 bytes...>
 Parent Loc Entry 4 = <...24 bytes...>
 Parent Loc Entry 5 = <...24 bytes...>
 Parent Loc Entry 6 = <...24 bytes.....

Read more...

Revision history for this message
Thomas Huth (th-huth) wrote :

Can you still reproduce this problem with the latest version of QEMU (currently version 2.9.0)?

Changed in qemu:
status: New → Incomplete
Revision history for this message
Bobby Dimmette (bjdimmette) wrote : RE: [Bug 893956] Re: qemu-img bug with dynamic vhd

No, sorry. The environment was retired in 2014 and we took a different direction.

-Bobby

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Thomas Huth
Sent: Wednesday, June 07, 2017 4:44 AM
To: <email address hidden>
Subject: [Bug 893956] Re: qemu-img bug with dynamic vhd

Can you still reproduce this problem with the latest version of QEMU (currently version 2.9.0)?

** Changed in: qemu
       Status: New => Incomplete

--
You received this bug notification because you are subscribed to the bug report.
https://bugs.launchpad.net/bugs/893956

Title:
  qemu-img bug with dynamic vhd

Status in QEMU:
  Incomplete

Bug description:
  Hye, i found a problem with qemu-img when trying to get info of a
  dynamic vhd. I made imgae of my 60GB computer hard drive with
  disk2vhd. The dynamic vhd is 21gb size.

  With 1.0-rc3 version :
  running command: qemu-img info 60_GB.VHD
  qemu-img: Could not open '60_GB.VHD' : File too large

  0.14.1 version give me wrong information :
  image: 60_GB.VHD
  file format: vpc
  virtual size: 127G (136899993600 bytes)
  disk size: 21G

  Thanks for reply.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/893956/+subscriptions

Thomas Huth (th-huth)
Changed in qemu:
status: Incomplete → Won't Fix
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.