Revision 3b46e624 block-vmdk.c
b/block-vmdk.c | ||
---|---|---|
110 | 110 |
|
111 | 111 |
#define CHECK_CID 1 |
112 | 112 |
|
113 |
#define SECTOR_SIZE 512
|
|
113 |
#define SECTOR_SIZE 512 |
|
114 | 114 |
#define DESC_SIZE 20*SECTOR_SIZE // 20 sectors of 512 bytes each |
115 | 115 |
#define HEADER_SIZE 512 // first sector of 512 bytes |
116 | 116 |
|
... | ... | |
308 | 308 |
|
309 | 309 |
fail_gd: |
310 | 310 |
qemu_free(gd_buf); |
311 |
fail_rgd:
|
|
311 |
fail_rgd: |
|
312 | 312 |
qemu_free(rgd_buf); |
313 | 313 |
fail: |
314 | 314 |
close(p_fd); |
... | ... | |
341 | 341 |
p_name += sizeof("parentFileNameHint") + 1; |
342 | 342 |
if ((end_name = strchr(p_name,'\"')) == 0) |
343 | 343 |
return -1; |
344 |
|
|
344 |
|
|
345 | 345 |
strncpy(s->hd->backing_file, p_name, end_name - p_name); |
346 | 346 |
if (stat(s->hd->backing_file, &file_buf) != 0) { |
347 | 347 |
path_combine(parent_img_name, sizeof(parent_img_name), |
... | ... | |
761 | 761 |
header.check_bytes[1] = 0x20; |
762 | 762 |
header.check_bytes[2] = 0xd; |
763 | 763 |
header.check_bytes[3] = 0xa; |
764 |
|
|
765 |
/* write all the data */
|
|
764 |
|
|
765 |
/* write all the data */ |
|
766 | 766 |
write(fd, &magic, sizeof(magic)); |
767 | 767 |
write(fd, &header, sizeof(header)); |
768 | 768 |
|
... | ... | |
773 | 773 |
for (i = 0, tmp = header.rgd_offset + gd_size; |
774 | 774 |
i < gt_count; i++, tmp += gt_size) |
775 | 775 |
write(fd, &tmp, sizeof(tmp)); |
776 |
|
|
776 |
|
|
777 | 777 |
/* write backup grain directory */ |
778 | 778 |
lseek(fd, le64_to_cpu(header.gd_offset) << 9, SEEK_SET); |
779 | 779 |
for (i = 0, tmp = header.gd_offset + gd_size; |
Also available in: Unified diff