Re: [kvm-devel] [PATCH] Fix endianness for virtio-blk config space
Anthony Liguori wrote: > The virtio config space is little endian. Make sure that in virtio-blk we > store the values in little endian format. > Applied, thanks. -- error compiling committee.c: too many arguments to function - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [PATCH] Fix endianness for virtio-blk config space
On Tue, 2008-04-01 at 11:04 -0500, Anthony Liguori wrote: > The virtio config space is little endian. Make sure that in virtio-blk we > store the values in little endian format. > > Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> > > diff --git a/qemu/hw/virtio-blk.c b/qemu/hw/virtio-blk.c > index 0f55d2a..492bd7f 100644 > --- a/qemu/hw/virtio-blk.c > +++ b/qemu/hw/virtio-blk.c > @@ -134,8 +134,8 @@ static void virtio_blk_update_config(VirtIODevice *vdev, > uint8_t *config) > int64_t capacity; > > bdrv_get_geometry(s->bs, &capacity); > -blkcfg.capacity = capacity; > -blkcfg.seg_max = 128 - 2; > +blkcfg.capacity = cpu_to_le64(capacity); > +blkcfg.seg_max = cpu_to_le32(128 - 2); > memcpy(config, &blkcfg, sizeof(blkcfg)); > } Fixes virtio-blk for PowerPC KVM. Acked-by: Hollis Blanchard <[EMAIL PROTECTED]> -- Hollis Blanchard IBM Linux Technology Center - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
[kvm-devel] [PATCH] Fix endianness for virtio-blk config space
The virtio config space is little endian. Make sure that in virtio-blk we store the values in little endian format. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/virtio-blk.c b/qemu/hw/virtio-blk.c index 0f55d2a..492bd7f 100644 --- a/qemu/hw/virtio-blk.c +++ b/qemu/hw/virtio-blk.c @@ -134,8 +134,8 @@ static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config) int64_t capacity; bdrv_get_geometry(s->bs, &capacity); -blkcfg.capacity = capacity; -blkcfg.seg_max = 128 - 2; +blkcfg.capacity = cpu_to_le64(capacity); +blkcfg.seg_max = cpu_to_le32(128 - 2); memcpy(config, &blkcfg, sizeof(blkcfg)); } - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel