The new function resides in virtio specific file.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
v2: new, part of original "9pfs: break out generic code from
virtio-9p.{c,h}"
#include "coth.h"
#include "hw/virtio/virtio-access.h"
+void virtio_9p_push_and_notify(V9fsPDU *pdu)
+{
+ V9fsState *s = pdu->s;
+
+ /* push onto queue and notify */
+ virtqueue_push(s->vq, &pdu->elem, pdu->size);
+
+ /* FIXME: we should batch these completions */
+ virtio_notify(VIRTIO_DEVICE(s), s->vq);
+}
+
static uint64_t virtio_9p_get_features(VirtIODevice *vdev, uint64_t features,
Error **errp)
{
static void pdu_push_and_notify(V9fsPDU *pdu)
{
- V9fsState *s = pdu->s;
-
- /* push onto queue and notify */
- virtqueue_push(s->vq, &pdu->elem, pdu->size);
-
- /* FIXME: we should batch these completions */
- virtio_notify(VIRTIO_DEVICE(s), s->vq);
+ virtio_9p_push_and_notify(pdu);
}
static int omode_to_uflags(int8_t mode)
#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,
const char *fmt, va_list ap);
ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset,