esx_util.h: Add ESX_VI_CHECK_ARG_LIST macro

This macro avoids code duplication when checking for arrays of objects.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Marcos Paulo de Souza 2018-07-03 23:31:22 -03:00 committed by Michal Privoznik
parent d6cfa0cde0
commit 03212ab925

View File

@ -26,6 +26,14 @@
# include "internal.h"
# include "viruri.h"
# define ESX_VI_CHECK_ARG_LIST(val) \
do { \
if (!val || *val) { \
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument")); \
return -1; \
} \
} while (0)
typedef struct _esxUtil_ParsedUri esxUtil_ParsedUri;
struct _esxUtil_ParsedUri {