}
}
-cleanup:
+ cleanup:
return fd;
}
ret = 0;
-cleanup:
+ cleanup:
if (VIR_CLOSE(fd) < 0 &&
ret == 0) {
virReportSystemError(errno, _("Unable to close %s"), path);
return 0;
-error:
+ error:
err = virGetLastError();
if (err) {
fprintf(stderr, "%s: %s\n", program_name, err->message);
VIR_FREE(*path);
-done:
+ done:
ret = 0;
VIR_DEBUG("Using auth file '%s'", NULLSTR(*path));
-cleanup:
+ cleanup:
VIR_FREE(userdir);
return ret;
ret = 0;
-cleanup:
+ cleanup:
virAuthConfigFree(config);
return ret;
}
return auth;
-error:
+ error:
virAuthConfigFree(auth);
return NULL;
}
return auth;
-error:
+ error:
virAuthConfigFree(auth);
return NULL;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(authgroup);
VIR_FREE(credgroup);
return ret;
return virBitmapCountBits(*bitmap);
-error:
+ error:
virReportError(VIR_ERR_INVALID_ARG,
_("Failed to parse bitmap '%s'"), str);
virBitmapFree(*bitmap);
goto cleanup;
}
-cleanup:
+ cleanup:
VIR_FREE(line);
VIR_FORCE_FCLOSE(fp);
return ret;
return 0;
-error:
+ error:
VIR_FORCE_FCLOSE(mounts);
return -1;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(procfile);
VIR_FORCE_FCLOSE(mapping);
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(keypath);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(keypath);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(strval);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(strval);
return ret;
}
VIR_DEBUG("Done making controllers for group");
ret = 0;
-cleanup:
+ cleanup:
return ret;
}
return 0;
-error:
+ error:
virCgroupFree(group);
*group = NULL;
}
ret = 0;
-cleanup:
+ cleanup:
return ret;
}
}
}
-cleanup:
+ cleanup:
VIR_FREE(str);
return rc;
}
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(content);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
virStringFreeList(tokens);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
if (ret != 0)
virCgroupFree(group);
virCgroupFree(&parent);
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(grpname);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(name);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
return ret;
}
}
}
-done:
+ done:
ret = 0;
-cleanup:
+ cleanup:
virCgroupFree(&parent);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(str2);
VIR_FREE(str1);
return ret;
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(str3);
VIR_FREE(str2);
VIR_FREE(str1);
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(devstr);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(devstr);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(devstr);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(devstr);
return ret;
}
rv = nparams;
-cleanup:
+ cleanup:
VIR_FREE(buf);
return rv;
}
done:
ret = killedAny ? 1 : 0;
-cleanup:
+ cleanup:
VIR_FREE(keypath);
VIR_FORCE_FCLOSE(fp);
done:
ret = killedAny ? 1 : 0;
-cleanup:
+ cleanup:
virCgroupFree(&subgroup);
closedir(dp);
*sys *= scale;
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(str);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(root);
VIR_FREE(opts);
return ret;
ret = virFileExists(path);
-cleanup:
+ cleanup:
VIR_FREE(path);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
virObjectUnlock(closeCallbacks);
return ret;
}
}
ret = virHashRemoveEntry(closeCallbacks->list, uuidstr);
-cleanup:
+ cleanup:
virObjectUnlock(closeCallbacks);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
if (cmd->outbuf && *cmd->outbuf)
(*cmd->outbuf)[outlen] = '\0';
if (cmd->errbuf && *cmd->errbuf)
}
}
-cleanup:
+ cleanup:
if (ret < 0) {
VIR_FORCE_CLOSE(cmd->infd);
VIR_FORCE_CLOSE(cmd->inpipe);
}
ret = 0;
-cleanup:
+ cleanup:
virStringFreeList(lines);
VIR_FREE(outbuf);
if (groups) {
return ctxt.conf;
-error:
+ error:
virConfFree(ctxt.conf);
return NULL;
}
ret = 0;
-cleanup:
+ cleanup:
while (nstack > 0) {
DBusMessageIter *thisiter = iter;
VIR_DEBUG("Popping iter=%p", iter);
ret = 0;
-cleanup:
+ cleanup:
virDBusTypeStackFree(&stack, &nstack);
VIR_FREE(contsig);
VIR_FREE(newiter);
ret = virDBusMessageIterDecode(&iter, types, args);
-cleanup:
+ cleanup:
return ret;
}
dnsmasqCapsGet(caps, DNSMASQ_CAPS_BIND_DYNAMIC) ? "" : "NOT ");
return 0;
-fail:
+ fail:
p = strchrnul(buf, '\n');
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse %s version number in '%.*s'"),
ret = dnsmasqCapsSetFromBuffer(caps, buf);
-cleanup:
+ cleanup:
VIR_FREE(buf);
return ret;
}
ret = dnsmasqCapsSetFromBuffer(caps, complete);
-cleanup:
+ cleanup:
virCommandFree(cmd);
VIR_FREE(help);
VIR_FREE(version);
goto error;
return caps;
-error:
+ error:
virObjectUnref(caps);
return NULL;
}
virResetError(err);
ret = virCopyError(newerr, err);
-cleanup:
+ cleanup:
errno = saved_errno;
return ret;
}
VIR_FREE(fds);
return 0;
-error:
+ error:
virMutexUnlock(&eventLoop.lock);
-error_unlocked:
+ error_unlocked:
VIR_FREE(fds);
return -1;
}
*fd = pipefd[output];
return ret;
-error:
+ error:
VIR_FORCE_CLOSE(pipefd[0]);
VIR_FORCE_CLOSE(pipefd[1]);
virFileWrapperFdFree(ret);
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
if (newfile) {
unlink(newfile);
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to find a free loop device in /dev"));
-cleanup:
+ cleanup:
if (fd != -1) {
VIR_DEBUG("Got free loop device %s %d", looppath, fd);
*dev_name = looppath;
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(loname);
VIR_FORCE_CLOSE(fsfd);
if (ret == -1)
}
ret = 1;
-cleanup:
+ cleanup:
VIR_FREE(path);
return ret;
}
virReportSystemError(EBUSY, "%s",
_("No free NBD devices"));
-cleanup:
+ cleanup:
closedir(dh);
return ret;
}
nbddev = NULL;
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(nbddev);
VIR_FREE(qemunbd);
virCommandFree(cmd);
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(filepath);
closedir(dh);
return ret;
if (!ret)
errno = ENOENT;
-cleanup:
+ cleanup:
endmntent(f);
return ret;
*nmountsret = nmounts ? nmounts - 1 : 0;
ret = 0;
-cleanup:
+ cleanup:
if (ret < 0)
virStringFreeList(mounts);
endmntent(procmnt);
if (access(path, mode) < 0)
ret = errno;
-childerror:
+ childerror:
if ((ret & 0xFF) != ret) {
VIR_WARN("unable to pass desired return value %d", ret);
ret = 0xFF;
/* File is successfully opened */
return fd;
-error:
+ error:
if (fd >= 0) {
/* some other failure after the open succeeded */
VIR_FORCE_CLOSE(fd);
path, mode);
goto error;
}
-error:
+ error:
return ret;
}
* some cases */
return virDirCreateNoFork(path, mode, uid, gid, flags);
}
-parenterror:
+ parenterror:
return ret;
}
path, mode);
goto childerror;
}
-childerror:
+ childerror:
_exit(ret);
}
ret = virFileMakePathHelper(tmp, mode);
-cleanup:
+ cleanup:
VIR_FREE(tmp);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
if (ret != 0)
VIR_FORCE_CLOSE(*ttymaster);
VIR_FORCE_CLOSE(slave);
VIR_FREE(str);
-cleanup:
+ cleanup:
va_end(vargs);
return ret;
return hostdevMgr;
-error:
+ error:
virObjectUnref(hostdevMgr);
return NULL;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(sysfs_path);
return ret;
&hostdev->parent.data.net->mac,
vlanid, stateDir);
}
-cleanup:
+ cleanup:
VIR_FREE(linkdev);
return ret;
}
ret = 0;
goto cleanup;
-inactivedevs:
+ inactivedevs:
/* Only steal all the devices from activePCIHostdevs. We will
* free them in virObjectUnref().
*/
virPCIDeviceListSteal(hostdev_mgr->activePCIHostdevs, dev);
}
-resetvfnetconfig:
+ resetvfnetconfig:
for (i = 0;
last_processed_hostdev_vf != -1 && i < last_processed_hostdev_vf; i++)
virHostdevNetConfigRestore(hostdevs[i], hostdev_mgr->stateDir, NULL);
-reattachdevs:
+ reattachdevs:
for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) {
virPCIDevicePtr dev = virPCIDeviceListGet(pcidevs, i);
NULL));
}
-cleanup:
+ cleanup:
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
virObjectUnref(pcidevs);
}
virObjectUnref(pcidevs);
-cleanup:
+ cleanup:
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
}
}
ret = 0;
-cleanup:
+ cleanup:
virPCIDeviceFree(dev);
virObjectUnlock(mgr->activePCIHostdevs);
virObjectUnlock(mgr->inactivePCIHostdevs);
}
}
ret = 0;
-cleanup:
+ cleanup:
virObjectUnlock(mgr->activeUSBHostdevs);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
virObjectUnlock(mgr->activeSCSIHostdevs);
return ret;
}
virObjectUnlock(mgr->activeUSBHostdevs);
return 0;
-error:
+ error:
for (j = 0; j < i; j++) {
tmp = virUSBDeviceListGet(list, i);
virUSBDeviceListSteal(mgr->activeUSBHostdevs, tmp);
return -1;
}
-out:
+ out:
if (!*usb)
hostdev->missing = true;
return 0;
ret = 0;
-cleanup:
+ cleanup:
virObjectUnref(list);
return ret;
}
virObjectUnref(list);
return 0;
-error:
+ error:
for (j = 0; j < i; j++) {
tmp = virSCSIDeviceListGet(list, i);
virSCSIDeviceListSteal(hostdev_mgr->activeSCSIHostdevs, tmp);
}
virObjectUnlock(hostdev_mgr->activeSCSIHostdevs);
-cleanup:
+ cleanup:
virObjectUnref(list);
return -1;
}
}
ret = 0;
-out:
+ out:
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
return ret;
goto out;
ret = 0;
-out:
+ out:
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
return ret;
goto out;
ret = 0;
-out:
+ out:
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
return ret;
processtime) < 0)
goto error;
-cleanup:
+ cleanup:
VIR_FREE(username);
VIR_FREE(userid);
VIR_FREE(groupname);
VIR_FREE(processtime);
return ret;
-error:
+ error:
virObjectUnref(ret);
ret = NULL;
goto cleanup;
ret = 0;
-cleanup:
+ cleanup:
return ret;
}
}
ret = true;
-cleanup:
+ cleanup:
return ret;
}
ret = 1;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
}
ret = virCommandRun(cmd, NULL);
-cleanup:
+ cleanup:
virCommandFree(cmd);
VIR_FREE(networkstr);
VIR_FREE(addrStartStr);
virCommandAddArgList(cmd, "--source", networkstr,
"--destination", destaddr, "--jump", "RETURN", NULL);
ret = virCommandRun(cmd, NULL);
-cleanup:
+ cleanup:
virCommandFree(cmd);
VIR_FREE(networkstr);
return ret;
goto cleanup;
}
-cleanup:
+ cleanup:
virCommandFree(cmd);
return cbdata.session;
}
if (virCommandWait(cmd, NULL) < 0)
ret = IQN_ERROR;
-out:
+ out:
if (ret == IQN_MISSING) {
VIR_DEBUG("Could not find interface with IQN '%s'", iqn);
}
ret = 0;
-cleanup:
+ cleanup:
virCommandFree(cmd);
VIR_FREE(temp_ifacename);
if (ret != 0)
ret = 0;
-cleanup:
+ cleanup:
virCommandFree(cmd);
VIR_FREE(ifacename);
}
ret = 0;
-cleanup:
+ cleanup:
virCommandFree(cmd);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
virCommandFree(cmd);
return ret;
}
ret = parser.head;
}
-cleanup:
+ cleanup:
yajl_free(hand);
if (parser.nstate) {
ignore_value(VIR_STRDUP(ret, (const char *)str));
-cleanup:
+ cleanup:
yajl_gen_free(g);
VIR_DEBUG("result=%s", NULLSTR(ret));
goto cleanup;
ret = 0;
-cleanup:
+ cleanup:
if (ret != 0) {
virHashFree(ctxt->group);
ctxt->group = NULL;
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(key);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(ctxt.groupname);
return ret;
}
return conf;
-error:
+ error:
virKeyFileFree(conf);
return NULL;
}
ret = 0;
-cleanup:
+ cleanup:
virCommandFree(cmd);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
virCommandFree(cmd);
return ret;
}
if (strstr(outbuf, drvblklst))
retval = true;
-cleanup:
+ cleanup:
VIR_FREE(drvblklst);
VIR_FREE(outbuf);
return retval;
return res;
-error:
+ error:
virLockSpaceResourceFree(res);
return NULL;
}
return lockspace;
-error:
+ error:
virLockSpaceFree(lockspace);
return NULL;
}
return lockspace;
-error:
+ error:
virLockSpaceFree(lockspace);
return NULL;
}
virMutexUnlock(&lockspace->lock);
return object;
- error:
+ error:
VIR_FREE(pairs);
virJSONValueFree(object);
virMutexUnlock(&lockspace->lock);
ret = 0;
-cleanup:
+ cleanup:
virMutexUnlock(&lockspace->lock);
VIR_FREE(respath);
return ret;
ret = 0;
-cleanup:
+ cleanup:
virMutexUnlock(&lockspace->lock);
VIR_FREE(respath);
return ret;
goto cleanup;
}
-done:
+ done:
ret = 0;
-cleanup:
+ cleanup:
virMutexUnlock(&lockspace->lock);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
virMutexUnlock(&lockspace->lock);
return ret;
}
virMutexUnlock(&lockspace->lock);
return ret;
-error:
+ error:
virMutexUnlock(&lockspace->lock);
return -1;
}
virLogFilters[i].flags = flags;
virLogNbFilters++;
virLogFiltersSerial++;
-cleanup:
+ cleanup:
virLogUnlock();
if (ret < 0)
virReportOOMError();
virLogOutputs[ret].priority = priority;
virLogOutputs[ret].dest = dest;
virLogOutputs[ret].name = ndup;
-cleanup:
+ cleanup:
virLogUnlock();
return ret;
}
}
virLogUnlock();
-cleanup:
+ cleanup:
VIR_FREE(str);
VIR_FREE(msg);
errno = saved_errno;
sendmsg(journalfd, &mh, MSG_NOSIGNAL);
-cleanup:
+ cleanup:
VIR_LOG_CLOSE(buffd);
}
virSkipSpaces(&cur);
}
ret = count;
-cleanup:
+ cleanup:
if (ret == -1)
VIR_WARN("Ignoring invalid log output setting.");
return ret;
virSkipSpaces(&cur);
}
ret = count;
-cleanup:
+ cleanup:
if (ret == -1)
VIR_WARN("Ignoring invalid log filter setting.");
return ret;
ret = 1;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(s);
return ret;
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
ret = ifr.ifr_mtu;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
*online = (ifr.ifr_flags & IFF_UP) ? true : false;
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
# endif
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
goto cleanup;
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(addrstr);
VIR_FREE(bcaststr);
virCommandFree(cmd);
goto cleanup;
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(addrstr);
VIR_FREE(gatewaystr);
virCommandFree(cmd);
goto cleanup;
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(addrstr);
virCommandFree(cmd);
return ret;
memcpy(&addr->data.inet4, &ifr.ifr_addr, addr->len);
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
if (ret < 0) {
VIR_FREE(*vfname);
VIR_FREE(*virt_fns);
ret = virPCIGetVirtualFunctionIndex(pf_sysfs_path, vf_sysfs_path, vf);
-cleanup:
+ cleanup:
if (ret < 0)
VIR_FREE(*pfname);
goto malformed_resp;
}
rc = 0;
-cleanup:
+ cleanup:
nlmsg_free(nl_msg);
VIR_FREE(resp);
return rc;
-malformed_resp:
+ malformed_resp:
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("malformed netlink response message"));
goto cleanup;
-buffer_too_small:
+ buffer_too_small:
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("allocated netlink buffer is too small"));
goto cleanup;
}
rc = 0;
-cleanup:
+ cleanup:
nlmsg_free(nl_msg);
VIR_FREE(resp);
return rc;
-malformed_resp:
+ malformed_resp:
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("malformed netlink response message"));
goto cleanup;
-buffer_too_small:
+ buffer_too_small:
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("allocated netlink buffer is too small"));
goto cleanup;
virReportError(VIR_ERR_INTERNAL_ERROR,
_("couldn't find IFLA_VF_INFO for VF %d "
"in netlink response"), vf);
-cleanup:
+ cleanup:
return rc;
}
ret = virNetDevSetVfConfig(pflinkdev, ifindex, vf, true,
macaddress, vlanid, NULL);
-cleanup:
+ cleanup:
VIR_FREE(path);
VIR_FREE(fileData);
return ret;
&oldmac, vlanid, NULL);
ignore_value(unlink(path));
-cleanup:
+ cleanup:
VIR_FREE(path);
VIR_FREE(fileData);
ret = 0;
-cleanup:
+ cleanup:
virCommandFree(cmd);
VIR_FREE(average);
VIR_FREE(peak);
ret = 0;
-cleanup:
+ cleanup:
if (ret < 0) {
virNetDevBandwidthFree(*dest);
*dest = NULL;
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(mac[1]);
VIR_FREE(mac[0]);
VIR_FREE(ceil);
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(filter_id);
VIR_FREE(qdisc_id);
VIR_FREE(class_id);
ret = 0;
-cleanup:
+ cleanup:
virCommandFree(cmd);
VIR_FREE(rate);
VIR_FREE(ceil);
ret = ioctl(s, SIOCSDRVSPEC, &ifd);
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(s);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(path);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(path);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(s);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(s);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
ret = virNetDevBridgeSet(brname, "forward_delay", MS_TO_JIFFIES(delay),
fd, &ifr);
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
fd, &ifr);
*delayms = JIFFIES_TO_MS(val);
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
ret = virNetDevBridgeSet(brname, "stp_state", enable ? 1 : 0,
fd, &ifr);
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
fd, &ifr);
*enabled = val ? true : false;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
}
rc = 0;
-cleanup:
+ cleanup:
nlmsg_free(nl_msg);
VIR_FREE(resp);
return rc;
-malformed_resp:
+ malformed_resp:
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("malformed netlink response message"));
goto cleanup;
-buffer_too_small:
+ buffer_too_small:
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("allocated netlink buffer is too small"));
goto cleanup;
}
rc = 0;
-cleanup:
+ cleanup:
nlmsg_free(nl_msg);
VIR_FREE(resp);
return rc;
-malformed_resp:
+ malformed_resp:
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("malformed netlink response message"));
goto cleanup;
-buffer_too_small:
+ buffer_too_small:
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("allocated netlink buffer is too small"));
goto cleanup;
return 0;
-error:
+ error:
virNetlinkCallbackDataFree(calld);
return -1;
}
if (rc < 0)
return -1;
} else {
-create_name:
+ create_name:
retries = 5;
if (virNetDevMacVLanCreateMutexInitialize() < 0)
return -1;
return rc;
-disassociate_exit:
+ disassociate_exit:
ignore_value(virNetDevVPortProfileDisassociate(cr_ifname,
virtPortProfile,
macaddress,
vf,
vmOp));
-link_del_exit:
+ link_del_exit:
ignore_value(virNetDevMacVLanDelete(cr_ifname));
return rc;
vmuuid,
vmOp, true));
-error:
+ error:
return rc;
}
}
ret = 0;
-cleanup:
+ cleanup:
virBufferFreeAndReset(&buf);
VIR_FREE(attachedmac_ex_id);
VIR_FREE(ifaceid_ex_id);
}
ret = 0;
-cleanup:
+ cleanup:
virCommandFree(cmd);
return ret;
}
/* Wipeout the newline */
(*migrate)[strlen(*migrate) - 1] = '\0';
ret = 0;
-cleanup:
+ cleanup:
virCommandFree(cmd);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
virCommandFree(cmd);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
if (ret < 0) {
VIR_FORCE_CLOSE(fd);
while (i--)
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(s);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(s);
return ret;
}
return 0;
-error:
+ error:
for (i = 0; i < tapfdSize && tapfd[i] >= 0; i++)
VIR_FORCE_CLOSE(tapfd[i]);
_("Failed to allocate free veth pair after %d attempts"),
MAX_VETH_RETRIES);
-cleanup:
+ cleanup:
virMutexUnlock(&virNetDevVethCreateMutex);
virCommandFree(cmd);
VIR_FREE(veth1auto);
}
ret = 0;
-cleanup:
+ cleanup:
virCommandFree(cmd);
return ret;
}
ret = 0;
-error:
+ error:
if (ret < 0)
VIR_FREE(*result);
return ret;
goto cleanup;
}
}
-cleanup:
+ cleanup:
return rc;
}
}
rc = 0;
-cleanup:
+ cleanup:
nlmsg_free(nl_msg);
VIR_FREE(resp);
return rc;
-malformed_resp:
+ malformed_resp:
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("malformed netlink response message"));
goto cleanup;
-buffer_too_small:
+ buffer_too_small:
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("allocated netlink buffer is too small"));
goto cleanup;
rc = -2;
}
-cleanup:
+ cleanup:
return rc;
}
vf,
op,
setlink_only);
-cleanup:
+ cleanup:
return rc;
}
rc = -1;
}
-cleanup:
+ cleanup:
VIR_FREE(physfndev);
return rc;
}
"%s", _("nl_recv failed"));
rc = -1;
}
-error:
+ error:
if (rc == -1) {
VIR_FREE(*resp);
*resp = NULL;
ret = 0;
server[protocol] = srv;
-error_server:
+ error_server:
if (ret < 0) {
nl_close(srv->netlinknh);
virNetlinkFree(srv->netlinknh);
}
-error_locked:
+ error_locked:
virNetlinkEventServerUnlock(srv);
if (ret < 0) {
virMutexDestroy(&srv->lock);
}
r = srv->handlesCount++;
-addentry:
+ addentry:
srv->handles[r].watch = nextWatch;
srv->handles[r].handleCB = handleCB;
srv->handles[r].removeCB = removeCB;
VIR_DEBUG("added client to loop slot: %d. with macaddr ptr=%p", r, macaddr);
ret = nextWatch++;
-error:
+ error:
virNetlinkEventServerUnlock(srv);
return ret;
}
}
VIR_DEBUG("no client found to remove.");
-cleanup:
+ cleanup:
virNetlinkEventServerUnlock(srv);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
virCommandFree(setAlarmCmd);
return ret;
}
aboutToSuspend = true;
ret = 0;
-cleanup:
+ cleanup:
virNodeSuspendUnlock();
return ret;
}
*supported = (status == 0);
ret = 0;
-cleanup:
+ cleanup:
virCommandFree(cmd);
return ret;
}
*bitmask = nodeSuspendTargetMask;
ret = 0;
-cleanup:
+ cleanup:
virNodeSuspendUnlock();
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
return ret;
}
cpumap = NULL;
ret = ncpus;
-cleanup:
+ cleanup:
VIR_FREE(mask);
VIR_FREE(allonesmask);
VIR_FREE(cpumap);
return klass;
-error:
+ error:
VIR_FREE(klass);
return NULL;
}
/* name = "${drivername}" */
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(drvlink);
if (ret < 0) {
VIR_FREE(*path);
*device_class = (value >> 8) & 0xFFFF;
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(id_str);
VIR_FREE(path);
return ret;
}
}
-cleanup:
+ cleanup:
virPCIDeviceConfigClose(check, fd);
return ret;
}
}
ret = 0;
-out:
+ out:
virPCIDeviceConfigClose(parent, parentfd);
virPCIDeviceFree(parent);
return ret;
_("no FLR, PM reset or bus reset available"));
}
-cleanup:
+ cleanup:
VIR_FREE(drvPath);
VIR_FREE(drvName);
virPCIDeviceConfigClose(dev, fd);
char *drvpath = NULL;
bool probed = false;
-recheck:
+ recheck:
if (virPCIDriverDir(&drvpath, driver) == 0 && virFileExists(drvpath)) {
/* driver already loaded, return */
VIR_FREE(drvpath);
goto recheck;
}
-cleanup:
+ cleanup:
/* If we know failure was because of blacklist, let's report that;
* otherwise, report a more generic failure message
*/
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(path);
VIR_FREE(drvpath);
VIR_FREE(driver);
goto cleanup;
dev->unbind_from_stub = false;
-remove_slot:
+ remove_slot:
if (!dev->remove_slot)
goto reprobe;
}
dev->remove_slot = false;
-reprobe:
+ reprobe:
if (!dev->reprobe) {
result = 0;
goto cleanup;
result = 0;
-cleanup:
+ cleanup:
/* do not do it again */
dev->unbind_from_stub = false;
dev->remove_slot = false;
result = 0;
-remove_id:
+ remove_id:
err = virSaveLastError();
/* If 'remove_id' exists, remove the device id from pci-stub's dynamic
goto cleanup;
}
-cleanup:
+ cleanup:
VIR_FREE(stubDriverPath);
VIR_FREE(driverLink);
VIR_FREE(path);
ret = 0;
}
-cleanup:
+ cleanup:
virPCIDeviceFree(dev);
return ret;
}
VIR_DEBUG("%s %s: initialized", dev->id, dev->name);
-cleanup:
+ cleanup:
VIR_FREE(product);
VIR_FREE(vendor);
return dev;
-error:
+ error:
virPCIDeviceFree(dev);
dev = NULL;
goto cleanup;
}
return copy;
-error:
+ error:
virPCIDeviceFree(copy);
return NULL;
}
ret = 0;
-cleanup:
+ cleanup:
if (dir)
closedir(dir);
VIR_FREE(file);
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(groupPath);
if (groupDir)
closedir(groupDir);
newDev = NULL; /* it's now on the list */
ret = 0;
-cleanup:
+ cleanup:
virPCIDeviceFree(newDev);
return ret;
}
return groupList;
-error:
+ error:
virObjectUnref(groupList);
return NULL;
}
goto cleanup;
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(copyAddr);
return ret;
}
goto cleanup;
ret = 0;
-cleanup:
+ cleanup:
return ret;
}
}
ret = groupNum;
-cleanup:
+ cleanup:
VIR_FREE(devName);
VIR_FREE(devPath);
VIR_FREE(groupPath);
if (virAsprintf(&groupDev, "/dev/vfio/%s",
last_component(groupPath)) < 0)
goto cleanup;
-cleanup:
+ cleanup:
VIR_FREE(devPath);
VIR_FREE(groupPath);
return groupDev;
goto cleanup;
}
-cleanup:
+ cleanup:
virPCIDeviceConfigClose(dev, fd);
return ret;
}
ret = 0;
-out:
+ out:
return ret;
}
ret = 0;
-out:
+ out:
VIR_FREE(device_path);
return ret;
} while (1);
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(device_link);
VIR_FREE(config_addr);
return ret;
-error:
+ error:
for (i = 0; i < *num_virtual_functions; i++)
VIR_FREE((*virtual_functions)[i]);
VIR_FREE(*virtual_functions);
}
}
-out:
+ out:
/* free virtual functions */
for (i = 0; i < num_virt_fns; i++)
closedir(dir);
-out:
+ out:
VIR_FREE(pcidev_sysfs_net_path);
return ret;
ret = virPCIGetNetName(pf_sysfs_device_path, pfname);
-cleanup:
+ cleanup:
VIR_FREE(pf_config_address);
VIR_FREE(pf_sysfs_device_path);
rc = 0;
-cleanup:
+ cleanup:
if (VIR_CLOSE(fd) < 0)
rc = -errno;
rc = virPidFileWritePath(pidfile, pid);
-cleanup:
+ cleanup:
VIR_FREE(pidfile);
return rc;
}
*pid = pid_value;
rc = 0;
-cleanup:
+ cleanup:
if (VIR_CLOSE(fd) < 0)
rc = -errno;
ret = STREQ(resolvedBinPath, resolvedProcLink) ? 0 : -1;
-cleanup:
+ cleanup:
VIR_FREE(procPath);
VIR_FREE(procLink);
VIR_FREE(resolvedProcLink);
rc = virPidFileReadPathIfAlive(pidfile, pid, binpath);
-cleanup:
+ cleanup:
VIR_FREE(pidfile);
return rc;
}
rc = virPidFileDeletePath(pidfile);
-cleanup:
+ cleanup:
VIR_FREE(pidfile);
return rc;
}
rc = virPidFileAcquirePath(pidfile, waitForLock, pid);
-cleanup:
+ cleanup:
VIR_FREE(pidfile);
return rc;
}
rc = virPidFileReleasePath(pidfile, fd);
-cleanup:
+ cleanup:
VIR_FREE(pidfile);
return rc;
}
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
_("Unable to find an unused port in range '%s' (%d-%d)"),
pa->name, pa->start, pa->end);
}
-cleanup:
+ cleanup:
virObjectUnlock(pa);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
virObjectUnlock(pa);
return ret;
}
}
VIR_DEBUG("failed to reap child %lld, abandoning it", (long long) pid);
-cleanup:
+ cleanup:
VIR_FREE(tmp);
errno = saved_errno;
}
return 0;
-error:
+ error:
{
char *st = virProcessTranslateStatus(status);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to terminate process %lld with SIG%s"),
(long long)pid, signame);
-cleanup:
+ cleanup:
return ret;
}
*
* http://lkml.org/lkml/2009/7/28/620
*/
-realloc:
+ realloc:
masklen = CPU_ALLOC_SIZE(numcpus);
mask = CPU_ALLOC(numcpus);
*
* http://lkml.org/lkml/2009/7/28/620
*/
-realloc:
+ realloc:
masklen = CPU_ALLOC_SIZE(numcpus);
mask = CPU_ALLOC(numcpus);
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(nsfile);
if (ret < 0) {
for (i = 0; i < *nfdlist; i++)
ret = 0;
-cleanup:
+ cleanup:
virStringFreeList(tokens);
VIR_FREE(filename);
VIR_FREE(buf);
VIR_FREE(buf);
}
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(errfd[0]);
VIR_FORCE_CLOSE(errfd[1]);
return ret;
goto cleanup;
}
-cleanup:
+ cleanup:
closedir(dir);
VIR_FREE(path);
return sg;
break;
}
-cleanup:
+ cleanup:
closedir(dir);
VIR_FREE(path);
return name;
goto cleanup;
ret = dev;
-cleanup:
+ cleanup:
VIR_FREE(sg);
VIR_FREE(vendor);
VIR_FREE(model);
return 0;
-cleanup:
+ cleanup:
virSCSIDeviceUsedByInfoFree(copy);
return -1;
}
return ret;
- error:
+ error:
sexpr_free(ret);
return NULL;
}
result = (struct sexpr *) sexpr;
-cleanup:
+ cleanup:
VIR_FREE(buffer);
return result;
return addrstr;
-error:
+ error:
return NULL;
}
result = 0;
}
-error:
+ error:
return result;
}
offset += len;
}
-done:
+ done:
return 0;
}
ret = BACKING_STORE_OK;
-cleanup:
+ cleanup:
VIR_FREE(desc);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
if (combined != path)
VIR_FREE(combined);
return ret;
}
}
-cleanup:
+ cleanup:
VIR_DEBUG("format=%d", format);
return format;
}
VIR_STRDUP(meta->compat, "1.1") < 0)
goto cleanup;
-done:
+ done:
ret = meta;
meta = NULL;
-cleanup:
+ cleanup:
virStorageFileFreeMetadata(meta);
return ret;
}
ret = virStorageFileProbeFormatFromBuf(path, header, len);
-cleanup:
+ cleanup:
VIR_FREE(header);
VIR_FORCE_CLOSE(fd);
}
ret = virStorageFileGetMetadataInternal(path, buf, len, directory, format);
-cleanup:
+ cleanup:
VIR_FREE(buf);
return ret;
}
ret = 0;
-error:
+ error:
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
if (*key && STREQ(*key, ""))
VIR_FREE(*key);
ret = 0;
-cleanup:
+ cleanup:
if (*key && STREQ(*key, ""))
VIR_FREE(*key);
*meta = owner->backingMeta;
return owner->backingStore;
-error:
+ error:
*parent = NULL;
if (meta)
*meta = NULL;
return tokens;
-error:
+ error:
for (i = 0; i < ntokens; i++)
VIR_FREE(tokens[i]);
VIR_FREE(tokens);
ret = nmatches - 1; /* don't count the trailing null */
-cleanup:
+ cleanup:
regfree(&re);
if (ret < 0) {
virStringFreeList(*matches);
return ret;
-no_memory:
+ no_memory:
VIR_FREE(outbuf);
return NULL;
}
VIR_FREE(processor_type);
return 0;
-error:
+ error:
VIR_FREE(processor_type);
return -1;
}
return ret;
-no_memory:
+ no_memory:
VIR_FREE(outbuf);
return NULL;
}
}
result = 0;
-cleanup:
+ cleanup:
VIR_FREE(manufacturer);
VIR_FREE(procline);
return result;
return ret;
-no_memory:
+ no_memory:
virSysinfoDefFree(ret);
VIR_FREE(outbuf);
return NULL;
if (virSysinfoParseMemory(outbuf, ret) < 0)
goto error;
-cleanup:
+ cleanup:
VIR_FREE(outbuf);
virCommandFree(cmd);
return ret;
-error:
+ error:
virSysinfoDefFree(ret);
ret = NULL;
goto cleanup;
identical = true;
-cleanup:
+ cleanup:
return identical;
}
goto cleanup;
}
-cleanup:
+ cleanup:
VIR_FREE(username);
return machinename;
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(creatorname);
VIR_FREE(machinename);
VIR_FREE(slicename);
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(machinename);
return ret;
}
/* New thread owns 'args' in success case, so don't free */
ret = 0;
-cleanup:
+ cleanup:
pthread_attr_destroy(&attr);
if (ret < 0)
errno = err;
virMutexLock(&pool->mutex);
}
-out:
+ out:
if (priority)
pool->nPrioWorkers--;
else
return pool;
-error:
+ error:
VIR_FREE(data);
virThreadPoolFree(pool);
return NULL;
virMutexUnlock(&pool->mutex);
return 0;
-error:
+ error:
virMutexUnlock(&pool->mutex);
return -1;
}
_("Missing TPM device path"));
}
-cleanup:
+ cleanup:
return path;
}
}
ret = 0;
-cleanup:
+ cleanup:
va_end(ap);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
va_end(ap);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
return ret;
}
*nparams = n;
return 0;
-error:
+ error:
return -1;
}
*nparams += 1;
return 0;
-error:
+ error:
virDispatchError(NULL);
return -1;
}
*nparams += 1;
return 0;
-error:
+ error:
virDispatchError(NULL);
return -1;
}
*nparams += 1;
return 0;
-error:
+ error:
virDispatchError(NULL);
return -1;
}
*nparams += 1;
return 0;
-error:
+ error:
virDispatchError(NULL);
return -1;
}
*nparams += 1;
return 0;
-error:
+ error:
virDispatchError(NULL);
return -1;
}
*nparams += 1;
return 0;
-error:
+ error:
virDispatchError(NULL);
return -1;
}
*nparams += 1;
return 0;
-error:
+ error:
virDispatchError(NULL);
return -1;
}
*nparams += 1;
return 0;
-error:
+ error:
virDispatchError(NULL);
return -1;
}
return 0;
-error:
+ error:
VIR_FREE(pname);
VIR_FREE(pvalue);
return -1;
return ret;
-error:
+ error:
xmlFreeURI(xmluri);
virURIFree(ret);
return NULL;
goto cleanup;
}
-cleanup:
+ cleanup:
VIR_FREE(tmpserver);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(filename);
VIR_FREE(buf);
return ret;
}
ret = list;
-cleanup:
+ cleanup:
if (dir) {
int saved_errno = errno;
closedir(dir);
return 0;
-error:
+ error:
VIR_FREE(*outbuf);
VIR_FREE(*errbuf);
return -1;
freeaddrinfo(info);
-cleanup:
+ cleanup:
return result;
}
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(strbuf);
return ret;
}
*uid = pw->pw_uid;
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(strbuf);
return ret;
*gid = gr->gr_gid;
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(strbuf);
return ret;
}
}
-cleanup:
+ cleanup:
VIR_FREE(user);
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
return ret;
}
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(sysfs_path);
VIR_FREE(val);
return ret;
}
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(sysfs_path);
VIR_FREE(buf);
return ret;
goto cleanup;
ret = 0;
-cleanup:
+ cleanup:
VIR_FREE(sysfs_path);
VIR_FREE(buf);
return ret;
virFileExists(scsi_host_path))
ret = true;
-cleanup:
+ cleanup:
VIR_FREE(fc_host_path);
VIR_FREE(scsi_host_path);
return ret;
"vport create/delete failed"),
vport_name, operation_path);
-cleanup:
+ cleanup:
VIR_FREE(vport_name);
VIR_FREE(operation_path);
return ret;
break;
}
-cleanup:
+ cleanup:
# undef READ_WWN
closedir(dir);
VIR_FREE(wwnn_path);
VIR_FREE(vports);
}
-cleanup:
+ cleanup:
closedir(dir);
VIR_FREE(max_vports);
VIR_FREE(vports);
rc = 0;
-cleanup:
+ cleanup:
VIR_FREE(tmp_label);
return rc;
(*ctxt)->node = xmlDocGetRootElement(xml);
}
-cleanup:
+ cleanup:
xmlFreeParserCtxt(pctxt);
return xml;
-error:
+ error:
xmlFreeDoc(xml);
xml = NULL;
ignore_value(VIR_STRDUP(ret, (const char *)xmlBufferContent(xmlbuf)));
-cleanup:
+ cleanup:
xmlBufferFree(xmlbuf);
return ret;
ret = 0;
-cleanup:
+ cleanup:
if (doc)
*doc = xmlstr;
else