]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
virtio: capacity should be in 512-byte sectors
authorAsias He <asias.hejun@gmail.com>
Sat, 8 Jan 2011 02:28:26 +0000 (10:28 +0800)
committerPekka Enberg <penberg@kernel.org>
Sat, 8 Jan 2011 08:24:30 +0000 (10:24 +0200)
struct virtio_blk_config {
        /* The capacity (in 512-byte sectors). */
        uint64_t capacity;
...
}

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/blk-virtio.c

index 3b4f6412ffc46872157063bf0e3ce5a693177557..7887dbe323e010a160a656ded60d55321a39bb29 100644 (file)
@@ -234,7 +234,7 @@ void blk_virtio__init(struct kvm *self)
        if (!self->disk_image)
                return;
 
-       device.blk_config.capacity = self->disk_image->size;
+       device.blk_config.capacity = self->disk_image->size / 512;
 
        pci__register(&blk_virtio_pci_device, 1);