mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
libxl: fix net device detach
Chunyan sent a nice cleanup patch for libxlDomainDetachNetDevice https://www.redhat.com/archives/libvir-list/2016-March/msg00926.html which I incorrectly modified before pushing as commitb5534e53. My modification caused network devices of type hostdev to no longer be removed. This patch changesb5534e53to resemble Chunyan's original, correct patch.
This commit is contained in:
@@ -3449,12 +3449,14 @@ libxlDomainDetachNetDevice(libxlDriverPrivatePtr driver,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
networkReleaseActualDevice(vm->def, detach);
|
||||
virDomainNetRemove(vm->def, detachidx);
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
libxl_device_nic_dispose(&nic);
|
||||
if (!ret) {
|
||||
networkReleaseActualDevice(vm->def, detach);
|
||||
virDomainNetRemove(vm->def, detachidx);
|
||||
}
|
||||
virObjectUnref(cfg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user