Skip to contentSkip to conversation

virtio-serial: Print out reason for aborting before calling abort()

PATCH Superseded Amit Shah 1 participant 2 messages Mar 25, 2011

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Amit Shah

author
#0 lore raw

PATCH 1/1 virtio-serial: Print out reason for aborting before calling abort()

When a port returns an error for not consuming data, we can only handle the -EAGAIN error type. Any other error isn't handled. Print out a message indicating this and the error returned.

---
 hw/virtio-serial-bus.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
hw/virtio-serial-bus.c +1 -0
index a82fbe9..0e4ac81 100644
@@ -155,6 +155,7 @@ static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq,
                                         buf_size);
             if (ret < 0 && ret != -EAGAIN) {
                 /* We don't handle any other type of errors here */
+                error_report("%s: unexpected return %zd, aborting.\n", ret);
                 abort();
             }
             if (ret == -EAGAIN || (ret >= 0 && ret < buf_size)) {
Signature · 1 line
1.7.4
author
#1 lore raw
Quoted 14 lines · Amit Shah

When a port returns an error for not consuming data, we can only handle the -EAGAIN error type. Any other error isn't handled. Print out a message indicating this and the error returned.

---
 hw/virtio-serial-bus.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
hw/virtio-serial-bus.c +0 -0
index a82fbe9..0e4ac81 100644

hw/virtio-serial-bus.c static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq, · line 158

Quoted 4 lines
hw/virtio-serial-bus.c +1 -0
@@ -155,6 +155,7 @@ static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq,
                                         buf_size);
             if (ret < 0 && ret != -EAGAIN) {
                 /* We don't handle any other type of errors here */
+                error_report("%s: unexpected return %zd, aborting.\n", ret);

Sorry, re-sending.

Amit