Re: [Qemu-devel] [PATCH v2 0/9] virtio: avoid inappropriate QEMU termination

2016-09-23 Thread Greg Kurz
On Fri, 23 Sep 2016 14:31:56 +0100
Stefan Hajnoczi  wrote:

> On Wed, Sep 21, 2016 at 06:56:46PM +0200, Greg Kurz wrote:
> > This series is a follow up to Stefan's work to eradicate most calls to
> > exit() we currently have in the virtio code.
> > 
> > It addresses all exit() call sites in the blk, net and scsi device code,
> > where the error is about a missing or malformed in/out header sent by
> > the guest. They are converted to use virtio_error() and stop any processing,
> > instead of exiting.
> > 
> > The remaining call sites are related to a host misconfiguration or a
> > migration stream issue.
> > 
> > The 9P code currently calls assert() instead of exit(), but it also about
> > malformed or missing headers, so it gets converted the same way.
> > 
> > Next work will be to check all assert() call sites in the device code, in
> > case some of them actually refer to a bug in the guest, and should be
> > converted to use virtio_error() as well.
> > 
> > ---
> > 
> > Greg Kurz (9):
> >   virtio-9p: add parentheses to sizeof operator
> >   virtio-blk: turn virtio_blk_handle_request() into a static function
> >   virtio-9p: handle handle_9p_output() error
> >   virtio-blk: handle virtio_blk_handle_request() errors
> >   virtio-net: handle virtio_net_handle_ctrl() error
> >   virtio-net: handle virtio_net_receive() errors
> >   virtio-net: handle virtio_net_flush_tx() errors
> >   virtio-scsi: convert virtio_scsi_bad_req() to use virtio_error()
> >   virtio-scsi: handle virtio_scsi_set_config() error
> > 
> > 
> >  hw/9pfs/virtio-9p-device.c |   24 ++-
> >  hw/block/virtio-blk.c  |   28 ++
> >  hw/net/virtio-net.c|   51 
> > +++-
> >  hw/scsi/virtio-scsi.c  |   23 ++
> >  include/hw/virtio/virtio-blk.h |2 --
> >  5 files changed, 78 insertions(+), 50 deletions(-)  
> 
> I'll review the next revision fully.  Please consider the leaks caused
> by returning with a VirtQueueElement allocated.  I pointed them out in a
> few patches.

Thanks for pointing these out. I'll fix them in v3.

Cheers.

--
Greg


pgpGEaTAkKF7z.pgp
Description: OpenPGP digital signature


Re: [Qemu-devel] [PATCH v2 0/9] virtio: avoid inappropriate QEMU termination

2016-09-23 Thread Stefan Hajnoczi
On Wed, Sep 21, 2016 at 06:56:46PM +0200, Greg Kurz wrote:
> This series is a follow up to Stefan's work to eradicate most calls to
> exit() we currently have in the virtio code.
> 
> It addresses all exit() call sites in the blk, net and scsi device code,
> where the error is about a missing or malformed in/out header sent by
> the guest. They are converted to use virtio_error() and stop any processing,
> instead of exiting.
> 
> The remaining call sites are related to a host misconfiguration or a
> migration stream issue.
> 
> The 9P code currently calls assert() instead of exit(), but it also about
> malformed or missing headers, so it gets converted the same way.
> 
> Next work will be to check all assert() call sites in the device code, in
> case some of them actually refer to a bug in the guest, and should be
> converted to use virtio_error() as well.
> 
> ---
> 
> Greg Kurz (9):
>   virtio-9p: add parentheses to sizeof operator
>   virtio-blk: turn virtio_blk_handle_request() into a static function
>   virtio-9p: handle handle_9p_output() error
>   virtio-blk: handle virtio_blk_handle_request() errors
>   virtio-net: handle virtio_net_handle_ctrl() error
>   virtio-net: handle virtio_net_receive() errors
>   virtio-net: handle virtio_net_flush_tx() errors
>   virtio-scsi: convert virtio_scsi_bad_req() to use virtio_error()
>   virtio-scsi: handle virtio_scsi_set_config() error
> 
> 
>  hw/9pfs/virtio-9p-device.c |   24 ++-
>  hw/block/virtio-blk.c  |   28 ++
>  hw/net/virtio-net.c|   51 
> +++-
>  hw/scsi/virtio-scsi.c  |   23 ++
>  include/hw/virtio/virtio-blk.h |2 --
>  5 files changed, 78 insertions(+), 50 deletions(-)

I'll review the next revision fully.  Please consider the leaks caused
by returning with a VirtQueueElement allocated.  I pointed them out in a
few patches.


signature.asc
Description: PGP signature


Re: [Qemu-devel] [PATCH v2 0/9] virtio: avoid inappropriate QEMU termination

2016-09-22 Thread Cornelia Huck
On Wed, 21 Sep 2016 18:56:46 +0200
Greg Kurz  wrote:

> This series is a follow up to Stefan's work to eradicate most calls to
> exit() we currently have in the virtio code.
> 
> It addresses all exit() call sites in the blk, net and scsi device code,
> where the error is about a missing or malformed in/out header sent by
> the guest. They are converted to use virtio_error() and stop any processing,
> instead of exiting.
> 
> The remaining call sites are related to a host misconfiguration or a
> migration stream issue.
> 
> The 9P code currently calls assert() instead of exit(), but it also about
> malformed or missing headers, so it gets converted the same way.
> 
> Next work will be to check all assert() call sites in the device code, in
> case some of them actually refer to a bug in the guest, and should be
> converted to use virtio_error() as well.

