From patchwork Fri Apr 1 16:31:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: virtio-9p: Return ENOSYS for unhandled requests. Date: Fri, 01 Apr 2011 06:31:40 -0000 From: Kusanagi Kouichi X-Patchwork-Id: 89325 Message-Id: <20110401163141.0C24515C039@msa104.auone-net.jp> To: qemu-devel@nongnu.org Linux 2.6.39-rc1 guest causes qemu to abort when it sync or umount a rw 9p mount. Signed-off-by: Kusanagi Kouichi --- hw/virtio-9p.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c index 7c59988..03cd957 100644 --- a/hw/virtio-9p.c +++ b/hw/virtio-9p.c @@ -3597,9 +3597,11 @@ static void submit_pdu(V9fsState *s, V9fsPDU *pdu) BUG_ON(pdu->id >= ARRAY_SIZE(pdu_handlers)); handler = pdu_handlers[pdu->id]; - BUG_ON(handler == NULL); - - handler(s, pdu); + if (handler == NULL) { + complete_pdu(s, pdu, ENOSYS); + } else { + handler(s, pdu); + } } static void handle_9p_output(VirtIODevice *vdev, VirtQueue *vq)