提交 b0c3e931 编写于 作者: X xinhua.Cao 提交者: Michal Privoznik

libvirt_iohelper: record the libvirt_iohelper's error message at virFileWrapperFdFree

Currently iohelper's error log is recorded in virFileWrapperFdClose.
However, if something goes wrong the caller might not even get to
calling virFileWrapperFdClose and call virFileWrapperFdFree
directly. Therefore the error reporting should happen there.
Signed-off-by: Nxinhua.Cao <caoxinhua@huawei.com>
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 1df3fb7c
......@@ -330,9 +330,6 @@ virFileWrapperFdClose(virFileWrapperFdPtr wfd)
return 0;
ret = virCommandWait(wfd->cmd, NULL);
if (wfd->err_msg && *wfd->err_msg)
VIR_WARN("iohelper reports: %s", wfd->err_msg);
return ret;
}
......@@ -351,8 +348,12 @@ virFileWrapperFdFree(virFileWrapperFdPtr wfd)
if (!wfd)
return;
VIR_FREE(wfd->err_msg);
if (wfd->err_msg && *wfd->err_msg)
VIR_WARN("iohelper reports: %s", wfd->err_msg);
virCommandAbort(wfd->cmd);
VIR_FREE(wfd->err_msg);
virCommandFree(wfd->cmd);
VIR_FREE(wfd);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册