mirror of https://gitee.com/openkylin/libvirt.git
virCommandWait: Propagate dryRunCallback return value properly
The documentation to virCommandWait() function states that if @exitstatus is NULL and command finished with error -1 is returned. In other words, if @dryRunCallback is set and returns an error (by setting its @status argument to a nonzero value) we must propagate this error properly honouring the documentation (and also regular run). Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
adfcbdff91
commit
c1a75828e4
|
@ -2542,6 +2542,8 @@ virCommandWait(virCommandPtr cmd, int *exitstatus)
|
|||
dryRunStatus);
|
||||
if (exitstatus)
|
||||
*exitstatus = dryRunStatus;
|
||||
else if (dryRunStatus)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue