cleanup:
if (dom != NULL)
virDomainFree(dom);
- if (conn != NULL)
- virConnectClose(conn);
+ virConnectClose(conn);
out:
return ret;
ret->chainPriority = chain_priority;
} else {
/* assign default priority if none can be found via lookup */
- if (!name_prefix ||
- intMapGetByString(chain_priorities, name_prefix, 0,
- &ret->chainPriority) < 0) {
- /* assign default chain priority */
+ if (intMapGetByString(chain_priorities, name_prefix,
+ 0, &ret->chainPriority) < 0) {
ret->chainPriority = (NWFILTER_MAX_FILTER_PRIORITY +
NWFILTER_MIN_FILTER_PRIORITY) / 2;
}
optstr = qemuBuildNVRAMDevStr(def->nvram);
if (!optstr)
return -1;
- if (optstr)
- virCommandAddArg(cmd, optstr);
+ virCommandAddArg(cmd, optstr);
VIR_FREE(optstr);
} else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
goto cleanup;
}
- if (oldbridge) {
- ret = virNetDevBridgeRemovePort(oldbridge, olddev->ifname);
- virDomainAuditNet(vm, olddev, NULL, "detach", ret == 0);
- if (ret < 0) {
- /* warn but continue - possibly the old network
- * had been destroyed and reconstructed, leaving the
- * tap device orphaned.
- */
- VIR_WARN("Unable to detach device %s from bridge %s",
- olddev->ifname, oldbridge);
- }
+ ret = virNetDevBridgeRemovePort(oldbridge, olddev->ifname);
+ virDomainAuditNet(vm, olddev, NULL, "detach", ret == 0);
+ if (ret < 0) {
+ /* warn but continue - possibly the old network
+ * had been destroyed and reconstructed, leaving the
+ * tap device orphaned.
+ */
+ VIR_WARN("Unable to detach device %s from bridge %s",
+ olddev->ifname, oldbridge);
}
ret = virNetDevBridgeAddPort(newbridge, olddev->ifname);
if (!mem_bw_alloc)
return 0;
- if (mem_bw_alloc && !mem_bw_info) {
+ if (!mem_bw_info) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("RDT Memory Bandwidth allocation unsupported"));
return -1;
/* Now that we have a count, collect the list. */
if (from && !priv->useSnapshotOld) {
if (tree) {
- if (count)
- count = virDomainSnapshotListChildrenNames(from, names + 1,
- count - 1, flags);
+ count = virDomainSnapshotListChildrenNames(from, names + 1,
+ count - 1, flags);
if (count >= 0) {
count++;
names[0] = vshStrdup(ctl, fromname);