mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemuDomainAttachNetDevice: use only one virErrorPtr variable
Commit f7b5566
added 'save_error' even though the function
already has 'originalError' used in the 'try_remove' section.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
ca0ab9cdd2
commit
2de3df854a
@ -1205,7 +1205,6 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
|
|||||||
bool charDevPlugged = false;
|
bool charDevPlugged = false;
|
||||||
bool netdevPlugged = false;
|
bool netdevPlugged = false;
|
||||||
char *netdev_name;
|
char *netdev_name;
|
||||||
virErrorPtr save_error = NULL;
|
|
||||||
|
|
||||||
/* preallocate new slot for device */
|
/* preallocate new slot for device */
|
||||||
if (VIR_REALLOC_N(vm->def->nets, vm->def->nnets + 1) < 0)
|
if (VIR_REALLOC_N(vm->def->nets, vm->def->nnets + 1) < 0)
|
||||||
@ -1487,9 +1486,9 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
|
|||||||
qemuDomainReleaseDeviceAddress(vm, &net->info, NULL);
|
qemuDomainReleaseDeviceAddress(vm, &net->info, NULL);
|
||||||
|
|
||||||
if (iface_connected) {
|
if (iface_connected) {
|
||||||
virErrorPreserveLast(&save_error);
|
virErrorPreserveLast(&originalError);
|
||||||
virDomainConfNWFilterTeardown(net);
|
virDomainConfNWFilterTeardown(net);
|
||||||
virErrorRestore(&save_error);
|
virErrorRestore(&originalError);
|
||||||
|
|
||||||
if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_DIRECT) {
|
if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_DIRECT) {
|
||||||
ignore_value(virNetDevMacVLanDeleteWithVPortProfile(
|
ignore_value(virNetDevMacVLanDeleteWithVPortProfile(
|
||||||
|
Loading…
Reference in New Issue
Block a user