From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: David Gibson <david@gibson.dropbear.id.au>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH 1/2] dataplane: move vring_more_avail() into vring.c
Date: Mon, 19 Jan 2015 17:04:36 +0000 [thread overview]
Message-ID: <1421687077-9025-2-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1421687077-9025-1-git-send-email-stefanha@redhat.com>
vring_more_avail() was an inline function in vring.h. No external
callers use it so it's not necessary to export it.
Furthermore, we'll need virtio-access.h for endian-aware memory accesses
but that only works in per-target object files (obj-y) and not
build-once object files (common-obj-y) like the virtio-blk and
virtio-scsi devices.
Move vring_more_avail() into vring.c so that virtio devices like
virtio-blk and virtio-scsi can continue to use vring.h without being
built once per target.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
hw/virtio/dataplane/vring.c | 6 ++++++
include/hw/virtio/dataplane/vring.h | 6 ------
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/virtio/dataplane/vring.c b/hw/virtio/dataplane/vring.c
index 61f6d83..cb31d7f 100644
--- a/hw/virtio/dataplane/vring.c
+++ b/hw/virtio/dataplane/vring.c
@@ -21,6 +21,12 @@
#include "hw/virtio/dataplane/vring.h"
#include "qemu/error-report.h"
+/* Are there more descriptors available? */
+static inline bool vring_more_avail(Vring *vring)
+{
+ return vring->vr.avail->idx != vring->last_avail_idx;
+}
+
/* vring_map can be coupled with vring_unmap or (if you still have the
* value returned in *mr) memory_region_unref.
*/
diff --git a/include/hw/virtio/dataplane/vring.h b/include/hw/virtio/dataplane/vring.h
index d3e086a..1e871e6 100644
--- a/include/hw/virtio/dataplane/vring.h
+++ b/include/hw/virtio/dataplane/vring.h
@@ -36,12 +36,6 @@ static inline unsigned int vring_get_num(Vring *vring)
return vring->vr.num;
}
-/* Are there more descriptors available? */
-static inline bool vring_more_avail(Vring *vring)
-{
- return vring->vr.avail->idx != vring->last_avail_idx;
-}
-
/* Fail future vring_pop() and vring_push() calls until reset */
static inline void vring_set_broken(Vring *vring)
{
--
2.1.0
next prev parent reply other threads:[~2015-01-19 17:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-19 17:04 [Qemu-devel] [PATCH 0/2] dataplane: use endian-aware memory accessors Stefan Hajnoczi
2015-01-19 17:04 ` Stefan Hajnoczi [this message]
2015-01-20 23:56 ` [Qemu-devel] [PATCH 1/2] dataplane: move vring_more_avail() into vring.c David Gibson
2015-01-21 13:25 ` Greg Kurz
2015-01-19 17:04 ` [Qemu-devel] [PATCH 2/2] dataplane: use virtio_ld/st_p() for endian-aware memory access Stefan Hajnoczi
2015-01-21 0:17 ` David Gibson
2015-01-19 17:33 ` [Qemu-devel] [PATCH 0/2] dataplane: use endian-aware memory accessors Cornelia Huck
2015-01-21 13:30 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1421687077-9025-2-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).