mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 19:45:21 +00:00
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: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
b1c1df05bf
commit
89f244ba7c
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user