[Top][All Lists]

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

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

From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH v6 5/8] virtio-blk: use virtio wrappers to access headers
Date: Mon, 31 Mar 2014 18:31:33 +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>

Note that st*_raw and ld*_raw are effectively replaced by st*_p and ld*_p.

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/block/virtio-blk.c |   40 +++++++++++++++++++++++-----------------
  1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 8a568e5..c652ff2 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -26,6 +26,7 @@
  # include <scsi/sg.h>
  #include "hw/virtio/virtio-bus.h"
+#include "hw/virtio/virtio-access.h"
typedef struct VirtIOBlockReq
@@ -77,7 +78,9 @@ static void virtio_blk_rw_complete(void *opaque, int ret)
      trace_virtio_blk_rw_complete(req, ret);
if (ret) {
-        bool is_read = !(ldl_p(&req->out->type) & VIRTIO_BLK_T_OUT);
+        bool is_read =
+            !(virtio_ldl_p(&req->out->type,
+                           VIRTIO_DEVICE(req->dev)) & VIRTIO_BLK_T_OUT);

Any way you could fit this into the line limit by extracting part of it into a separate variable?


reply via email to

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