From: Liu Yu <yu.liu@freescale.com>
To: kvm@vger.kernel.org
Cc: aliguori@us.ibm.com, Liu Yu <yu.liu@freescale.com>,
hollisb@us.ibm.com, rusty@rustcorp.com.au, qemu-devel@nongnu.org,
kvm-ppc@vger.kernel.org
Subject: [Qemu-devel] [PATCH] virtio-blk: change config to guest endian
Date: Tue, 9 Sep 2008 11:48:22 +0800 [thread overview]
Message-ID: <1220932102-11863-1-git-send-email-yu.liu@freescale.com> (raw)
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
next reply other threads:[~2008-09-09 4:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-09 3:48 Liu Yu [this message]
2008-09-10 15:24 ` [Qemu-devel] Re: [PATCH] virtio-blk: change config to guest endian Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1220932102-11863-1-git-send-email-yu.liu@freescale.com \
--to=yu.liu@freescale.com \
--cc=aliguori@us.ibm.com \
--cc=hollisb@us.ibm.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).