[PATCH v2 0/4] vhost-user: avoid g_return_val_if() in get/set_config()

Stefan Hajnoczi posted 4 patches 3 years, 5 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201202152611.677753-1-stefanha@redhat.com
block/export/vhost-user-blk-server.c    | 6 +++++-
contrib/vhost-user-blk/vhost-user-blk.c | 6 +++++-
contrib/vhost-user-gpu/vhost-user-gpu.c | 6 +++++-
contrib/vhost-user-input/main.c         | 6 +++++-
4 files changed, 20 insertions(+), 4 deletions(-)
[PATCH v2 0/4] vhost-user: avoid g_return_val_if() in get/set_config()
Posted by Stefan Hajnoczi 3 years, 5 months ago
v2:
 * Print errors [Marc-André]

Markus Armbruster pointed out that g_return_val_if() is meant for programming
errors. It must not be used for input validation since it can be compiled out.
Use explicit if statements instead.

This patch series converts vhost-user device backends that use
g_return_val_if() in get/set_config().

Stefan Hajnoczi (4):
  contrib/vhost-user-blk: avoid g_return_val_if() input validation
  contrib/vhost-user-gpu: avoid g_return_val_if() input validation
  contrib/vhost-user-input: avoid g_return_val_if() input validation
  block/export: avoid g_return_val_if() input validation

 block/export/vhost-user-blk-server.c    | 6 +++++-
 contrib/vhost-user-blk/vhost-user-blk.c | 6 +++++-
 contrib/vhost-user-gpu/vhost-user-gpu.c | 6 +++++-
 contrib/vhost-user-input/main.c         | 6 +++++-
 4 files changed, 20 insertions(+), 4 deletions(-)

-- 
2.28.0

Re: [PATCH v2 0/4] vhost-user: avoid g_return_val_if() in get/set_config()
Posted by Stefano Garzarella 3 years, 4 months ago
On Wed, Dec 02, 2020 at 03:26:07PM +0000, Stefan Hajnoczi wrote:
>v2:
> * Print errors [Marc-André]
>
>Markus Armbruster pointed out that g_return_val_if() is meant for programming
>errors. It must not be used for input validation since it can be compiled out.
>Use explicit if statements instead.
>
>This patch series converts vhost-user device backends that use
>g_return_val_if() in get/set_config().
>
>Stefan Hajnoczi (4):
>  contrib/vhost-user-blk: avoid g_return_val_if() input validation
>  contrib/vhost-user-gpu: avoid g_return_val_if() input validation
>  contrib/vhost-user-input: avoid g_return_val_if() input validation
>  block/export: avoid g_return_val_if() input validation
>
> block/export/vhost-user-blk-server.c    | 6 +++++-
> contrib/vhost-user-blk/vhost-user-blk.c | 6 +++++-
> contrib/vhost-user-gpu/vhost-user-gpu.c | 6 +++++-
> contrib/vhost-user-input/main.c         | 6 +++++-
> 4 files changed, 20 insertions(+), 4 deletions(-)
>
>-- 
>2.28.0
>

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>


Re: [PATCH v2 0/4] vhost-user: avoid g_return_val_if() in get/set_config()
Posted by Marc-André Lureau 3 years, 4 months ago
Hi Michael,

On Thu, Dec 3, 2020 at 5:41 PM Stefano Garzarella <sgarzare@redhat.com>
wrote:

> On Wed, Dec 02, 2020 at 03:26:07PM +0000, Stefan Hajnoczi wrote:
> >v2:
> > * Print errors [Marc-André]
> >
> >Markus Armbruster pointed out that g_return_val_if() is meant for
> programming
> >errors. It must not be used for input validation since it can be compiled
> out.
> >Use explicit if statements instead.
> >
> >This patch series converts vhost-user device backends that use
> >g_return_val_if() in get/set_config().
> >
> >Stefan Hajnoczi (4):
> >  contrib/vhost-user-blk: avoid g_return_val_if() input validation
> >  contrib/vhost-user-gpu: avoid g_return_val_if() input validation
> >  contrib/vhost-user-input: avoid g_return_val_if() input validation
> >  block/export: avoid g_return_val_if() input validation
> >
> > block/export/vhost-user-blk-server.c    | 6 +++++-
> > contrib/vhost-user-blk/vhost-user-blk.c | 6 +++++-
> > contrib/vhost-user-gpu/vhost-user-gpu.c | 6 +++++-
> > contrib/vhost-user-input/main.c         | 6 +++++-
> > 4 files changed, 20 insertions(+), 4 deletions(-)
> >
> >--
> >2.28.0
> >
>
> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
>
>
You didn't collect the v2 patch series, with the received reviewed-by. Not
a big deal here, but please be more careful.

thanks

-- 
Marc-André Lureau