mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
Use g_autoptr instead of virNetDevBandwidthFree where possible
Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
e4dd2a2c2e
commit
2870a164b9
@ -5397,7 +5397,7 @@ networkPortSetParameters(virNetworkPortPtr port,
|
|||||||
virNetworkObjPtr obj;
|
virNetworkObjPtr obj;
|
||||||
virNetworkDefPtr def;
|
virNetworkDefPtr def;
|
||||||
virNetworkPortDefPtr portdef;
|
virNetworkPortDefPtr portdef;
|
||||||
virNetDevBandwidthPtr bandwidth = NULL;
|
g_autoptr(virNetDevBandwidth) bandwidth = NULL;
|
||||||
g_autofree char *dir = NULL;
|
g_autofree char *dir = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
size_t i;
|
size_t i;
|
||||||
@ -5473,7 +5473,6 @@ networkPortSetParameters(virNetworkPortPtr port,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virNetDevBandwidthFree(bandwidth);
|
|
||||||
virNetworkObjEndAPI(&obj);
|
virNetworkObjEndAPI(&obj);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -10204,7 +10204,8 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
|
|||||||
virDomainDefPtr persistentDef;
|
virDomainDefPtr persistentDef;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virDomainNetDefPtr net = NULL, persistentNet = NULL;
|
virDomainNetDefPtr net = NULL, persistentNet = NULL;
|
||||||
virNetDevBandwidthPtr bandwidth = NULL, newBandwidth = NULL;
|
g_autoptr(virNetDevBandwidth) bandwidth = NULL;
|
||||||
|
g_autoptr(virNetDevBandwidth) newBandwidth = NULL;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = NULL;
|
g_autoptr(virQEMUDriverConfig) cfg = NULL;
|
||||||
bool inboundSpecified = false, outboundSpecified = false;
|
bool inboundSpecified = false, outboundSpecified = false;
|
||||||
int actualType;
|
int actualType;
|
||||||
@ -10418,8 +10419,6 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
|
|||||||
qemuDomainObjEndJob(driver, vm);
|
qemuDomainObjEndJob(driver, vm);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virNetDevBandwidthFree(bandwidth);
|
|
||||||
virNetDevBandwidthFree(newBandwidth);
|
|
||||||
virDomainObjEndAPI(&vm);
|
virDomainObjEndAPI(&vm);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -3448,7 +3448,7 @@ testDomainSetInterfaceParameters(virDomainPtr dom,
|
|||||||
virDomainObjPtr vm = NULL;
|
virDomainObjPtr vm = NULL;
|
||||||
virDomainDefPtr def;
|
virDomainDefPtr def;
|
||||||
virDomainNetDefPtr net = NULL;
|
virDomainNetDefPtr net = NULL;
|
||||||
virNetDevBandwidthPtr bandwidth = NULL;
|
g_autoptr(virNetDevBandwidth) bandwidth = NULL;
|
||||||
bool inboundSpecified = false;
|
bool inboundSpecified = false;
|
||||||
bool outboundSpecified = false;
|
bool outboundSpecified = false;
|
||||||
size_t i;
|
size_t i;
|
||||||
@ -3538,7 +3538,6 @@ testDomainSetInterfaceParameters(virDomainPtr dom,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virNetDevBandwidthFree(bandwidth);
|
|
||||||
virDomainObjEndAPI(&vm);
|
virDomainObjEndAPI(&vm);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ testVirNetDevBandwidthSet(const void *data)
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
const struct testSetStruct *info = data;
|
const struct testSetStruct *info = data;
|
||||||
const char *iface = info->iface;
|
const char *iface = info->iface;
|
||||||
virNetDevBandwidthPtr band = NULL;
|
g_autoptr(virNetDevBandwidth) band = NULL;
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
char *actual_cmd = NULL;
|
char *actual_cmd = NULL;
|
||||||
|
|
||||||
@ -98,7 +98,6 @@ testVirNetDevBandwidthSet(const void *data)
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandSetDryRun(NULL, NULL, NULL);
|
virCommandSetDryRun(NULL, NULL, NULL);
|
||||||
virNetDevBandwidthFree(band);
|
|
||||||
VIR_FREE(actual_cmd);
|
VIR_FREE(actual_cmd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user