qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Filip Navara" <xnavara@volny.cz>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] VMDK 2Gb bug
Date: Sat, 8 Sep 2007 21:23:28 +0200	[thread overview]
Message-ID: <5b31733c0709081223m1a00fc8bx4800ed2ffb75d838@mail.gmail.com> (raw)


[-- 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;

                 reply	other threads:[~2007-09-08 19:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5b31733c0709081223m1a00fc8bx4800ed2ffb75d838@mail.gmail.com \
    --to=xnavara@volny.cz \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).