virtio-serial: Print out reason for aborting before calling abort()
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.
Signed-off-by Amit Shah <[email protected]>
--- hw/virtio-serial-bus.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
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);abort (); }if (ret == -EAGAIN || (ret >=0 && ret < buf_size)) {
Signature · 1 line
1.7.4
Quoted 14 lines · Amit Shah
When a port returns an error for not consuming data, we can only handle the
-EAGAINerror type. Any other error isn't handled. Print out a message indicating this and the error returned.Signed-off-by Amit Shah <[email protected]>--- hw/virtio-serial-bus.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)hw/virtio-serial-bus.c +0
-0
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