nodedev: remove unnecessary checks for NULL cmd

virCommandRun() already handles the case where the cmd argument is NULL,
so there's no need for the caller to check. Make all callers consistent
and remove unnecessary NULL checks.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Jonathon Jongsma 2021-04-21 10:47:43 -05:00
parent 2d847765d2
commit 68580a5176

View File

@ -799,9 +799,6 @@ virMdevctlCreate(virNodeDeviceDef *def, char **uuid, char **errmsg)
MDEVCTL_CMD_CREATE,
uuid,
errmsg);
if (!cmd)
return -1;
/* an auto-generated uuid is returned via stdout if no uuid is specified in
* the mdevctl args */
if (virCommandRun(cmd, &status) < 0 || status != 0)
@ -822,9 +819,6 @@ virMdevctlDefine(virNodeDeviceDef *def, char **uuid, char **errmsg)
MDEVCTL_CMD_DEFINE,
uuid, errmsg);
if (!cmd)
return -1;
/* an auto-generated uuid is returned via stdout if no uuid is specified in
* the mdevctl args */
if (virCommandRun(cmd, &status) < 0 || status != 0)