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:
Asias He
2015-06-01 16:39:41 +01:00
committed by Will Deacon
parent 900d32c15c
commit 2924f993ed
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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);
-3
View File
@@ -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
View File
@@ -3,6 +3,9 @@
#include <stdint.h>
#define SECTOR_SHIFT 9
#define SECTOR_SIZE (1UL << SECTOR_SHIFT)
struct disk_image {
void *mmap;
int fd;