mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-15 04:09:44 +00:00
vmdk 3 fixes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1052 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
4e8b5da233
commit
7143c62c95
@ -101,8 +101,7 @@ static int vmdk_open(BlockDriverState *bs, const char *filename)
|
|||||||
return -1;
|
return -1;
|
||||||
if (read(fd, &magic, sizeof(magic)) != sizeof(magic))
|
if (read(fd, &magic, sizeof(magic)) != sizeof(magic))
|
||||||
goto fail;
|
goto fail;
|
||||||
magic = le32_to_cpu(magic);
|
magic = be32_to_cpu(magic);
|
||||||
|
|
||||||
if (magic == VMDK3_MAGIC) {
|
if (magic == VMDK3_MAGIC) {
|
||||||
VMDK3Header header;
|
VMDK3Header header;
|
||||||
if (read(fd, &header, sizeof(header)) !=
|
if (read(fd, &header, sizeof(header)) !=
|
||||||
@ -136,7 +135,9 @@ static int vmdk_open(BlockDriverState *bs, const char *filename)
|
|||||||
s->l1_table = qemu_malloc(l1_size);
|
s->l1_table = qemu_malloc(l1_size);
|
||||||
if (!s->l1_table)
|
if (!s->l1_table)
|
||||||
goto fail;
|
goto fail;
|
||||||
if (read(s->fd, s->l1_table, l1_size) != l1_size)
|
if (lseek(fd, s->l1_table_offset, SEEK_SET) == -1)
|
||||||
|
goto fail;
|
||||||
|
if (read(fd, s->l1_table, l1_size) != l1_size)
|
||||||
goto fail;
|
goto fail;
|
||||||
for(i = 0; i < s->l1_size; i++) {
|
for(i = 0; i < s->l1_size; i++) {
|
||||||
le32_to_cpus(&s->l1_table[i]);
|
le32_to_cpus(&s->l1_table[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user