diff options
author | Greg Kurz <groug@kaod.org> | 2017-05-25 10:30:13 +0200 |
---|---|---|
committer | Greg Kurz <groug@kaod.org> | 2017-05-25 10:30:13 +0200 |
commit | 506f3275829258fdf193bbf0f98f3f9e8c0f3c45 (patch) | |
tree | ec8cc52f26cef4e5abdb4277acaa06dddc573a07 /hw/9pfs/9p.c | |
parent | 9964e96dc9999cf7f7c936ee854a795415d19b60 (diff) |
virtio-9p/xen-9p: move 9p specific bits to core 9p code
These bits aren't related to the transport so let's move them to the core
code.
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Diffstat (limited to 'hw/9pfs/9p.c')
-rw-r--r-- | hw/9pfs/9p.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index ab3e22f231..b3048371a8 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -3446,12 +3446,16 @@ static inline bool is_read_only_op(V9fsPDU *pdu) } } -void pdu_submit(V9fsPDU *pdu) +void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr) { Coroutine *co; CoroutineEntry *handler; V9fsState *s = pdu->s; + pdu->size = le32_to_cpu(hdr->size_le); + pdu->id = hdr->id; + pdu->tag = le16_to_cpu(hdr->tag_le); + if (pdu->id >= ARRAY_SIZE(pdu_co_handlers) || (pdu_co_handlers[pdu->id] == NULL)) { handler = v9fs_op_not_supp; @@ -3462,6 +3466,8 @@ void pdu_submit(V9fsPDU *pdu) if (is_ro_export(&s->ctx) && !is_read_only_op(pdu)) { handler = v9fs_fs_ro; } + + qemu_co_queue_init(&pdu->complete); co = qemu_coroutine_create(handler, pdu); qemu_coroutine_enter(co); } |