1 #ifndef KVM__DISK_IMAGE_H 2 #define KVM__DISK_IMAGE_H 3 4 #include <stdint.h> 5 6 struct disk_image { 7 void *mmap; 8 int fd; 9 uint64_t size; 10 }; 11 12 struct disk_image *disk_image__open(const char *filename); 13 void disk_image__close(struct disk_image *self); 14 int disk_image__read_sector(struct disk_image *self, uint64_t sector, void *dst, uint32_t dst_len); 15 16 #endif /* KVM__DISK_IMAGE_H */ 17