If there is an error hotpluging a net device (for whatever
reason) a rollback operation is performed. However, whilst doing
so various helper functions that are called report errors on
their own. This results in the original error to be overwritten
and thus misleading the user.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
virDomainNetDefPtr net)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
+ virErrorPtr originalError = NULL;
char **tapfdName = NULL;
int *tapfd = NULL;
size_t tapfdSize = 0;
if (!virDomainObjIsActive(vm))
goto cleanup;
+ originalError = virSaveLastError();
if (vlan < 0) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV)) {
char *netdev_name;
ignore_value(qemuDomainObjExitMonitor(driver, vm));
VIR_FREE(hostnet_name);
}
+ virSetError(originalError);
+ virFreeError(originalError);
goto cleanup;
}