mirror of
https://github.com/xemu-project/xemu.git
synced 2025-02-07 20:57:50 +00:00
9pfs: factor out virtio_9p_push_and_notify
The new function resides in virtio specific file. Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
This commit is contained in:
parent
ebe74f8ba2
commit
0d3716b4e6
@ -20,6 +20,17 @@
|
|||||||
#include "coth.h"
|
#include "coth.h"
|
||||||
#include "hw/virtio/virtio-access.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,
|
static uint64_t virtio_9p_get_features(VirtIODevice *vdev, uint64_t features,
|
||||||
Error **errp)
|
Error **errp)
|
||||||
{
|
{
|
||||||
|
@ -65,13 +65,7 @@ ssize_t pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
|
|||||||
|
|
||||||
static void pdu_push_and_notify(V9fsPDU *pdu)
|
static void pdu_push_and_notify(V9fsPDU *pdu)
|
||||||
{
|
{
|
||||||
V9fsState *s = pdu->s;
|
virtio_9p_push_and_notify(pdu);
|
||||||
|
|
||||||
/* 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 int omode_to_uflags(int8_t mode)
|
static int omode_to_uflags(int8_t mode)
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
#include "9p.h"
|
#include "9p.h"
|
||||||
|
|
||||||
extern void handle_9p_output(VirtIODevice *vdev, VirtQueue *vq);
|
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,
|
ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset,
|
||||||
const char *fmt, va_list ap);
|
const char *fmt, va_list ap);
|
||||||
ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset,
|
ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user