mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
Remove unnecessary curly brackets in rest of src/[a-n]*/
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
677ddc828a
commit
138c2aee01
@ -54,9 +54,8 @@ static void virAccessDriverStackCleanup(virAccessManagerPtr manager)
|
|||||||
virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager);
|
virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager);
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < priv->managersLen; i++) {
|
for (i = 0; i < priv->managersLen; i++)
|
||||||
virObjectUnref(priv->managers[i]);
|
virObjectUnref(priv->managers[i]);
|
||||||
}
|
|
||||||
VIR_FREE(priv->managers);
|
VIR_FREE(priv->managers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1154,9 +1154,8 @@ bhyveStateInitialize(bool priveleged,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIR_ALLOC(bhyve_driver) < 0) {
|
if (VIR_ALLOC(bhyve_driver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
if (virMutexInit(&bhyve_driver->lock) < 0) {
|
if (virMutexInit(&bhyve_driver->lock) < 0) {
|
||||||
VIR_FREE(bhyve_driver);
|
VIR_FREE(bhyve_driver);
|
||||||
|
@ -450,9 +450,8 @@ virStoragePoolDispose(void *obj)
|
|||||||
virUUIDFormat(pool->uuid, uuidstr);
|
virUUIDFormat(pool->uuid, uuidstr);
|
||||||
VIR_DEBUG("release pool %p %s %s", pool, pool->name, uuidstr);
|
VIR_DEBUG("release pool %p %s %s", pool, pool->name, uuidstr);
|
||||||
|
|
||||||
if (pool->privateDataFreeFunc) {
|
if (pool->privateDataFreeFunc)
|
||||||
pool->privateDataFreeFunc(pool->privateData);
|
pool->privateDataFreeFunc(pool->privateData);
|
||||||
}
|
|
||||||
|
|
||||||
VIR_FREE(pool->name);
|
VIR_FREE(pool->name);
|
||||||
virObjectUnref(pool->conn);
|
virObjectUnref(pool->conn);
|
||||||
@ -525,9 +524,8 @@ virStorageVolDispose(void *obj)
|
|||||||
virStorageVolPtr vol = obj;
|
virStorageVolPtr vol = obj;
|
||||||
VIR_DEBUG("release vol %p %s", vol, vol->name);
|
VIR_DEBUG("release vol %p %s", vol, vol->name);
|
||||||
|
|
||||||
if (vol->privateDataFreeFunc) {
|
if (vol->privateDataFreeFunc)
|
||||||
vol->privateDataFreeFunc(vol->privateData);
|
vol->privateDataFreeFunc(vol->privateData);
|
||||||
}
|
|
||||||
|
|
||||||
VIR_FREE(vol->key);
|
VIR_FREE(vol->key);
|
||||||
VIR_FREE(vol->name);
|
VIR_FREE(vol->name);
|
||||||
|
@ -85,9 +85,8 @@ virDriverLoadModule(const char *name)
|
|||||||
*tmp = c_toupper(*tmp);
|
*tmp = c_toupper(*tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virAsprintfQuiet(®func, "%sRegister", fixedname) < 0) {
|
if (virAsprintfQuiet(®func, "%sRegister", fixedname) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
|
|
||||||
regsym = dlsym(handle, regfunc);
|
regsym = dlsym(handle, regfunc);
|
||||||
if (!regsym) {
|
if (!regsym) {
|
||||||
|
@ -845,9 +845,8 @@ udevGetIfaceDefBond(struct udev *udev,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
for (i = 0; slave_count != -1 && i < slave_count; i++) {
|
for (i = 0; slave_count != -1 && i < slave_count; i++)
|
||||||
VIR_FREE(slave_list[i]);
|
VIR_FREE(slave_list[i]);
|
||||||
}
|
|
||||||
VIR_FREE(slave_list);
|
VIR_FREE(slave_list);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -952,9 +951,8 @@ udevGetIfaceDefBridge(struct udev *udev,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
for (i = 0; member_count != -1 && i < member_count; i++) {
|
for (i = 0; member_count != -1 && i < member_count; i++)
|
||||||
VIR_FREE(member_list[i]);
|
VIR_FREE(member_list[i]);
|
||||||
}
|
|
||||||
VIR_FREE(member_list);
|
VIR_FREE(member_list);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -1102,15 +1100,13 @@ udevGetIfaceDef(struct udev *udev, const char *name)
|
|||||||
* to prevent false positives
|
* to prevent false positives
|
||||||
*/
|
*/
|
||||||
vlan_parent_dev = strrchr(name, '.');
|
vlan_parent_dev = strrchr(name, '.');
|
||||||
if (vlan_parent_dev) {
|
if (vlan_parent_dev)
|
||||||
ifacedef->type = VIR_INTERFACE_TYPE_VLAN;
|
ifacedef->type = VIR_INTERFACE_TYPE_VLAN;
|
||||||
}
|
|
||||||
|
|
||||||
/* Fallback check to see if this is a bond device */
|
/* Fallback check to see if this is a bond device */
|
||||||
if (udev_device_get_sysattr_value(dev, "bonding/mode")) {
|
if (udev_device_get_sysattr_value(dev, "bonding/mode"))
|
||||||
ifacedef->type = VIR_INTERFACE_TYPE_BOND;
|
ifacedef->type = VIR_INTERFACE_TYPE_BOND;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
switch (ifacedef->type) {
|
switch (ifacedef->type) {
|
||||||
case VIR_INTERFACE_TYPE_VLAN:
|
case VIR_INTERFACE_TYPE_VLAN:
|
||||||
|
@ -145,9 +145,8 @@ virDomainLxcEnterNamespace(virDomainPtr domain,
|
|||||||
|
|
||||||
if (virProcessSetNamespaces(nfdlist, fdlist) < 0) {
|
if (virProcessSetNamespaces(nfdlist, fdlist) < 0) {
|
||||||
if (oldfdlist && noldfdlist) {
|
if (oldfdlist && noldfdlist) {
|
||||||
for (i = 0; i < *noldfdlist; i++) {
|
for (i = 0; i < *noldfdlist; i++)
|
||||||
VIR_FORCE_CLOSE((*oldfdlist)[i]);
|
VIR_FORCE_CLOSE((*oldfdlist)[i]);
|
||||||
}
|
|
||||||
VIR_FREE(*oldfdlist);
|
VIR_FREE(*oldfdlist);
|
||||||
*noldfdlist = 0;
|
*noldfdlist = 0;
|
||||||
}
|
}
|
||||||
|
@ -741,9 +741,8 @@ virNodeDeviceDestroy(virNodeDevicePtr dev)
|
|||||||
if (dev->conn->nodeDeviceDriver &&
|
if (dev->conn->nodeDeviceDriver &&
|
||||||
dev->conn->nodeDeviceDriver->nodeDeviceDestroy) {
|
dev->conn->nodeDeviceDriver->nodeDeviceDestroy) {
|
||||||
int retval = dev->conn->nodeDeviceDriver->nodeDeviceDestroy(dev);
|
int retval = dev->conn->nodeDeviceDriver->nodeDeviceDestroy(dev);
|
||||||
if (retval < 0) {
|
if (retval < 0)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1746,9 +1746,8 @@ virStorageVolWipe(virStorageVolPtr vol,
|
|||||||
if (conn->storageDriver && conn->storageDriver->storageVolWipe) {
|
if (conn->storageDriver && conn->storageDriver->storageVolWipe) {
|
||||||
int ret;
|
int ret;
|
||||||
ret = conn->storageDriver->storageVolWipe(vol, flags);
|
ret = conn->storageDriver->storageVolWipe(vol, flags);
|
||||||
if (ret < 0) {
|
if (ret < 0)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1789,9 +1788,8 @@ virStorageVolWipePattern(virStorageVolPtr vol,
|
|||||||
if (conn->storageDriver && conn->storageDriver->storageVolWipePattern) {
|
if (conn->storageDriver && conn->storageDriver->storageVolWipePattern) {
|
||||||
int ret;
|
int ret;
|
||||||
ret = conn->storageDriver->storageVolWipePattern(vol, algorithm, flags);
|
ret = conn->storageDriver->storageVolWipePattern(vol, algorithm, flags);
|
||||||
if (ret < 0) {
|
if (ret < 0)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,9 +246,8 @@ libxlDriverShouldLoad(bool privileged)
|
|||||||
* xenfs to /proc/xen.
|
* xenfs to /proc/xen.
|
||||||
*/
|
*/
|
||||||
status = virFileReadAll(HYPERVISOR_CAPABILITIES, 10, &output);
|
status = virFileReadAll(HYPERVISOR_CAPABILITIES, 10, &output);
|
||||||
if (status >= 0) {
|
if (status >= 0)
|
||||||
status = strncmp(output, "control_d", 9);
|
status = strncmp(output, "control_d", 9);
|
||||||
}
|
|
||||||
VIR_FREE(output);
|
VIR_FREE(output);
|
||||||
if (status) {
|
if (status) {
|
||||||
VIR_INFO("No Xen capabilities detected, probably not running "
|
VIR_INFO("No Xen capabilities detected, probably not running "
|
||||||
@ -1792,9 +1791,8 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(flags & VIR_DOMAIN_VCPU_MAXIMUM) && vm->def->maxvcpus < max) {
|
if (!(flags & VIR_DOMAIN_VCPU_MAXIMUM) && vm->def->maxvcpus < max)
|
||||||
max = vm->def->maxvcpus;
|
max = vm->def->maxvcpus;
|
||||||
}
|
|
||||||
|
|
||||||
if (nvcpus > max) {
|
if (nvcpus > max) {
|
||||||
virReportError(VIR_ERR_INVALID_ARG,
|
virReportError(VIR_ERR_INVALID_ARG,
|
||||||
@ -1964,9 +1962,8 @@ libxlDomainPinVcpuFlags(virDomainPtr dom, unsigned int vcpu,
|
|||||||
&flags, &targetDef) < 0)
|
&flags, &targetDef) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
|
if (flags & VIR_DOMAIN_AFFECT_LIVE)
|
||||||
targetDef = vm->def;
|
targetDef = vm->def;
|
||||||
}
|
|
||||||
|
|
||||||
/* Make sure coverity knows targetDef is valid at this point. */
|
/* Make sure coverity knows targetDef is valid at this point. */
|
||||||
sa_assert(targetDef);
|
sa_assert(targetDef);
|
||||||
@ -2066,9 +2063,8 @@ libxlDomainGetVcpuPinInfo(virDomainPtr dom, int ncpumaps,
|
|||||||
&flags, &targetDef) < 0)
|
&flags, &targetDef) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
|
if (flags & VIR_DOMAIN_AFFECT_LIVE)
|
||||||
targetDef = vm->def;
|
targetDef = vm->def;
|
||||||
}
|
|
||||||
|
|
||||||
/* Make sure coverity knows targetDef is valid at this point. */
|
/* Make sure coverity knows targetDef is valid at this point. */
|
||||||
sa_assert(targetDef);
|
sa_assert(targetDef);
|
||||||
|
@ -1160,9 +1160,8 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
c = getopt_long(argc, argv, "ldf:p:t:vVh", opts, &optidx);
|
c = getopt_long(argc, argv, "ldf:p:t:vVh", opts, &optidx);
|
||||||
|
|
||||||
if (c == -1) {
|
if (c == -1)
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -1008,9 +1008,8 @@ static int virLockManagerSanlockAcquire(virLockManagerPtr lock,
|
|||||||
VIR_DEBUG("Acquire completed fd=%d", sock);
|
VIR_DEBUG("Acquire completed fd=%d", sock);
|
||||||
|
|
||||||
if (res_free) {
|
if (res_free) {
|
||||||
for (i = 0; i < res_count; i++) {
|
for (i = 0; i < res_count; i++)
|
||||||
VIR_FREE(res_args[i]);
|
VIR_FREE(res_args[i]);
|
||||||
}
|
|
||||||
VIR_FREE(res_args);
|
VIR_FREE(res_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1021,9 +1020,8 @@ static int virLockManagerSanlockAcquire(virLockManagerPtr lock,
|
|||||||
|
|
||||||
error:
|
error:
|
||||||
if (res_free) {
|
if (res_free) {
|
||||||
for (i = 0; i < res_count; i++) {
|
for (i = 0; i < res_count; i++)
|
||||||
VIR_FREE(res_args[i]);
|
VIR_FREE(res_args[i]);
|
||||||
}
|
|
||||||
VIR_FREE(res_args);
|
VIR_FREE(res_args);
|
||||||
}
|
}
|
||||||
VIR_FREE(opt);
|
VIR_FREE(opt);
|
||||||
|
@ -396,9 +396,8 @@ int lxcContainerSendContinue(int control)
|
|||||||
|
|
||||||
VIR_DEBUG("Send continue on fd %d", control);
|
VIR_DEBUG("Send continue on fd %d", control);
|
||||||
writeCount = safewrite(control, &msg, sizeof(msg));
|
writeCount = safewrite(control, &msg, sizeof(msg));
|
||||||
if (writeCount != sizeof(msg)) {
|
if (writeCount != sizeof(msg))
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
|
||||||
|
|
||||||
rc = 0;
|
rc = 0;
|
||||||
error_out:
|
error_out:
|
||||||
@ -858,14 +857,12 @@ static int lxcContainerMountBasicFS(bool userns_enabled,
|
|||||||
*/
|
*/
|
||||||
if (userns_enabled && netns_disabled &&
|
if (userns_enabled && netns_disabled &&
|
||||||
STREQ(mnt->src, "sysfs")) {
|
STREQ(mnt->src, "sysfs")) {
|
||||||
if (VIR_STRDUP(mnt_src, "/sys") < 0) {
|
if (VIR_STRDUP(mnt_src, "/sys") < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
mnt_mflags = MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY|MS_BIND;
|
mnt_mflags = MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY|MS_BIND;
|
||||||
} else {
|
} else {
|
||||||
if (VIR_STRDUP(mnt_src, mnt->src) < 0) {
|
if (VIR_STRDUP(mnt_src, mnt->src) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
mnt_mflags = mnt->mflags;
|
mnt_mflags = mnt->mflags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1586,9 +1586,8 @@ static int lxcStateInitialize(bool privileged,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIR_ALLOC(lxc_driver) < 0) {
|
if (VIR_ALLOC(lxc_driver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
if (virMutexInit(&lxc_driver->lock) < 0) {
|
if (virMutexInit(&lxc_driver->lock) < 0) {
|
||||||
VIR_FREE(lxc_driver);
|
VIR_FREE(lxc_driver);
|
||||||
return -1;
|
return -1;
|
||||||
@ -1972,9 +1971,8 @@ lxcDomainSetSchedulerParametersFlags(virDomainPtr dom,
|
|||||||
vm->def->cputune.period = params[i].value.ul;
|
vm->def->cputune.period = params[i].value.ul;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
if (flags & VIR_DOMAIN_AFFECT_CONFIG)
|
||||||
vmdef->cputune.period = params[i].value.ul;
|
vmdef->cputune.period = params[i].value.ul;
|
||||||
}
|
|
||||||
} else if (STREQ(param->field, VIR_DOMAIN_SCHEDULER_VCPU_QUOTA)) {
|
} else if (STREQ(param->field, VIR_DOMAIN_SCHEDULER_VCPU_QUOTA)) {
|
||||||
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
|
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
|
||||||
rc = lxcSetVcpuBWLive(priv->cgroup, 0, params[i].value.l);
|
rc = lxcSetVcpuBWLive(priv->cgroup, 0, params[i].value.l);
|
||||||
@ -1985,11 +1983,10 @@ lxcDomainSetSchedulerParametersFlags(virDomainPtr dom,
|
|||||||
vm->def->cputune.quota = params[i].value.l;
|
vm->def->cputune.quota = params[i].value.l;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
if (flags & VIR_DOMAIN_AFFECT_CONFIG)
|
||||||
vmdef->cputune.quota = params[i].value.l;
|
vmdef->cputune.quota = params[i].value.l;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
|
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -536,9 +536,8 @@ static void virLXCProcessMonitorEOFNotify(virLXCMonitorPtr mon,
|
|||||||
|
|
||||||
if (vm)
|
if (vm)
|
||||||
virObjectUnlock(vm);
|
virObjectUnlock(vm);
|
||||||
if (event) {
|
if (event)
|
||||||
virObjectEventStateQueue(driver->domainEventState, event);
|
virObjectEventStateQueue(driver->domainEventState, event);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void virLXCProcessMonitorExitNotify(virLXCMonitorPtr mon ATTRIBUTE_UNUSED,
|
static void virLXCProcessMonitorExitNotify(virLXCMonitorPtr mon ATTRIBUTE_UNUSED,
|
||||||
@ -826,9 +825,8 @@ virLXCProcessBuildControllerCmd(virLXCDriverPtr driver,
|
|||||||
virCommandAddArgFormat(cmd, "%d", handshakefd);
|
virCommandAddArgFormat(cmd, "%d", handshakefd);
|
||||||
virCommandAddArg(cmd, "--background");
|
virCommandAddArg(cmd, "--background");
|
||||||
|
|
||||||
for (i = 0; i < nveths; i++) {
|
for (i = 0; i < nveths; i++)
|
||||||
virCommandAddArgList(cmd, "--veth", veths[i], NULL);
|
virCommandAddArgList(cmd, "--veth", veths[i], NULL);
|
||||||
}
|
|
||||||
|
|
||||||
virCommandPassFD(cmd, handshakefd, 0);
|
virCommandPassFD(cmd, handshakefd, 0);
|
||||||
|
|
||||||
|
@ -1340,9 +1340,8 @@ networkStartDhcpDaemon(virNetworkObjPtr network)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = virCommandRun(cmd, NULL);
|
ret = virCommandRun(cmd, NULL);
|
||||||
if (ret < 0) {
|
if (ret < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* There really is no race here - when dnsmasq daemonizes, its
|
* There really is no race here - when dnsmasq daemonizes, its
|
||||||
@ -2016,10 +2015,9 @@ networkStartNetworkVirtual(virNetworkObjPtr network)
|
|||||||
v6present = true;
|
v6present = true;
|
||||||
|
|
||||||
/* Add the IP address/netmask to the bridge */
|
/* Add the IP address/netmask to the bridge */
|
||||||
if (networkAddAddrToBridge(network, ipdef) < 0) {
|
if (networkAddAddrToBridge(network, ipdef) < 0)
|
||||||
goto err2;
|
goto err2;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Bring up the bridge interface */
|
/* Bring up the bridge interface */
|
||||||
if (virNetDevSetOnline(network->def->bridge, 1) < 0)
|
if (virNetDevSetOnline(network->def->bridge, 1) < 0)
|
||||||
|
@ -74,9 +74,8 @@ int networkCheckRouteCollision(virNetworkDefPtr def)
|
|||||||
|
|
||||||
/* NUL-terminate the line, so sscanf doesn't go beyond a newline. */
|
/* NUL-terminate the line, so sscanf doesn't go beyond a newline. */
|
||||||
char *nl = strchr(cur, '\n');
|
char *nl = strchr(cur, '\n');
|
||||||
if (nl) {
|
if (nl)
|
||||||
*nl++ = '\0';
|
*nl++ = '\0';
|
||||||
}
|
|
||||||
|
|
||||||
num = sscanf(cur, "%16s %127s %*s %*s %*s %*s %*s %127s",
|
num = sscanf(cur, "%16s %127s %*s %*s %*s %*s %*s %127s",
|
||||||
iface, dest, mask);
|
iface, dest, mask);
|
||||||
|
@ -315,9 +315,8 @@ virNWFilterSnoopActivate(virNWFilterSnoopReqPtr req)
|
|||||||
|
|
||||||
virNWFilterSnoopActiveLock();
|
virNWFilterSnoopActiveLock();
|
||||||
|
|
||||||
if (virHashAddEntry(virNWFilterSnoopState.active, key, (void *)0x1) < 0) {
|
if (virHashAddEntry(virNWFilterSnoopState.active, key, (void *)0x1) < 0)
|
||||||
VIR_FREE(key);
|
VIR_FREE(key);
|
||||||
}
|
|
||||||
|
|
||||||
virNWFilterSnoopActiveUnlock();
|
virNWFilterSnoopActiveUnlock();
|
||||||
|
|
||||||
|
@ -3084,14 +3084,12 @@ virNWFilterRuleInstSort(const void *a, const void *b)
|
|||||||
/* ensure root chain commands appear before all others since
|
/* ensure root chain commands appear before all others since
|
||||||
we will need them to create the child chains */
|
we will need them to create the child chains */
|
||||||
if (root_a) {
|
if (root_a) {
|
||||||
if (root_b) {
|
if (root_b)
|
||||||
goto normal;
|
goto normal;
|
||||||
}
|
|
||||||
return -1; /* a before b */
|
return -1; /* a before b */
|
||||||
}
|
}
|
||||||
if (root_b) {
|
if (root_b)
|
||||||
return 1; /* b before a */
|
return 1; /* b before a */
|
||||||
}
|
|
||||||
normal:
|
normal:
|
||||||
/* priorities are limited to range [-1000, 1000] */
|
/* priorities are limited to range [-1000, 1000] */
|
||||||
return insta->priority - instb->priority;
|
return insta->priority - instb->priority;
|
||||||
@ -3165,10 +3163,9 @@ ebtablesGetProtoIdxByFiltername(const char *filtername)
|
|||||||
enum l3_proto_idx idx;
|
enum l3_proto_idx idx;
|
||||||
|
|
||||||
for (idx = 0; idx < L3_PROTO_LAST_IDX; idx++) {
|
for (idx = 0; idx < L3_PROTO_LAST_IDX; idx++) {
|
||||||
if (STRPREFIX(filtername, l3_protocols[idx].val)) {
|
if (STRPREFIX(filtername, l3_protocols[idx].val))
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -3303,9 +3300,8 @@ ebtablesGetSubChainInsts(virHashTablePtr chains,
|
|||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(filter_names);
|
VIR_FREE(filter_names);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
for (i = 0; i < *ninsts; i++) {
|
for (i = 0; i < *ninsts; i++)
|
||||||
VIR_FREE(*insts[i]);
|
VIR_FREE(*insts[i]);
|
||||||
}
|
|
||||||
VIR_FREE(*insts);
|
VIR_FREE(*insts);
|
||||||
*ninsts = 0;
|
*ninsts = 0;
|
||||||
}
|
}
|
||||||
|
@ -567,9 +567,8 @@ virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter,
|
|||||||
|
|
||||||
switch (useNewFilter) {
|
switch (useNewFilter) {
|
||||||
case INSTANTIATE_FOLLOW_NEWFILTER:
|
case INSTANTIATE_FOLLOW_NEWFILTER:
|
||||||
if (obj->newDef) {
|
if (obj->newDef)
|
||||||
next_filter = obj->newDef;
|
next_filter = obj->newDef;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case INSTANTIATE_ALWAYS:
|
case INSTANTIATE_ALWAYS:
|
||||||
break;
|
break;
|
||||||
@ -1139,15 +1138,13 @@ virNWFilterDomainFWUpdateCB(virDomainObjPtr obj,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case STEP_TEAR_NEW:
|
case STEP_TEAR_NEW:
|
||||||
if (!virHashLookup(cb->skipInterfaces, net->ifname)) {
|
if (!virHashLookup(cb->skipInterfaces, net->ifname))
|
||||||
ret = virNWFilterRollbackUpdateFilter(net);
|
ret = virNWFilterRollbackUpdateFilter(net);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STEP_TEAR_OLD:
|
case STEP_TEAR_OLD:
|
||||||
if (!virHashLookup(cb->skipInterfaces, net->ifname)) {
|
if (!virHashLookup(cb->skipInterfaces, net->ifname))
|
||||||
ret = virNWFilterTearOldFilter(net);
|
ret = virNWFilterTearOldFilter(net);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STEP_APPLY_CURRENT:
|
case STEP_APPLY_CURRENT:
|
||||||
|
@ -797,9 +797,8 @@ virNWFilterLearnInit(void)
|
|||||||
threadsTerminate = false;
|
threadsTerminate = false;
|
||||||
|
|
||||||
pendingLearnReq = virHashCreate(0, freeLearnReqEntry);
|
pendingLearnReq = virHashCreate(0, freeLearnReqEntry);
|
||||||
if (!pendingLearnReq) {
|
if (!pendingLearnReq)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
ifaceLockMap = virHashCreate(0, virHashValueFree);
|
ifaceLockMap = virHashCreate(0, virHashValueFree);
|
||||||
if (!ifaceLockMap) {
|
if (!ifaceLockMap) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user