From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUf4X-0001mE-5N for qemu-devel@nongnu.org; Mon, 31 Mar 2014 12:28:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUf4Q-00048u-Ut for qemu-devel@nongnu.org; Mon, 31 Mar 2014 12:28:29 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44370 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUf4Q-00048k-Nj for qemu-devel@nongnu.org; Mon, 31 Mar 2014 12:28:22 -0400 Message-ID: <533997A5.7030500@suse.de> Date: Mon, 31 Mar 2014 18:28:21 +0200 From: Alexander Graf MIME-Version: 1.0 References: <20140328105709.21018.88000.stgit@bahia.local> <20140328105733.21018.17791.stgit@bahia.local> In-Reply-To: <20140328105733.21018.17791.stgit@bahia.local> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 3/8] virtio-net: use virtio wrappers to access headers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: kwolf@redhat.com, peter.maydell@linaro.org, thuth@linux.vnet.ibm.com, mst@redhat.com, marc.zyngier@arm.com, rusty@rustcorp.com.au, qemu-devel@nongnu.org, stefanha@redhat.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, anthony@codemonkey.ws, afaerber@suse.de On 03/28/2014 11:57 AM, Greg Kurz wrote: > From: Rusty Russell > > Signed-off-by: Rusty Russell > Reviewed-by: Anthony Liguori > [ use per-device needs_byteswap flag, > Greg Kurz ] > Signed-off-by: Greg Kurz > --- > 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