* [Qemu-devel] [PATCH] virtio-blk: change config to guest endian
@ 2008-09-09 3:48 Liu Yu
2008-09-10 15:24 ` [Qemu-devel] " Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Liu Yu @ 2008-09-09 3:48 UTC (permalink / raw)
To: kvm; +Cc: aliguori, Liu Yu, hollisb, rusty, qemu-devel, kvm-ppc
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@freescale.com>
Acked-by: Anthony Liguori <aliguori@us.ibm.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-10 15:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-09 3:48 [Qemu-devel] [PATCH] virtio-blk: change config to guest endian Liu Yu
2008-09-10 15:24 ` [Qemu-devel] " Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).