Home | History | Annotate | Download | only in block

Lines Matching refs:footer

70     // Checksum of the Hard Disk Footer ("one's complement of the sum of all
71 // the bytes in the footer without the checksum field")
157 struct vhd_footer* footer;
169 footer = (struct vhd_footer*) s->footer_buf;
170 if (strncmp(footer->creator, "conectix", 8))
173 checksum = be32_to_cpu(footer->checksum);
174 footer->checksum = 0;
180 // rather than on the size stored in the footer (the size in the footer
183 be16_to_cpu(footer->cyls) * footer->heads * footer->secs_per_cyl;
185 if (bdrv_pread(s->hd, be64_to_cpu(footer->data_offset), buf, HEADER_SIZE)
308 * Writes the footer to the end of the image file. This is needed when the
309 * file grows as it overwrites the old footer
327 * Allocates a new block. This involves writing a new footer and updating
329 * file (overwriting the old footer)
356 // Write new footer (the old one will be overwritten)
483 struct vhd_footer* footer = (struct vhd_footer*) buf;
511 // Prepare the Hard Disk Footer
514 strncpy(footer->creator, "conectix", 8);
516 strncpy(footer->creator_app, "qemu", 4);
517 strncpy(footer->creator_os, "Wi2k", 4);
519 footer->features = be32_to_cpu(0x02);
520 footer->version = be32_to_cpu(0x00010000);
521 footer->data_offset = be64_to_cpu(HEADER_SIZE);
522 footer->timestamp = be32_to_cpu(time(NULL) - VHD_TIMESTAMP_BASE);
525 footer->major = be16_to_cpu(0x0005);
526 footer->minor =be16_to_cpu(0x0003);
528 footer->orig_size = be64_to_cpu(total_sectors * 512);
529 footer->size = be64_to_cpu(total_sectors * 512);
531 footer->cyls = be16_to_cpu(cyls);
532 footer->heads = heads;
533 footer->secs_per_cyl = secs_per_cyl;
535 footer->type = be32_to_cpu(VHD_DYNAMIC);
539 footer->checksum = be32_to_cpu(vpc_checksum(buf, HEADER_SIZE));
541 // Write the footer (twice: at the beginning and at the end)