From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: peter.maydell@linaro.org
Cc: Wei Liu <wei.liu2@citrix.com>,
qemu-devel@nongnu.org,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 21/25] 9pfs: move handle_9p_output and make it static function
Date: Tue, 12 Jan 2016 11:38:28 +0530 [thread overview]
Message-ID: <1452578912-12546-22-git-send-email-aneesh.kumar@linux.vnet.ibm.com> (raw)
In-Reply-To: <1452578912-12546-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
From: Wei Liu <wei.liu2@citrix.com>
It's only used in virtio device.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
hw/9pfs/virtio-9p-device.c | 34 ++++++++++++++++++++++++++++++++++
hw/9pfs/virtio-9p.c | 33 ---------------------------------
hw/9pfs/virtio-9p.h | 1 -
3 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index cfad13afe7e9..bc103b7fa757 100644
--- a/hw/9pfs/virtio-9p-device.c
+++ b/hw/9pfs/virtio-9p-device.c
@@ -19,6 +19,7 @@
#include "9p-xattr.h"
#include "coth.h"
#include "hw/virtio/virtio-access.h"
+#include "qemu/iov.h"
void virtio_9p_push_and_notify(V9fsPDU *pdu)
{
@@ -31,6 +32,39 @@ void virtio_9p_push_and_notify(V9fsPDU *pdu)
virtio_notify(VIRTIO_DEVICE(s), s->vq);
}
+static void handle_9p_output(VirtIODevice *vdev, VirtQueue *vq)
+{
+ V9fsState *s = (V9fsState *)vdev;
+ V9fsPDU *pdu;
+ ssize_t len;
+
+ while ((pdu = pdu_alloc(s)) &&
+ (len = virtqueue_pop(vq, &pdu->elem)) != 0) {
+ struct {
+ uint32_t size_le;
+ uint8_t id;
+ uint16_t tag_le;
+ } QEMU_PACKED out;
+ int len;
+
+ BUG_ON(pdu->elem.out_num == 0 || pdu->elem.in_num == 0);
+ QEMU_BUILD_BUG_ON(sizeof out != 7);
+
+ len = iov_to_buf(pdu->elem.out_sg, pdu->elem.out_num, 0,
+ &out, sizeof out);
+ BUG_ON(len != sizeof out);
+
+ pdu->size = le32_to_cpu(out.size_le);
+
+ pdu->id = out.id;
+ pdu->tag = le16_to_cpu(out.tag_le);
+
+ qemu_co_queue_init(&pdu->complete);
+ pdu_submit(pdu);
+ }
+ pdu_free(pdu);
+}
+
static uint64_t virtio_9p_get_features(VirtIODevice *vdev, uint64_t features,
Error **errp)
{
diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index 3d5140d1e3b6..7fb05240987e 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -3266,39 +3266,6 @@ void pdu_submit(V9fsPDU *pdu)
qemu_coroutine_enter(co, pdu);
}
-void handle_9p_output(VirtIODevice *vdev, VirtQueue *vq)
-{
- V9fsState *s = (V9fsState *)vdev;
- V9fsPDU *pdu;
- ssize_t len;
-
- while ((pdu = pdu_alloc(s)) &&
- (len = virtqueue_pop(vq, &pdu->elem)) != 0) {
- struct {
- uint32_t size_le;
- uint8_t id;
- uint16_t tag_le;
- } QEMU_PACKED out;
- int len;
-
- BUG_ON(pdu->elem.out_num == 0 || pdu->elem.in_num == 0);
- QEMU_BUILD_BUG_ON(sizeof out != 7);
-
- len = iov_to_buf(pdu->elem.out_sg, pdu->elem.out_num, 0,
- &out, sizeof out);
- BUG_ON(len != sizeof out);
-
- pdu->size = le32_to_cpu(out.size_le);
-
- pdu->id = out.id;
- pdu->tag = le16_to_cpu(out.tag_le);
-
- qemu_co_queue_init(&pdu->complete);
- pdu_submit(pdu);
- }
- pdu_free(pdu);
-}
-
static void __attribute__((__constructor__)) virtio_9p_set_fd_limit(void)
{
struct rlimit rlim;
diff --git a/hw/9pfs/virtio-9p.h b/hw/9pfs/virtio-9p.h
index a1ac3980ee73..474ab94c0859 100644
--- a/hw/9pfs/virtio-9p.h
+++ b/hw/9pfs/virtio-9p.h
@@ -5,7 +5,6 @@
#include "hw/virtio/virtio.h"
#include "9p.h"
-extern void handle_9p_output(VirtIODevice *vdev, VirtQueue *vq);
extern void virtio_9p_push_and_notify(V9fsPDU *pdu);
ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset,
--
2.5.0
next prev parent reply other threads:[~2016-01-12 6:09 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-12 6:08 [Qemu-devel] [PULL 00/25] VirtFS update Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 01/25] 9pfs: rename virtio-9p-coth.{c, h} to coth.{c, h} Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 02/25] 9pfs: rename virtio-9p-handle.c to 9p-handle.c Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 03/25] 9pfs: rename virtio-9p-local.c to 9p-local.c Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 04/25] 9pfs: rename virtio-9p-posix-acl.c to 9p-posix-acl.c Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 05/25] 9pfs: rename virtio-9p-proxy.{c, h} to 9p-proxy.{c, h} Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 06/25] 9pfs: rename virtio-9p-synth.{c, h} to 9p-synth.{c, h} Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 07/25] 9pfs: rename virtio-9p-xattr{, -user}.{c, h} to 9p-xattr{, -user}.{c, h} Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 08/25] 9pfs: merge hw/virtio/virtio-9p.h into hw/9pfs/virtio-9p.h Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 09/25] 9pfs: remove dead code Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 10/25] fsdev: break out 9p-marshal.{c, h} from virtio-9p-marshal.{c, h} Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 11/25] fsdev: rename virtio-9p-marshal.{c, h} to 9p-iov-marshal.{c, h} Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 12/25] 9pfs: PDU processing functions don't need to take V9fsState as argument Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 13/25] 9pfs: PDU processing functions should start pdu_ prefix Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 14/25] 9pfs: make pdu_{, un}marshal proper functions Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 15/25] 9pfs: factor out virtio_pdu_{, un}marshal Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 16/25] 9pfs: factor out pdu_push_and_notify Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 17/25] 9pfs: break out virtio_init_iov_from_pdu Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 18/25] 9pfs: break out 9p.h from virtio-9p.h Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 19/25] 9pfs: factor out virtio_9p_push_and_notify Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 20/25] 9pfs: export pdu_{submit,alloc,free} Aneesh Kumar K.V
2016-01-12 6:08 ` Aneesh Kumar K.V [this message]
2016-01-12 6:08 ` [Qemu-devel] [PATCH 22/25] 9pfs: rename virtio_9p_set_fd_limit to use v9fs_ prefix Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 23/25] 9pfs: rename virtio-9p.c to 9p.c Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 24/25] 9pfs: factor out v9fs_device_{, un}realize_common Aneesh Kumar K.V
2016-01-12 6:08 ` [Qemu-devel] [PATCH 25/25] 9pfs: introduce V9fsVirtioState Aneesh Kumar K.V
2016-01-12 18:10 ` [Qemu-devel] [PULL 00/25] VirtFS update Peter Maydell
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=1452578912-12546-22-git-send-email-aneesh.kumar@linux.vnet.ibm.com \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=wei.liu2@citrix.com \
/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).