[PATCH] virtio-blk: change config to guest endian

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since virtio-blk in kernel has already changed, qemu needs to be updated.
see http://thread.gmane.org/gmane.linux.kernel.virtualization/5776/focus=580

Only tested it on branch kvm-70rc1 for e500/powerpc platform.

Signed-off-by: Liu Yu <yu.liu@xxxxxxxxxxxxx>
Acked-by: Anthony Liguori <aliguori@xxxxxxxxxx>
---
 qemu/hw/virtio-blk.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/qemu/hw/virtio-blk.c b/qemu/hw/virtio-blk.c
index 148cb75..3076223 100644
--- a/qemu/hw/virtio-blk.c
+++ b/qemu/hw/virtio-blk.c
@@ -149,9 +149,9 @@ static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config)
 
     bdrv_get_geometry(s->bs, &capacity);
     bdrv_get_geometry_hint(s->bs, &cylinders, &heads, &secs);
-    blkcfg.capacity = cpu_to_le64(capacity);
-    blkcfg.seg_max = cpu_to_le32(128 - 2);
-    blkcfg.cylinders = cpu_to_le16(cylinders);
+    stq_raw(&blkcfg.capacity, capacity);
+    stl_raw(&blkcfg.seg_max, 128 - 2);
+    stw_raw(&blkcfg.cylinders, cylinders);
     blkcfg.heads = heads;
     blkcfg.sectors = secs;
     memcpy(config, &blkcfg, sizeof(blkcfg));
-- 
1.5.4

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux