Skip to contentSkip to conversation

virtio-9p: Return ENOSYS for unhandled requests.

PATCH New Kusanagi Kouichi 1 participant 1 message Apr 1, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-9p: Return ENOSYS for unhandled requests.

Linux 2.6.39-rc1 guest causes qemu to abort when it sync or umount a rw 9p mount.

---
 hw/virtio-9p.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
hw/virtio-9p.c +5 -3
index 7c59988..03cd957 100644
@@ -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)
Signature · 1 line
1.7.4.1