Message ID | 147446365782.4880.9477223746897679434.stgit@bahia |
---|---|
State | New |
Headers | show |
On Wed, 21 Sep 2016 15:14:17 +0200 Greg Kurz <groug@kaod.org> 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 <groug@kaod.org> > --- > 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..68a448acd81b 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"); > + return; Do a 'break;' for consistency's sake? > } > > iov_cnt = elem->out_num; >
On Wed, 21 Sep 2016 16:30:16 +0200 Cornelia Huck <cornelia.huck@de.ibm.com> wrote: > On Wed, 21 Sep 2016 15:14:17 +0200 > Greg Kurz <groug@kaod.org> 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 <groug@kaod.org> > > --- > > 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..68a448acd81b 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"); > > + return; > > Do a 'break;' for consistency's sake? > Would an out_err label be okay ? > > } > > > > iov_cnt = elem->out_num; > > >
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 01f1351554aa..68a448acd81b 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"); + return; } iov_cnt = elem->out_num;
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 <groug@kaod.org> --- hw/net/virtio-net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)