On 03/28/2014 11:57 AM, Greg Kurz wrote:
From: Rusty Russell <ru...@rustcorp.com.au>
Signed-off-by: Rusty Russell <ru...@rustcorp.com.au>
Reviewed-by: Anthony Liguori <aligu...@us.ibm.com>
[ use per-device needs_byteswap flag,
Greg Kurz <gk...@linux.vnet.ibm.com> ]
Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com>
---
hw/net/virtio-net.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 439477b..eb89f48 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -23,6 +23,7 @@
#include "hw/virtio/virtio-bus.h"
#include "qapi/qmp/qjson.h"
#include "monitor/monitor.h"
+#include "hw/virtio/virtio-access.h"
#define VIRTIO_NET_VM_VERSION 11
@@ -72,8 +73,8 @@ static void virtio_net_get_config(VirtIODevice *vdev, uint8_t *config)
VirtIONet *n = VIRTIO_NET(vdev);
struct virtio_net_config netcfg;
- stw_p(&netcfg.status, n->status);
- stw_p(&netcfg.max_virtqueue_pairs, n->max_queues);
+ virtio_stw_p(&netcfg.status, n->status, vdev);
+ virtio_stw_p(&netcfg.max_virtqueue_pairs, n->max_queues, vdev);
If you make virtio_stw_p() only depend on endian specific operations
this file could be built as part of obj rather than common-obj again,
right? So it doesn't depend on the target to operate. So as part of this
change you should also have a Makefile.obj change.
The same obviously applies to all the other files as well :)
Alex