[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 5/9] virtio-net: handle virtio_net_handle_ctr
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v2 5/9] virtio-net: handle virtio_net_handle_ctrl() error |
Date: |
Fri, 23 Sep 2016 14:07:17 +0100 |
User-agent: |
Mutt/1.7.0 (2016-08-17) |
On Wed, Sep 21, 2016 at 06:57:29PM +0200, Greg Kurz wrote:
> This error is caused by a buggy guest: let's switch the device to the
> broken state instead of terminating QEMU.
>
> Signed-off-by: Greg Kurz <address@hidden>
> ---
> v2: - s/return/break in virtio_net_handle_ctrl() for consistency's sake
> ---
> hw/net/virtio-net.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 01f1351554aa..8a6f1d952467 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -892,8 +892,8 @@ static void virtio_net_handle_ctrl(VirtIODevice *vdev,
> VirtQueue *vq)
> }
> if (iov_size(elem->in_sg, elem->in_num) < sizeof(status) ||
> iov_size(elem->out_sg, elem->out_num) < sizeof(ctrl)) {
> - error_report("virtio-net ctrl missing headers");
> - exit(1);
> + virtio_error(vdev, "virtio-net ctrl missing headers");
> + break;
We must detach and free elem to avoid leaks.
signature.asc
Description: PGP signature
- Re: [Qemu-devel] [PATCH v2 2/9] virtio-blk: turn virtio_blk_handle_request() into a static function, (continued)
- [Qemu-devel] [PATCH v2 3/9] virtio-9p: handle handle_9p_output() error, Greg Kurz, 2016/09/21
- [Qemu-devel] [PATCH v2 4/9] virtio-blk: handle virtio_blk_handle_request() errors, Greg Kurz, 2016/09/21
- [Qemu-devel] [PATCH v2 5/9] virtio-net: handle virtio_net_handle_ctrl() error, Greg Kurz, 2016/09/21
- [Qemu-devel] [PATCH v2 7/9] virtio-net: handle virtio_net_flush_tx() errors, Greg Kurz, 2016/09/21
- [Qemu-devel] [PATCH v2 8/9] virtio-scsi: convert virtio_scsi_bad_req() to use virtio_error(), Greg Kurz, 2016/09/21
- [Qemu-devel] [PATCH v2 6/9] virtio-net: handle virtio_net_receive() errors, Greg Kurz, 2016/09/21
- [Qemu-devel] [PATCH v2 9/9] virtio-scsi: handle virtio_scsi_set_config() error, Greg Kurz, 2016/09/21
- Re: [Qemu-devel] [PATCH v2 0/9] virtio: avoid inappropriate QEMU termination, no-reply, 2016/09/21
- Re: [Qemu-devel] [PATCH v2 0/9] virtio: avoid inappropriate QEMU termination, Cornelia Huck, 2016/09/22
- Re: [Qemu-devel] [PATCH v2 0/9] virtio: avoid inappropriate QEMU termination, Stefan Hajnoczi, 2016/09/23