mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 05:17:59 +03:00
Drop some useless comparisons and checks
In these cases the check that is removed has been done a few lines above already (as can even be seen in the context). Drop them. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
4ec3cf9a0f
commit
ab2e90006d
@ -79,8 +79,7 @@ main(int argc, char *argv[])
|
|||||||
cleanup:
|
cleanup:
|
||||||
if (dom != NULL)
|
if (dom != NULL)
|
||||||
virDomainFree(dom);
|
virDomainFree(dom);
|
||||||
if (conn != NULL)
|
virConnectClose(conn);
|
||||||
virConnectClose(conn);
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -2659,10 +2659,8 @@ virNWFilterDefParseXML(xmlXPathContextPtr ctxt)
|
|||||||
ret->chainPriority = chain_priority;
|
ret->chainPriority = chain_priority;
|
||||||
} else {
|
} else {
|
||||||
/* assign default priority if none can be found via lookup */
|
/* assign default priority if none can be found via lookup */
|
||||||
if (!name_prefix ||
|
if (intMapGetByString(chain_priorities, name_prefix,
|
||||||
intMapGetByString(chain_priorities, name_prefix, 0,
|
0, &ret->chainPriority) < 0) {
|
||||||
&ret->chainPriority) < 0) {
|
|
||||||
/* assign default chain priority */
|
|
||||||
ret->chainPriority = (NWFILTER_MAX_FILTER_PRIORITY +
|
ret->chainPriority = (NWFILTER_MAX_FILTER_PRIORITY +
|
||||||
NWFILTER_MIN_FILTER_PRIORITY) / 2;
|
NWFILTER_MIN_FILTER_PRIORITY) / 2;
|
||||||
}
|
}
|
||||||
|
@ -4340,8 +4340,7 @@ qemuBuildNVRAMCommandLine(virCommandPtr cmd,
|
|||||||
optstr = qemuBuildNVRAMDevStr(def->nvram);
|
optstr = qemuBuildNVRAMDevStr(def->nvram);
|
||||||
if (!optstr)
|
if (!optstr)
|
||||||
return -1;
|
return -1;
|
||||||
if (optstr)
|
virCommandAddArg(cmd, optstr);
|
||||||
virCommandAddArg(cmd, optstr);
|
|
||||||
VIR_FREE(optstr);
|
VIR_FREE(optstr);
|
||||||
} else {
|
} else {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
@ -3521,17 +3521,15 @@ qemuDomainChangeNetBridge(virDomainObjPtr vm,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oldbridge) {
|
ret = virNetDevBridgeRemovePort(oldbridge, olddev->ifname);
|
||||||
ret = virNetDevBridgeRemovePort(oldbridge, olddev->ifname);
|
virDomainAuditNet(vm, olddev, NULL, "detach", ret == 0);
|
||||||
virDomainAuditNet(vm, olddev, NULL, "detach", ret == 0);
|
if (ret < 0) {
|
||||||
if (ret < 0) {
|
/* warn but continue - possibly the old network
|
||||||
/* warn but continue - possibly the old network
|
* had been destroyed and reconstructed, leaving the
|
||||||
* had been destroyed and reconstructed, leaving the
|
* tap device orphaned.
|
||||||
* tap device orphaned.
|
*/
|
||||||
*/
|
VIR_WARN("Unable to detach device %s from bridge %s",
|
||||||
VIR_WARN("Unable to detach device %s from bridge %s",
|
olddev->ifname, oldbridge);
|
||||||
olddev->ifname, oldbridge);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = virNetDevBridgeAddPort(newbridge, olddev->ifname);
|
ret = virNetDevBridgeAddPort(newbridge, olddev->ifname);
|
||||||
|
@ -2120,7 +2120,7 @@ virResctrlAllocMemoryBandwidth(virResctrlInfoPtr resctrl,
|
|||||||
if (!mem_bw_alloc)
|
if (!mem_bw_alloc)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (mem_bw_alloc && !mem_bw_info) {
|
if (!mem_bw_info) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("RDT Memory Bandwidth allocation unsupported"));
|
_("RDT Memory Bandwidth allocation unsupported"));
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -1208,9 +1208,8 @@ virshSnapshotListCollect(vshControl *ctl, virDomainPtr dom,
|
|||||||
/* Now that we have a count, collect the list. */
|
/* Now that we have a count, collect the list. */
|
||||||
if (from && !priv->useSnapshotOld) {
|
if (from && !priv->useSnapshotOld) {
|
||||||
if (tree) {
|
if (tree) {
|
||||||
if (count)
|
count = virDomainSnapshotListChildrenNames(from, names + 1,
|
||||||
count = virDomainSnapshotListChildrenNames(from, names + 1,
|
count - 1, flags);
|
||||||
count - 1, flags);
|
|
||||||
if (count >= 0) {
|
if (count >= 0) {
|
||||||
count++;
|
count++;
|
||||||
names[0] = vshStrdup(ctl, fromname);
|
names[0] = vshStrdup(ctl, fromname);
|
||||||
|
Loading…
Reference in New Issue
Block a user