mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-09-05 05:01:33 +00:00
kvm,virtio: move SECTOR_SHIFT and SECTOR_SIZE to disk-image.h
Suggested-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Asias He <asias.hejun@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
+1
-1
@@ -270,7 +270,7 @@ void blk_virtio__init(struct kvm *self)
|
||||
if (!self->disk_image)
|
||||
return;
|
||||
|
||||
device.blk_config.capacity = self->disk_image->size / 512;
|
||||
device.blk_config.capacity = self->disk_image->size / SECTOR_SIZE;
|
||||
|
||||
pci__register(&blk_virtio_pci_device, 1);
|
||||
|
||||
|
||||
@@ -12,9 +12,6 @@
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#define SECTOR_SHIFT 9
|
||||
#define SECTOR_SIZE (1UL << SECTOR_SHIFT)
|
||||
|
||||
static const char QCOW_MAGIC[] = { 'Q', 'F', 'I', 0xfb };
|
||||
|
||||
struct qcow_header {
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define SECTOR_SHIFT 9
|
||||
#define SECTOR_SIZE (1UL << SECTOR_SHIFT)
|
||||
|
||||
struct disk_image {
|
||||
void *mmap;
|
||||
int fd;
|
||||
|
||||
Reference in New Issue
Block a user