Received: from eggs.gnu.org ([208.118.235.92]:45988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVs12-0002gu-IP for qemu-devel@nongnu.org; Tue, 06 Nov 2012 17:53:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TVs11-0000Xt-11 for qemu-devel@nongnu.org; Tue, 06 Nov 2012 17:53:04 -0500 Received: from indium.canonical.com ([91.189.90.7]:50643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVs10-0000Xn-Qx for qemu-devel@nongnu.org; Tue, 06 Nov 2012 17:53:02 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1TVs0y-0003v9-UR for ; Tue, 06 Nov 2012 22:53:01 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 1F46F2E80D9 for ; Tue, 6 Nov 2012 22:45:33 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Tue, 06 Nov 2012 22:38:45 -0000 From: Robert Hubbard Sender: bounces@canonical.com References: <20121105173251.17934.47567.malonedeb@soybean.canonical.com> Message-Id: <20121106223845.30587.74018.malone@gac.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1075252] Re: qemu-img cannot read VMDK4 file Reply-To: Bug 1075252 <1075252@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Duplicate - Same issue related to header/footer - When does the code fix show up in the git release train ? bug 907063 . Read the VMDK 5.X release doc on format for VMDK. The files im using are cr= eated from Vsphere 5.X and are using a VMDK verion of 3. Virtual Disk Format 5.0 - VMware www.vmware.com/support/.../vmdk_50_technote.pdf?src=3Dvm... File Format: PDF/Adobe Acrobat - Quick View Dec 20, 2011 =E2=80=93 The document describes the virtual machine disk (VMD= K) format and ... VMware designed the VMDK (virtual machine disk) format to= mimic the ... Fields look consistent with description in the VMDK 5.X doc and used that s= truct as referene(hacked patch attached for reference ) First pass at Header: gdb) p/x header $1 =3D {version =3D 0x3, flags =3D 0x30001, capacity =3D 0x400000, granular= ity =3D 0x80, desc_offset =3D 0x1, = desc_size =3D 0x1, num_gtes_per_gte =3D 0x200, rgd_offset =3D 0x0, gd_off= set =3D 0xffffffffffffffff, = grain_offset =3D 0x80, uncleanshutdown =3D 0x0, singlendlinechar =3D 0xa,= nonendlinechar =3D 0x20, = doublendlinechar1 =3D 0xd, doublendlinechar2 =3D 0xa, compressAlgorithm = =3D 0x1, pad =3D { 0x0 }} Now the footer: (gdb) p/x header $2 =3D {version =3D 0x3, flags =3D 0x30001, capacity =3D 0x400000, granular= ity =3D 0x80, desc_offset =3D 0x1, = desc_size =3D 0x1, num_gtes_per_gte =3D 0x200, rgd_offset =3D 0x0, gd_off= set =3D 0x68304, = grain_offset =3D 0x80, uncleanshutdown =3D 0x0, singlendlinechar =3D 0xa,= nonendlinechar =3D 0x20, = doublendlinechar1 =3D 0xd, doublendlinechar2 =3D 0xa, compressAlgorithm = =3D 0x1, pad =3D { 0x0 }} ** Attachment added: "vmdk4-qemu-img" https://bugs.launchpad.net/qemu/+bug/1075252/+attachment/3426186/+files/= vmdk4-qemu-img -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1075252 Title: qemu-img cannot read VMDK4 file Status in QEMU: New Bug description: Unable to read any vmdk4 type files. Goal was to convert to a qcow2, this worked after emitting code. OS is Centos linux 2.6.32. I pulled the latest git tree down for qemu to see if this was resolved, it is not. Starting program: /home/rhubbard/QEMU/qemu/qemu-img info -f vmdk /root/Juniper/beta1candidate-07122012-disk1.vmdk = There seems a mismatch with the l1_backup_tble_offset. this is now a uin= t64 type. The value is actually "-512" because of this and this causes the= code check at line 418 in vmdk.c to erroneously think there is a backup t= able. This causes vmdk open to fail. and message = qemu failed to open .... = from debug; gdb) x/4x &(s->l1_backup_table_offset) 0xa61cd0: 0xfffffe00 0xffffffff 0x00a62770 0x00000000 (gdb) p *s $1 =3D {hd =3D 0x0, l1_table_offset =3D 0, l1_backup_table_offset =3D -51= 2, l1_table =3D 0xa62770, = l1_backup_table =3D 0x0, l1_size =3D 64, l1_entry_sectors =3D 65536, l2= _size =3D 512, l2_cache =3D 0x0, = l2_cache_offsets =3D {0 }, l2_cache_counts =3D {0 }, = cluster_sectors =3D 128, parent_cid =3D 4294967295} typedef struct BDRVVmdkState { BlockDriverState *hd; int64_t l1_table_offset; <= =3D=3D=3D=3D ??? - what should this be , don't know what the actual layout = on the vmdk spec says , is this a 64bit / 8 byte field ? int64_t l1_backup_table_offset; uint32_t *l1_table; uint32_t *l1_backup_table; unsigned int l1_size; uint32_t l1_entry_sectors; unsigned int l2_size; from vmdk.c /*!!! if (s->l1_backup_table_offset) { s->l1_backup_table =3D qemu_malloc(l1_size); if (bdrv_pread(bs->file, s->l1_backup_table_offset, s->l1_backup_= table, l1_size) !=3D l1_size) goto fail; Breaks here.. Don't know the correct fix , thanks for help. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1075252/+subscriptions