I'm nearly out of the door for my vacation, so don't wait for any
further R-b from me :)




Re: [Qemu-devel] [PATCH v2 0/9] virtio: avoid inappropriate QEMU termination

2016-09-21 Thread no-reply
Hi,

Your series failed automatic build test. Please find the testing commands and
their output below. If you have docker installed, you can probably reproduce it
locally.

Type: series
Message-id: 147447700612.30952.9420141963781948805.stgit@bahia
Subject: [Qemu-devel] [PATCH v2 0/9] virtio: avoid inappropriate QEMU 
termination

=== TEST SCRIPT BEGIN ===
#!/bin/bash
set -e
git submodule update --init dtc
make J=8 docker-test-quick@centos6
make J=8 docker-test-mingw@fedora
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
7d50db7 virtio-scsi: handle virtio_scsi_set_config() error
0ad232e virtio-scsi: convert virtio_scsi_bad_req() to use virtio_error()
cf9e962 virtio-net: handle virtio_net_flush_tx() errors
244b179 virtio-net: handle virtio_net_receive() errors
2731464 virtio-net: handle virtio_net_handle_ctrl() error
8b62b61 virtio-blk: handle virtio_blk_handle_request() errors
3d6e630 virtio-9p: handle handle_9p_output() error
12274ef virtio-blk: turn virtio_blk_handle_request() into a static function
3767b30 virtio-9p: add parentheses to sizeof operator

=== OUTPUT BEGIN ===
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into 'dtc'...
Submodule path 'dtc': checked out '65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf'
  BUILD centos6
  ARCHIVE qemu.tgz
  ARCHIVE dtc.tgz
  COPY RUNNER
  RUN test-quick in centos6
No C++ compiler available; disabling C++ specific optional code
Install prefix/tmp/qemu-test/src/tests/docker/install
BIOS directory/tmp/qemu-test/src/tests/docker/install/share/qemu
binary directory  /tmp/qemu-test/src/tests/docker/install/bin
library directory /tmp/qemu-test/src/tests/docker/install/lib
module directory  /tmp/qemu-test/src/tests/docker/install/lib/qemu
libexec directory /tmp/qemu-test/src/tests/docker/install/libexec
include directory /tmp/qemu-test/src/tests/docker/install/include
config directory  /tmp/qemu-test/src/tests/docker/install/etc
local state directory   /tmp/qemu-test/src/tests/docker/install/var
Manual directory  /tmp/qemu-test/src/tests/docker/install/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path   /tmp/qemu-test/src
C compilercc
Host C compiler   cc
C++ compiler  
Objective-C compiler cc
ARFLAGS   rv
CFLAGS-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pthread 
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -g 
QEMU_CFLAGS   -I/usr/include/pixman-1-fPIE -DPIE -m64 -D_GNU_SOURCE 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes 
-Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes 
-fno-strict-aliasing -fno-common -fwrapv  -Wendif-labels -Wmissing-include-dirs 
-Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self 
-Wignored-qualifiers -Wold-style-declaration -Wold-style-definition 
-Wtype-limits -fstack-protector-all
LDFLAGS   -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m64 -g 
make  make
install   install
pythonpython -B
smbd  /usr/sbin/smbd
module supportno
host CPU  x86_64
host big endian   no
target list   x86_64-softmmu aarch64-softmmu
tcg debug enabled no
gprof enabled no
sparse enabledno
strip binariesyes
profiler  no
static build  no
pixmansystem
SDL support   yes (1.2.14)
GTK support   no 
GTK GL supportno
VTE support   no 
TLS priority  NORMAL
GNUTLS supportno
GNUTLS rndno
libgcrypt no
libgcrypt kdf no
nettleno 
nettle kdfno
libtasn1  no
curses supportno
virgl support no
curl support  no
mingw32 support   no
Audio drivers oss
Block whitelist (rw) 
Block whitelist (ro) 
VirtFS supportno
VNC support   yes
VNC SASL support  no
VNC JPEG support  no
VNC PNG support   no
xen support   no
brlapi supportno
bluez  supportno
Documentation no
PIE   yes
vde support   no
netmap supportno
Linux AIO support no
ATTR/XATTR support yes
Install blobs yes
KVM support   yes
RDMA support  no
TCG interpreter   no
fdt support   yes
preadv supportyes
fdatasync yes
madvise   yes
posix_madvise yes
uuid support  no
libcap-ng support no
vhost-net support yes
vhost-scsi support yes
vhost-vsock support yes
Trace backendslog
spice support no 
rbd support   no
xfsctl supportno
smartcard support no
libusbno
usb net redir no
OpenGL supportno
OpenGL dmabufsno
libiscsi support  no
libnfs supportno
build guest agent yes
QGA VSS support   no
QGA w32 disk info no
QGA MSI support   no
seccomp support   no
coroutine backend ucontext
coroutine poolyes
GlusterFS support no
Archipelago support no
gcov  gcov
gcov enabled  no
TPM support   yes
libssh2 support   no
TPM passthrough   yes
QOM debugging yes
vhdx  no
lzo support