qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v6 3/8] virtio-net: use virtio wrappers to acces


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH v6 3/8] virtio-net: use virtio wrappers to access headers
Date: Mon, 31 Mar 2014 18:28:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130910 Thunderbird/17.0.9

On 03/28/2014 11:57 AM, Greg Kurz wrote:
From: Rusty Russell <address@hidden>

Signed-off-by: Rusty Russell <address@hidden>
Reviewed-by: Anthony Liguori <address@hidden>
[ use per-device needs_byteswap flag,
   Greg Kurz <address@hidden> ]
Signed-off-by: Greg Kurz <address@hidden>
---
  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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]