qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] VMDK 2Gb bug
@ 2007-09-08 19:23 Filip Navara
  0 siblings, 0 replies; only message in thread
From: Filip Navara @ 2007-09-08 19:23 UTC (permalink / raw)
  To: qemu-devel


[-- Attachment #1.1: Type: text/plain, Size: 143 bytes --]

There is a bug in the block-vmdk.c that prevents writing to images larger
than 2Gb on Windows host operating systems. Attached patch fixes it.

[-- Attachment #1.2: Type: text/html, Size: 147 bytes --]

[-- Attachment #2: qemu-block-vmdk.patch --]
[-- Type: application/octet-stream, Size: 1329 bytes --]

Index: block-vmdk.c
===================================================================
RCS file: /sources/qemu/qemu/block-vmdk.c,v
retrieving revision 1.12
diff -u -r1.12 block-vmdk.c
--- block-vmdk.c	11 Jul 2007 10:25:58 -0000	1.12
+++ block-vmdk.c	8 Sep 2007 15:59:24 -0000
@@ -520,7 +520,6 @@
     int min_index, i, j;
     uint32_t min_count, *l2_table, tmp = 0;
     uint64_t cluster_offset;
-    int status;
 
     if (m_data)
         m_data->valid = 0;
@@ -564,19 +563,11 @@
     cluster_offset = le32_to_cpu(l2_table[l2_index]);
 
     if (!cluster_offset) {
-        struct stat file_buf;
-
         if (!allocate)
             return 0;
         // Avoid the L2 tables update for the images that have snapshots.
         if (!s->is_parent) {
-            status = stat(s->hd->filename, &file_buf);
-            if (status == -1) {
-                fprintf(stderr, "(VMDK) Fail file stat: filename =%s size=0x%llx errno=%s\n",
-                                s->hd->filename, (uint64_t)file_buf.st_size, strerror(errno));
-                return 0;
-            }
-            cluster_offset = file_buf.st_size;
+            cluster_offset = bdrv_getlength(s->hd);
             bdrv_truncate(s->hd, cluster_offset + (s->cluster_sectors << 9));
 
             cluster_offset >>= 9;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-09-08 19:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-08 19:23 [Qemu-devel] [PATCH] VMDK 2Gb bug Filip Navara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).