提交 89f244ba 编写于 作者: D Daniel P. Berrange

Preserve error when tearing down nwfilter rules

When a VM fails to launch due to error creating nwfilter
rules, we must avoid overwriting the original error when
tearing down the partially created rules.
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 b1c1df05
......@@ -7640,8 +7640,12 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
ret = 0;
cleanup:
if (ret < 0)
if (ret < 0) {
virErrorPtr saved_err = virSaveLastError();
virDomainConfNWFilterTeardown(net);
virSetError(saved_err);
virFreeError(saved_err);
}
for (i = 0; tapfd && i < tapfdSize && tapfd[i] >= 0; i++) {
if (ret < 0)
VIR_FORCE_CLOSE(tapfd[i]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册