[PATCH v2 2/4] contrib/vhost-user-gpu: avoid g_return_val_if() input validation

2020-12-02 Thread Stefan Hajnoczi
Do not validate input with g_return_val_if(). This API is intended for checking programming errors and is compiled out with -DG_DISABLE_CHECKS. Use an explicit if statement for input validation so it cannot accidentally be compiled out. Suggested-by: Markus Armbruster Signed-off-by: Stefan Hajno

Re: [PATCH v2 2/4] contrib/vhost-user-gpu: avoid g_return_val_if() input validation

2020-12-02 Thread Marc-André Lureau
On Wed, Dec 2, 2020 at 7:27 PM Stefan Hajnoczi wrote: > Do not validate input with g_return_val_if(). This API is intended for > checking programming errors and is compiled out with -DG_DISABLE_CHECKS. > > Use an explicit if statement for input validation so it cannot > accidentally be compiled o

Re: [PATCH v2 2/4] contrib/vhost-user-gpu: avoid g_return_val_if() input validation

2020-12-03 Thread Stefan Hajnoczi
On Wed, Dec 02, 2020 at 07:50:51PM +0400, Marc-André Lureau wrote: > On Wed, Dec 2, 2020 at 7:27 PM Stefan Hajnoczi wrote: > > > Do not validate input with g_return_val_if(). This API is intended for > > checking programming errors and is compiled out with -DG_DISABLE_CHECKS. > > > > Use an expli

Re: [PATCH v2 2/4] contrib/vhost-user-gpu: avoid g_return_val_if() input validation

2020-12-03 Thread Marc-André Lureau
On Thu, Dec 3, 2020 at 1:52 PM Stefan Hajnoczi wrote: > On Wed, Dec 02, 2020 at 07:50:51PM +0400, Marc-André Lureau wrote: > > On Wed, Dec 2, 2020 at 7:27 PM Stefan Hajnoczi > wrote: > > > > > Do not validate input with g_return_val_if(). This API is intended for > > > checking programming error

Re: [PATCH v2 2/4] contrib/vhost-user-gpu: avoid g_return_val_if() input validation

2020-12-03 Thread Stefan Hajnoczi
On Thu, Dec 03, 2020 at 02:26:08PM +0400, Marc-André Lureau wrote: > On Thu, Dec 3, 2020 at 1:52 PM Stefan Hajnoczi wrote: > > > On Wed, Dec 02, 2020 at 07:50:51PM +0400, Marc-André Lureau wrote: > > > On Wed, Dec 2, 2020 at 7:27 PM Stefan Hajnoczi > > wrote: > > > > > > > Do not validate input