mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
Indent top-level labels by one space in src/util/
This commit is contained in:
parent
d336111ee6
commit
bada4222e5
@ -69,7 +69,7 @@ prepare(const char *path, int oflags, int mode,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ runIO(const char *path, int fd, int oflags, unsigned long long length)
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (VIR_CLOSE(fd) < 0 &&
|
if (VIR_CLOSE(fd) < 0 &&
|
||||||
ret == 0) {
|
ret == 0) {
|
||||||
virReportSystemError(errno, _("Unable to close %s"), path);
|
virReportSystemError(errno, _("Unable to close %s"), path);
|
||||||
@ -309,7 +309,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
err = virGetLastError();
|
err = virGetLastError();
|
||||||
if (err) {
|
if (err) {
|
||||||
fprintf(stderr, "%s: %s\n", program_name, err->message);
|
fprintf(stderr, "%s: %s\n", program_name, err->message);
|
||||||
|
@ -91,11 +91,11 @@ virAuthGetConfigFilePathURI(virURIPtr uri,
|
|||||||
|
|
||||||
VIR_FREE(*path);
|
VIR_FREE(*path);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
VIR_DEBUG("Using auth file '%s'", NULLSTR(*path));
|
VIR_DEBUG("Using auth file '%s'", NULLSTR(*path));
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(userdir);
|
VIR_FREE(userdir);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -141,7 +141,7 @@ virAuthGetCredential(const char *servicename,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virAuthConfigFree(config);
|
virAuthConfigFree(config);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ virAuthConfigPtr virAuthConfigNew(const char *path)
|
|||||||
|
|
||||||
return auth;
|
return auth;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virAuthConfigFree(auth);
|
virAuthConfigFree(auth);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ virAuthConfigPtr virAuthConfigNewData(const char *path,
|
|||||||
|
|
||||||
return auth;
|
return auth;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virAuthConfigFree(auth);
|
virAuthConfigFree(auth);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -152,7 +152,7 @@ int virAuthConfigLookup(virAuthConfigPtr auth,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(authgroup);
|
VIR_FREE(authgroup);
|
||||||
VIR_FREE(credgroup);
|
VIR_FREE(credgroup);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -381,7 +381,7 @@ virBitmapParse(const char *str,
|
|||||||
|
|
||||||
return virBitmapCountBits(*bitmap);
|
return virBitmapCountBits(*bitmap);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virReportError(VIR_ERR_INVALID_ARG,
|
virReportError(VIR_ERR_INVALID_ARG,
|
||||||
_("Failed to parse bitmap '%s'"), str);
|
_("Failed to parse bitmap '%s'"), str);
|
||||||
virBitmapFree(*bitmap);
|
virBitmapFree(*bitmap);
|
||||||
|
@ -177,7 +177,7 @@ virCgroupPartitionNeedsEscaping(const char *path)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(line);
|
VIR_FREE(line);
|
||||||
VIR_FORCE_FCLOSE(fp);
|
VIR_FORCE_FCLOSE(fp);
|
||||||
return ret;
|
return ret;
|
||||||
@ -393,7 +393,7 @@ virCgroupDetectMounts(virCgroupPtr group)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
VIR_FORCE_FCLOSE(mounts);
|
VIR_FORCE_FCLOSE(mounts);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -546,7 +546,7 @@ virCgroupDetectPlacement(virCgroupPtr group,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(procfile);
|
VIR_FREE(procfile);
|
||||||
VIR_FORCE_FCLOSE(mapping);
|
VIR_FORCE_FCLOSE(mapping);
|
||||||
|
|
||||||
@ -693,7 +693,7 @@ virCgroupSetValueStr(virCgroupPtr group,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(keypath);
|
VIR_FREE(keypath);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -727,7 +727,7 @@ virCgroupGetValueStr(virCgroupPtr group,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(keypath);
|
VIR_FREE(keypath);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -794,7 +794,7 @@ virCgroupGetValueI64(virCgroupPtr group,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(strval);
|
VIR_FREE(strval);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -821,7 +821,7 @@ virCgroupGetValueU64(virCgroupPtr group,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(strval);
|
VIR_FREE(strval);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -976,7 +976,7 @@ virCgroupMakeGroup(virCgroupPtr parent,
|
|||||||
VIR_DEBUG("Done making controllers for group");
|
VIR_DEBUG("Done making controllers for group");
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1027,7 +1027,7 @@ virCgroupNew(pid_t pid,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virCgroupFree(group);
|
virCgroupFree(group);
|
||||||
*group = NULL;
|
*group = NULL;
|
||||||
|
|
||||||
@ -1063,7 +1063,7 @@ virCgroupAddTask(virCgroupPtr group, pid_t pid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1137,7 +1137,7 @@ virCgroupAddTaskStrController(virCgroupPtr group,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(str);
|
VIR_FREE(str);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -1186,7 +1186,7 @@ virCgroupMoveTask(virCgroupPtr src_group, virCgroupPtr dest_group)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(content);
|
VIR_FREE(content);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1232,7 +1232,7 @@ virCgroupSetPartitionSuffix(const char *path, char **res)
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virStringFreeList(tokens);
|
virStringFreeList(tokens);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1294,7 +1294,7 @@ virCgroupNewPartition(const char *path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
virCgroupFree(group);
|
virCgroupFree(group);
|
||||||
virCgroupFree(&parent);
|
virCgroupFree(&parent);
|
||||||
@ -1370,7 +1370,7 @@ virCgroupNewDomainPartition(virCgroupPtr partition,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(grpname);
|
VIR_FREE(grpname);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1413,7 +1413,7 @@ virCgroupNewVcpu(virCgroupPtr domain,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(name);
|
VIR_FREE(name);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1450,7 +1450,7 @@ virCgroupNewEmulator(virCgroupPtr domain,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1639,10 +1639,10 @@ virCgroupNewMachineManual(const char *name,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virCgroupFree(&parent);
|
virCgroupFree(&parent);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1898,7 +1898,7 @@ virCgroupGetBlkioIoServiced(virCgroupPtr group,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(str2);
|
VIR_FREE(str2);
|
||||||
VIR_FREE(str1);
|
VIR_FREE(str1);
|
||||||
return ret;
|
return ret;
|
||||||
@ -2016,7 +2016,7 @@ virCgroupGetBlkioIoDeviceServiced(virCgroupPtr group,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(str3);
|
VIR_FREE(str3);
|
||||||
VIR_FREE(str2);
|
VIR_FREE(str2);
|
||||||
VIR_FREE(str1);
|
VIR_FREE(str1);
|
||||||
@ -2656,7 +2656,7 @@ virCgroupAllowDevice(virCgroupPtr group, char type, int major, int minor,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(devstr);
|
VIR_FREE(devstr);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -2693,7 +2693,7 @@ virCgroupAllowDeviceMajor(virCgroupPtr group, char type, int major,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(devstr);
|
VIR_FREE(devstr);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -2767,7 +2767,7 @@ virCgroupDenyDevice(virCgroupPtr group, char type, int major, int minor,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(devstr);
|
VIR_FREE(devstr);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -2804,7 +2804,7 @@ virCgroupDenyDeviceMajor(virCgroupPtr group, char type, int major,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(devstr);
|
VIR_FREE(devstr);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -2900,7 +2900,7 @@ virCgroupGetPercpuStats(virCgroupPtr group,
|
|||||||
|
|
||||||
rv = nparams;
|
rv = nparams;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(buf);
|
VIR_FREE(buf);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
@ -3225,7 +3225,7 @@ virCgroupKillInternal(virCgroupPtr group, int signum, virHashTablePtr pids)
|
|||||||
done:
|
done:
|
||||||
ret = killedAny ? 1 : 0;
|
ret = killedAny ? 1 : 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(keypath);
|
VIR_FREE(keypath);
|
||||||
VIR_FORCE_FCLOSE(fp);
|
VIR_FORCE_FCLOSE(fp);
|
||||||
|
|
||||||
@ -3346,7 +3346,7 @@ virCgroupKillRecursiveInternal(virCgroupPtr group,
|
|||||||
done:
|
done:
|
||||||
ret = killedAny ? 1 : 0;
|
ret = killedAny ? 1 : 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virCgroupFree(&subgroup);
|
virCgroupFree(&subgroup);
|
||||||
closedir(dp);
|
closedir(dp);
|
||||||
|
|
||||||
@ -3501,7 +3501,7 @@ virCgroupGetCpuacctStat(virCgroupPtr group, unsigned long long *user,
|
|||||||
*sys *= scale;
|
*sys *= scale;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(str);
|
VIR_FREE(str);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -3607,7 +3607,7 @@ virCgroupIsolateMount(virCgroupPtr group, const char *oldroot,
|
|||||||
}
|
}
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(root);
|
VIR_FREE(root);
|
||||||
VIR_FREE(opts);
|
VIR_FREE(opts);
|
||||||
return ret;
|
return ret;
|
||||||
@ -3708,7 +3708,7 @@ virCgroupSupportsCpuBW(virCgroupPtr cgroup)
|
|||||||
|
|
||||||
ret = virFileExists(path);
|
ret = virFileExists(path);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(path);
|
VIR_FREE(path);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ virCloseCallbacksSet(virCloseCallbacksPtr closeCallbacks,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virObjectUnlock(closeCallbacks);
|
virObjectUnlock(closeCallbacks);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -180,7 +180,7 @@ virCloseCallbacksUnset(virCloseCallbacksPtr closeCallbacks,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = virHashRemoveEntry(closeCallbacks->list, uuidstr);
|
ret = virHashRemoveEntry(closeCallbacks->list, uuidstr);
|
||||||
cleanup:
|
cleanup:
|
||||||
virObjectUnlock(closeCallbacks);
|
virObjectUnlock(closeCallbacks);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1993,7 +1993,7 @@ virCommandProcessIO(virCommandPtr cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
if (cmd->outbuf && *cmd->outbuf)
|
if (cmd->outbuf && *cmd->outbuf)
|
||||||
(*cmd->outbuf)[outlen] = '\0';
|
(*cmd->outbuf)[outlen] = '\0';
|
||||||
if (cmd->errbuf && *cmd->errbuf)
|
if (cmd->errbuf && *cmd->errbuf)
|
||||||
@ -2333,7 +2333,7 @@ virCommandRunAsync(virCommandPtr cmd, pid_t *pid)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
VIR_FORCE_CLOSE(cmd->infd);
|
VIR_FORCE_CLOSE(cmd->infd);
|
||||||
VIR_FORCE_CLOSE(cmd->inpipe);
|
VIR_FORCE_CLOSE(cmd->inpipe);
|
||||||
@ -2872,7 +2872,7 @@ virCommandRunRegex(virCommandPtr cmd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virStringFreeList(lines);
|
virStringFreeList(lines);
|
||||||
VIR_FREE(outbuf);
|
VIR_FREE(outbuf);
|
||||||
if (groups) {
|
if (groups) {
|
||||||
|
@ -730,7 +730,7 @@ virConfParse(const char *filename, const char *content, int len,
|
|||||||
|
|
||||||
return ctxt.conf;
|
return ctxt.conf;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virConfFree(ctxt.conf);
|
virConfFree(ctxt.conf);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -755,7 +755,7 @@ virDBusMessageIterEncode(DBusMessageIter *rootiter,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
while (nstack > 0) {
|
while (nstack > 0) {
|
||||||
DBusMessageIter *thisiter = iter;
|
DBusMessageIter *thisiter = iter;
|
||||||
VIR_DEBUG("Popping iter=%p", iter);
|
VIR_DEBUG("Popping iter=%p", iter);
|
||||||
@ -1067,7 +1067,7 @@ virDBusMessageIterDecode(DBusMessageIter *rootiter,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virDBusTypeStackFree(&stack, &nstack);
|
virDBusTypeStackFree(&stack, &nstack);
|
||||||
VIR_FREE(contsig);
|
VIR_FREE(contsig);
|
||||||
VIR_FREE(newiter);
|
VIR_FREE(newiter);
|
||||||
@ -1113,7 +1113,7 @@ int virDBusMessageDecodeArgs(DBusMessage* msg,
|
|||||||
|
|
||||||
ret = virDBusMessageIterDecode(&iter, types, args);
|
ret = virDBusMessageIterDecode(&iter, types, args);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -685,7 +685,7 @@ dnsmasqCapsSetFromBuffer(dnsmasqCapsPtr caps, const char *buf)
|
|||||||
dnsmasqCapsGet(caps, DNSMASQ_CAPS_BIND_DYNAMIC) ? "" : "NOT ");
|
dnsmasqCapsGet(caps, DNSMASQ_CAPS_BIND_DYNAMIC) ? "" : "NOT ");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
p = strchrnul(buf, '\n');
|
p = strchrnul(buf, '\n');
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot parse %s version number in '%.*s'"),
|
_("cannot parse %s version number in '%.*s'"),
|
||||||
@ -705,7 +705,7 @@ dnsmasqCapsSetFromFile(dnsmasqCapsPtr caps, const char *path)
|
|||||||
|
|
||||||
ret = dnsmasqCapsSetFromBuffer(caps, buf);
|
ret = dnsmasqCapsSetFromBuffer(caps, buf);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(buf);
|
VIR_FREE(buf);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -767,7 +767,7 @@ dnsmasqCapsRefreshInternal(dnsmasqCapsPtr caps, bool force)
|
|||||||
|
|
||||||
ret = dnsmasqCapsSetFromBuffer(caps, complete);
|
ret = dnsmasqCapsSetFromBuffer(caps, complete);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
VIR_FREE(help);
|
VIR_FREE(help);
|
||||||
VIR_FREE(version);
|
VIR_FREE(version);
|
||||||
@ -790,7 +790,7 @@ dnsmasqCapsNewEmpty(const char *binaryPath)
|
|||||||
goto error;
|
goto error;
|
||||||
return caps;
|
return caps;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virObjectUnref(caps);
|
virObjectUnref(caps);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -288,7 +288,7 @@ virSetError(virErrorPtr newerr)
|
|||||||
|
|
||||||
virResetError(err);
|
virResetError(err);
|
||||||
ret = virCopyError(newerr, err);
|
ret = virCopyError(newerr, err);
|
||||||
cleanup:
|
cleanup:
|
||||||
errno = saved_errno;
|
errno = saved_errno;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -668,9 +668,9 @@ int virEventPollRunOnce(void)
|
|||||||
VIR_FREE(fds);
|
VIR_FREE(fds);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virMutexUnlock(&eventLoop.lock);
|
virMutexUnlock(&eventLoop.lock);
|
||||||
error_unlocked:
|
error_unlocked:
|
||||||
VIR_FREE(fds);
|
VIR_FREE(fds);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -267,7 +267,7 @@ virFileWrapperFdNew(int *fd, const char *name, unsigned int flags)
|
|||||||
*fd = pipefd[output];
|
*fd = pipefd[output];
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
VIR_FORCE_CLOSE(pipefd[0]);
|
VIR_FORCE_CLOSE(pipefd[0]);
|
||||||
VIR_FORCE_CLOSE(pipefd[1]);
|
VIR_FORCE_CLOSE(pipefd[1]);
|
||||||
virFileWrapperFdFree(ret);
|
virFileWrapperFdFree(ret);
|
||||||
@ -465,7 +465,7 @@ virFileRewrite(const char *path,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
if (newfile) {
|
if (newfile) {
|
||||||
unlink(newfile);
|
unlink(newfile);
|
||||||
@ -643,7 +643,7 @@ static int virFileLoopDeviceOpenSearch(char **dev_name)
|
|||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Unable to find a free loop device in /dev"));
|
_("Unable to find a free loop device in /dev"));
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (fd != -1) {
|
if (fd != -1) {
|
||||||
VIR_DEBUG("Got free loop device %s %d", looppath, fd);
|
VIR_DEBUG("Got free loop device %s %d", looppath, fd);
|
||||||
*dev_name = looppath;
|
*dev_name = looppath;
|
||||||
@ -719,7 +719,7 @@ int virFileLoopDeviceAssociate(const char *file,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(loname);
|
VIR_FREE(loname);
|
||||||
VIR_FORCE_CLOSE(fsfd);
|
VIR_FORCE_CLOSE(fsfd);
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
@ -752,7 +752,7 @@ virFileNBDDeviceIsBusy(const char *devname)
|
|||||||
}
|
}
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(path);
|
VIR_FREE(path);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -794,7 +794,7 @@ virFileNBDDeviceFindUnused(void)
|
|||||||
virReportSystemError(EBUSY, "%s",
|
virReportSystemError(EBUSY, "%s",
|
||||||
_("No free NBD devices"));
|
_("No free NBD devices"));
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
closedir(dh);
|
closedir(dh);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -850,7 +850,7 @@ int virFileNBDDeviceAssociate(const char *file,
|
|||||||
nbddev = NULL;
|
nbddev = NULL;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(nbddev);
|
VIR_FREE(nbddev);
|
||||||
VIR_FREE(qemunbd);
|
VIR_FREE(qemunbd);
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
@ -957,7 +957,7 @@ int virFileDeleteTree(const char *dir)
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(filepath);
|
VIR_FREE(filepath);
|
||||||
closedir(dh);
|
closedir(dh);
|
||||||
return ret;
|
return ret;
|
||||||
@ -1137,7 +1137,7 @@ virFileFindMountPoint(const char *type)
|
|||||||
if (!ret)
|
if (!ret)
|
||||||
errno = ENOENT;
|
errno = ENOENT;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
endmntent(f);
|
endmntent(f);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -1644,7 +1644,7 @@ virFileGetMountSubtreeImpl(const char *mtabpath,
|
|||||||
*nmountsret = nmounts ? nmounts - 1 : 0;
|
*nmountsret = nmounts ? nmounts - 1 : 0;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
virStringFreeList(mounts);
|
virStringFreeList(mounts);
|
||||||
endmntent(procmnt);
|
endmntent(procmnt);
|
||||||
@ -1776,7 +1776,7 @@ virFileAccessibleAs(const char *path, int mode,
|
|||||||
if (access(path, mode) < 0)
|
if (access(path, mode) < 0)
|
||||||
ret = errno;
|
ret = errno;
|
||||||
|
|
||||||
childerror:
|
childerror:
|
||||||
if ((ret & 0xFF) != ret) {
|
if ((ret & 0xFF) != ret) {
|
||||||
VIR_WARN("unable to pass desired return value %d", ret);
|
VIR_WARN("unable to pass desired return value %d", ret);
|
||||||
ret = 0xFF;
|
ret = 0xFF;
|
||||||
@ -2064,7 +2064,7 @@ virFileOpenAs(const char *path, int openflags, mode_t mode,
|
|||||||
/* File is successfully opened */
|
/* File is successfully opened */
|
||||||
return fd;
|
return fd;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
if (fd >= 0) {
|
if (fd >= 0) {
|
||||||
/* some other failure after the open succeeded */
|
/* some other failure after the open succeeded */
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
@ -2110,7 +2110,7 @@ virDirCreateNoFork(const char *path,
|
|||||||
path, mode);
|
path, mode);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
error:
|
error:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2168,7 +2168,7 @@ virDirCreate(const char *path,
|
|||||||
* some cases */
|
* some cases */
|
||||||
return virDirCreateNoFork(path, mode, uid, gid, flags);
|
return virDirCreateNoFork(path, mode, uid, gid, flags);
|
||||||
}
|
}
|
||||||
parenterror:
|
parenterror:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2210,7 +2210,7 @@ parenterror:
|
|||||||
path, mode);
|
path, mode);
|
||||||
goto childerror;
|
goto childerror;
|
||||||
}
|
}
|
||||||
childerror:
|
childerror:
|
||||||
_exit(ret);
|
_exit(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2322,7 +2322,7 @@ virFileMakePathWithMode(const char *path,
|
|||||||
|
|
||||||
ret = virFileMakePathHelper(tmp, mode);
|
ret = virFileMakePathHelper(tmp, mode);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(tmp);
|
VIR_FREE(tmp);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -2443,7 +2443,7 @@ virFileOpenTty(int *ttymaster, char **ttyName, int rawmode)
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
VIR_FORCE_CLOSE(*ttymaster);
|
VIR_FORCE_CLOSE(*ttymaster);
|
||||||
VIR_FORCE_CLOSE(slave);
|
VIR_FORCE_CLOSE(slave);
|
||||||
@ -2641,7 +2641,7 @@ int virFilePrintf(FILE *fp, const char *msg, ...)
|
|||||||
|
|
||||||
VIR_FREE(str);
|
VIR_FREE(str);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
va_end(vargs);
|
va_end(vargs);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -119,7 +119,7 @@ virHostdevManagerNew(void)
|
|||||||
|
|
||||||
return hostdevMgr;
|
return hostdevMgr;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virObjectUnref(hostdevMgr);
|
virObjectUnref(hostdevMgr);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -288,7 +288,7 @@ virHostdevNetDevice(virDomainHostdevDefPtr hostdev, char **linkdev,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(sysfs_path);
|
VIR_FREE(sysfs_path);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -398,7 +398,7 @@ virHostdevNetConfigReplace(virDomainHostdevDefPtr hostdev,
|
|||||||
&hostdev->parent.data.net->mac,
|
&hostdev->parent.data.net->mac,
|
||||||
vlanid, stateDir);
|
vlanid, stateDir);
|
||||||
}
|
}
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(linkdev);
|
VIR_FREE(linkdev);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -629,7 +629,7 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr,
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
inactivedevs:
|
inactivedevs:
|
||||||
/* Only steal all the devices from activePCIHostdevs. We will
|
/* Only steal all the devices from activePCIHostdevs. We will
|
||||||
* free them in virObjectUnref().
|
* free them in virObjectUnref().
|
||||||
*/
|
*/
|
||||||
@ -638,12 +638,12 @@ inactivedevs:
|
|||||||
virPCIDeviceListSteal(hostdev_mgr->activePCIHostdevs, dev);
|
virPCIDeviceListSteal(hostdev_mgr->activePCIHostdevs, dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
resetvfnetconfig:
|
resetvfnetconfig:
|
||||||
for (i = 0;
|
for (i = 0;
|
||||||
last_processed_hostdev_vf != -1 && i < last_processed_hostdev_vf; i++)
|
last_processed_hostdev_vf != -1 && i < last_processed_hostdev_vf; i++)
|
||||||
virHostdevNetConfigRestore(hostdevs[i], hostdev_mgr->stateDir, NULL);
|
virHostdevNetConfigRestore(hostdevs[i], hostdev_mgr->stateDir, NULL);
|
||||||
|
|
||||||
reattachdevs:
|
reattachdevs:
|
||||||
for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) {
|
for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) {
|
||||||
virPCIDevicePtr dev = virPCIDeviceListGet(pcidevs, i);
|
virPCIDevicePtr dev = virPCIDeviceListGet(pcidevs, i);
|
||||||
|
|
||||||
@ -654,7 +654,7 @@ reattachdevs:
|
|||||||
NULL));
|
NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
|
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
|
||||||
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
|
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
|
||||||
virObjectUnref(pcidevs);
|
virObjectUnref(pcidevs);
|
||||||
@ -784,7 +784,7 @@ virHostdevReAttachPCIDevices(virHostdevManagerPtr hostdev_mgr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
virObjectUnref(pcidevs);
|
virObjectUnref(pcidevs);
|
||||||
cleanup:
|
cleanup:
|
||||||
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
|
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
|
||||||
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
|
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
|
||||||
}
|
}
|
||||||
@ -850,7 +850,7 @@ virHostdevUpdateActivePCIDevices(virHostdevManagerPtr mgr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virPCIDeviceFree(dev);
|
virPCIDeviceFree(dev);
|
||||||
virObjectUnlock(mgr->activePCIHostdevs);
|
virObjectUnlock(mgr->activePCIHostdevs);
|
||||||
virObjectUnlock(mgr->inactivePCIHostdevs);
|
virObjectUnlock(mgr->inactivePCIHostdevs);
|
||||||
@ -900,7 +900,7 @@ virHostdevUpdateActiveUSBDevices(virHostdevManagerPtr mgr,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virObjectUnlock(mgr->activeUSBHostdevs);
|
virObjectUnlock(mgr->activeUSBHostdevs);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -954,7 +954,7 @@ virHostdevUpdateActiveSCSIDevices(virHostdevManagerPtr mgr,
|
|||||||
}
|
}
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virObjectUnlock(mgr->activeSCSIHostdevs);
|
virObjectUnlock(mgr->activeSCSIHostdevs);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1008,7 +1008,7 @@ virHostdevMarkUSBDevices(virHostdevManagerPtr mgr,
|
|||||||
virObjectUnlock(mgr->activeUSBHostdevs);
|
virObjectUnlock(mgr->activeUSBHostdevs);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
for (j = 0; j < i; j++) {
|
for (j = 0; j < i; j++) {
|
||||||
tmp = virUSBDeviceListGet(list, i);
|
tmp = virUSBDeviceListGet(list, i);
|
||||||
virUSBDeviceListSteal(mgr->activeUSBHostdevs, tmp);
|
virUSBDeviceListSteal(mgr->activeUSBHostdevs, tmp);
|
||||||
@ -1099,7 +1099,7 @@ virHostdevFindUSBDevice(virDomainHostdevDefPtr hostdev,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (!*usb)
|
if (!*usb)
|
||||||
hostdev->missing = true;
|
hostdev->missing = true;
|
||||||
return 0;
|
return 0;
|
||||||
@ -1174,7 +1174,7 @@ virHostdevPrepareUSBDevices(virHostdevManagerPtr hostdev_mgr,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virObjectUnref(list);
|
virObjectUnref(list);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1282,13 +1282,13 @@ virHostdevPrepareSCSIDevices(virHostdevManagerPtr hostdev_mgr,
|
|||||||
virObjectUnref(list);
|
virObjectUnref(list);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
for (j = 0; j < i; j++) {
|
for (j = 0; j < i; j++) {
|
||||||
tmp = virSCSIDeviceListGet(list, i);
|
tmp = virSCSIDeviceListGet(list, i);
|
||||||
virSCSIDeviceListSteal(hostdev_mgr->activeSCSIHostdevs, tmp);
|
virSCSIDeviceListSteal(hostdev_mgr->activeSCSIHostdevs, tmp);
|
||||||
}
|
}
|
||||||
virObjectUnlock(hostdev_mgr->activeSCSIHostdevs);
|
virObjectUnlock(hostdev_mgr->activeSCSIHostdevs);
|
||||||
cleanup:
|
cleanup:
|
||||||
virObjectUnref(list);
|
virObjectUnref(list);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1443,7 +1443,7 @@ virHostdevPCINodeDeviceDetach(virHostdevManagerPtr hostdev_mgr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
out:
|
out:
|
||||||
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
|
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
|
||||||
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
|
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
|
||||||
return ret;
|
return ret;
|
||||||
@ -1484,7 +1484,7 @@ virHostdevPCINodeDeviceReAttach(virHostdevManagerPtr hostdev_mgr,
|
|||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
out:
|
out:
|
||||||
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
|
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
|
||||||
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
|
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
|
||||||
return ret;
|
return ret;
|
||||||
@ -1503,7 +1503,7 @@ virHostdevPCINodeDeviceReset(virHostdevManagerPtr hostdev_mgr,
|
|||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
out:
|
out:
|
||||||
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
|
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
|
||||||
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
|
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -217,7 +217,7 @@ virIdentityPtr virIdentityGetSystem(void)
|
|||||||
processtime) < 0)
|
processtime) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(username);
|
VIR_FREE(username);
|
||||||
VIR_FREE(userid);
|
VIR_FREE(userid);
|
||||||
VIR_FREE(groupname);
|
VIR_FREE(groupname);
|
||||||
@ -227,7 +227,7 @@ cleanup:
|
|||||||
VIR_FREE(processtime);
|
VIR_FREE(processtime);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virObjectUnref(ret);
|
virObjectUnref(ret);
|
||||||
ret = NULL;
|
ret = NULL;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -295,7 +295,7 @@ int virIdentitySetAttr(virIdentityPtr ident,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,6 +349,6 @@ bool virIdentityIsEqual(virIdentityPtr identA,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = true;
|
ret = true;
|
||||||
cleanup:
|
cleanup:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ virInitctlSetRunLevel(virInitctlRunLevel level)
|
|||||||
|
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -858,7 +858,7 @@ iptablesForwardMasquerade(virSocketAddr *netaddr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = virCommandRun(cmd, NULL);
|
ret = virCommandRun(cmd, NULL);
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
VIR_FREE(networkstr);
|
VIR_FREE(networkstr);
|
||||||
VIR_FREE(addrStartStr);
|
VIR_FREE(addrStartStr);
|
||||||
@ -952,7 +952,7 @@ iptablesForwardDontMasquerade(virSocketAddr *netaddr,
|
|||||||
virCommandAddArgList(cmd, "--source", networkstr,
|
virCommandAddArgList(cmd, "--source", networkstr,
|
||||||
"--destination", destaddr, "--jump", "RETURN", NULL);
|
"--destination", destaddr, "--jump", "RETURN", NULL);
|
||||||
ret = virCommandRun(cmd, NULL);
|
ret = virCommandRun(cmd, NULL);
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
VIR_FREE(networkstr);
|
VIR_FREE(networkstr);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -96,7 +96,7 @@ virISCSIGetSession(const char *devpath,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
return cbdata.session;
|
return cbdata.session;
|
||||||
}
|
}
|
||||||
@ -184,7 +184,7 @@ virStorageBackendIQNFound(const char *initiatoriqn,
|
|||||||
if (virCommandWait(cmd, NULL) < 0)
|
if (virCommandWait(cmd, NULL) < 0)
|
||||||
ret = IQN_ERROR;
|
ret = IQN_ERROR;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (ret == IQN_MISSING) {
|
if (ret == IQN_MISSING) {
|
||||||
VIR_DEBUG("Could not find interface with IQN '%s'", iqn);
|
VIR_DEBUG("Could not find interface with IQN '%s'", iqn);
|
||||||
}
|
}
|
||||||
@ -262,7 +262,7 @@ virStorageBackendCreateIfaceIQN(const char *initiatoriqn,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
VIR_FREE(temp_ifacename);
|
VIR_FREE(temp_ifacename);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
@ -314,7 +314,7 @@ virISCSIConnection(const char *portal,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
VIR_FREE(ifacename);
|
VIR_FREE(ifacename);
|
||||||
|
|
||||||
@ -458,7 +458,7 @@ virISCSIScanTargets(const char *portal,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -492,7 +492,7 @@ virISCSINodeUpdate(const char *portal,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1008,7 +1008,7 @@ virJSONValuePtr virJSONValueFromString(const char *jsonstring)
|
|||||||
ret = parser.head;
|
ret = parser.head;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
yajl_free(hand);
|
yajl_free(hand);
|
||||||
|
|
||||||
if (parser.nstate) {
|
if (parser.nstate) {
|
||||||
@ -1128,7 +1128,7 @@ char *virJSONValueToString(virJSONValuePtr object,
|
|||||||
|
|
||||||
ignore_value(VIR_STRDUP(ret, (const char *)str));
|
ignore_value(VIR_STRDUP(ret, (const char *)str));
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
yajl_gen_free(g);
|
yajl_gen_free(g);
|
||||||
|
|
||||||
VIR_DEBUG("result=%s", NULLSTR(ret));
|
VIR_DEBUG("result=%s", NULLSTR(ret));
|
||||||
|
@ -137,7 +137,7 @@ static int virKeyFileParseGroup(virKeyFileParserCtxtPtr ctxt)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
virHashFree(ctxt->group);
|
virHashFree(ctxt->group);
|
||||||
ctxt->group = NULL;
|
ctxt->group = NULL;
|
||||||
@ -195,7 +195,7 @@ static int virKeyFileParseValue(virKeyFileParserCtxtPtr ctxt)
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(key);
|
VIR_FREE(key);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -268,7 +268,7 @@ static int virKeyFileParse(virKeyFilePtr conf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(ctxt.groupname);
|
VIR_FREE(ctxt.groupname);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -293,7 +293,7 @@ virKeyFilePtr virKeyFileNew(void)
|
|||||||
|
|
||||||
return conf;
|
return conf;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virKeyFileFree(conf);
|
virKeyFileFree(conf);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ doModprobe(const char *opts, const char *module, char **outbuf, char **errbuf)
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -65,7 +65,7 @@ doRmmod(const char *module, char **errbuf)
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -174,7 +174,7 @@ virKModIsBlacklisted(const char *module)
|
|||||||
if (strstr(outbuf, drvblklst))
|
if (strstr(outbuf, drvblklst))
|
||||||
retval = true;
|
retval = true;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(drvblklst);
|
VIR_FREE(drvblklst);
|
||||||
VIR_FREE(outbuf);
|
VIR_FREE(outbuf);
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -226,7 +226,7 @@ virLockSpaceResourceNew(virLockSpacePtr lockspace,
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virLockSpaceResourceFree(res);
|
virLockSpaceResourceFree(res);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -282,7 +282,7 @@ virLockSpacePtr virLockSpaceNew(const char *directory)
|
|||||||
|
|
||||||
return lockspace;
|
return lockspace;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virLockSpaceFree(lockspace);
|
virLockSpaceFree(lockspace);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -431,7 +431,7 @@ virLockSpacePtr virLockSpaceNewPostExecRestart(virJSONValuePtr object)
|
|||||||
|
|
||||||
return lockspace;
|
return lockspace;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virLockSpaceFree(lockspace);
|
virLockSpaceFree(lockspace);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -565,7 +565,7 @@ int virLockSpaceCreateResource(virLockSpacePtr lockspace,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virMutexUnlock(&lockspace->lock);
|
virMutexUnlock(&lockspace->lock);
|
||||||
VIR_FREE(respath);
|
VIR_FREE(respath);
|
||||||
return ret;
|
return ret;
|
||||||
@ -602,7 +602,7 @@ int virLockSpaceDeleteResource(virLockSpacePtr lockspace,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virMutexUnlock(&lockspace->lock);
|
virMutexUnlock(&lockspace->lock);
|
||||||
VIR_FREE(respath);
|
VIR_FREE(respath);
|
||||||
return ret;
|
return ret;
|
||||||
@ -649,10 +649,10 @@ int virLockSpaceAcquireResource(virLockSpacePtr lockspace,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virMutexUnlock(&lockspace->lock);
|
virMutexUnlock(&lockspace->lock);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -699,7 +699,7 @@ int virLockSpaceReleaseResource(virLockSpacePtr lockspace,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virMutexUnlock(&lockspace->lock);
|
virMutexUnlock(&lockspace->lock);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -767,7 +767,7 @@ int virLockSpaceReleaseResourcesForOwner(virLockSpacePtr lockspace,
|
|||||||
virMutexUnlock(&lockspace->lock);
|
virMutexUnlock(&lockspace->lock);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virMutexUnlock(&lockspace->lock);
|
virMutexUnlock(&lockspace->lock);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ virLogDefineFilter(const char *match,
|
|||||||
virLogFilters[i].flags = flags;
|
virLogFilters[i].flags = flags;
|
||||||
virLogNbFilters++;
|
virLogNbFilters++;
|
||||||
virLogFiltersSerial++;
|
virLogFiltersSerial++;
|
||||||
cleanup:
|
cleanup:
|
||||||
virLogUnlock();
|
virLogUnlock();
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
virReportOOMError();
|
virReportOOMError();
|
||||||
@ -409,7 +409,7 @@ virLogDefineOutput(virLogOutputFunc f,
|
|||||||
virLogOutputs[ret].priority = priority;
|
virLogOutputs[ret].priority = priority;
|
||||||
virLogOutputs[ret].dest = dest;
|
virLogOutputs[ret].dest = dest;
|
||||||
virLogOutputs[ret].name = ndup;
|
virLogOutputs[ret].name = ndup;
|
||||||
cleanup:
|
cleanup:
|
||||||
virLogUnlock();
|
virLogUnlock();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -633,7 +633,7 @@ virLogVMessage(virLogSourcePtr source,
|
|||||||
}
|
}
|
||||||
virLogUnlock();
|
virLogUnlock();
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(str);
|
VIR_FREE(str);
|
||||||
VIR_FREE(msg);
|
VIR_FREE(msg);
|
||||||
errno = saved_errno;
|
errno = saved_errno;
|
||||||
@ -1005,7 +1005,7 @@ virLogOutputToJournald(virLogSourcePtr source,
|
|||||||
|
|
||||||
sendmsg(journalfd, &mh, MSG_NOSIGNAL);
|
sendmsg(journalfd, &mh, MSG_NOSIGNAL);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_LOG_CLOSE(buffd);
|
VIR_LOG_CLOSE(buffd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1171,7 +1171,7 @@ virLogParseOutputs(const char *outputs)
|
|||||||
virSkipSpaces(&cur);
|
virSkipSpaces(&cur);
|
||||||
}
|
}
|
||||||
ret = count;
|
ret = count;
|
||||||
cleanup:
|
cleanup:
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
VIR_WARN("Ignoring invalid log output setting.");
|
VIR_WARN("Ignoring invalid log output setting.");
|
||||||
return ret;
|
return ret;
|
||||||
@ -1234,7 +1234,7 @@ virLogParseFilters(const char *filters)
|
|||||||
virSkipSpaces(&cur);
|
virSkipSpaces(&cur);
|
||||||
}
|
}
|
||||||
ret = count;
|
ret = count;
|
||||||
cleanup:
|
cleanup:
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
VIR_WARN("Ignoring invalid log filter setting.");
|
VIR_WARN("Ignoring invalid log filter setting.");
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -140,7 +140,7 @@ int virNetDevExists(const char *ifname)
|
|||||||
|
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -195,7 +195,7 @@ int virNetDevSetMAC(const char *ifname,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -228,7 +228,7 @@ int virNetDevSetMAC(const char *ifname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(s);
|
VIR_FORCE_CLOSE(s);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -276,7 +276,7 @@ int virNetDevGetMAC(const char *ifname,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -402,7 +402,7 @@ int virNetDevGetMTU(const char *ifname)
|
|||||||
|
|
||||||
ret = ifr.ifr_mtu;
|
ret = ifr.ifr_mtu;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -448,7 +448,7 @@ int virNetDevSetMTU(const char *ifname, int mtu)
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -552,7 +552,7 @@ int virNetDevSetName(const char* ifname, const char *newifname)
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -612,7 +612,7 @@ int virNetDevSetOnline(const char *ifname,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -658,7 +658,7 @@ int virNetDevIsOnline(const char *ifname,
|
|||||||
*online = (ifr.ifr_flags & IFF_UP) ? true : false;
|
*online = (ifr.ifr_flags & IFF_UP) ? true : false;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -719,7 +719,7 @@ int virNetDevGetIndex(const char *ifname, int *ifindex)
|
|||||||
# endif
|
# endif
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -836,7 +836,7 @@ int virNetDevSetIPv4Address(const char *ifname,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(addrstr);
|
VIR_FREE(addrstr);
|
||||||
VIR_FREE(bcaststr);
|
VIR_FREE(bcaststr);
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
@ -882,7 +882,7 @@ virNetDevAddRoute(const char *ifname,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(addrstr);
|
VIR_FREE(addrstr);
|
||||||
VIR_FREE(gatewaystr);
|
VIR_FREE(gatewaystr);
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
@ -930,7 +930,7 @@ int virNetDevClearIPv4Address(const char *ifname,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(addrstr);
|
VIR_FREE(addrstr);
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
return ret;
|
return ret;
|
||||||
@ -972,7 +972,7 @@ int virNetDevGetIPv4Address(const char *ifname,
|
|||||||
memcpy(&addr->data.inet4, &ifr.ifr_addr, addr->len);
|
memcpy(&addr->data.inet4, &ifr.ifr_addr, addr->len);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1151,7 +1151,7 @@ virNetDevGetVirtualFunctions(const char *pfname,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
VIR_FREE(*vfname);
|
VIR_FREE(*vfname);
|
||||||
VIR_FREE(*virt_fns);
|
VIR_FREE(*virt_fns);
|
||||||
@ -1278,7 +1278,7 @@ virNetDevGetVirtualFunctionInfo(const char *vfname, char **pfname,
|
|||||||
|
|
||||||
ret = virPCIGetVirtualFunctionIndex(pf_sysfs_path, vf_sysfs_path, vf);
|
ret = virPCIGetVirtualFunctionIndex(pf_sysfs_path, vf_sysfs_path, vf);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
VIR_FREE(*pfname);
|
VIR_FREE(*pfname);
|
||||||
|
|
||||||
@ -1445,17 +1445,17 @@ virNetDevLinkDump(const char *ifname, int ifindex,
|
|||||||
goto malformed_resp;
|
goto malformed_resp;
|
||||||
}
|
}
|
||||||
rc = 0;
|
rc = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
nlmsg_free(nl_msg);
|
nlmsg_free(nl_msg);
|
||||||
VIR_FREE(resp);
|
VIR_FREE(resp);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
malformed_resp:
|
malformed_resp:
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("malformed netlink response message"));
|
_("malformed netlink response message"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
buffer_too_small:
|
buffer_too_small:
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("allocated netlink buffer is too small"));
|
_("allocated netlink buffer is too small"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -1567,17 +1567,17 @@ virNetDevSetVfConfig(const char *ifname, int ifindex, int vf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
rc = 0;
|
rc = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
nlmsg_free(nl_msg);
|
nlmsg_free(nl_msg);
|
||||||
VIR_FREE(resp);
|
VIR_FREE(resp);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
malformed_resp:
|
malformed_resp:
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("malformed netlink response message"));
|
_("malformed netlink response message"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
buffer_too_small:
|
buffer_too_small:
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("allocated netlink buffer is too small"));
|
_("allocated netlink buffer is too small"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -1634,7 +1634,7 @@ virNetDevParseVfConfig(struct nlattr **tb, int32_t vf, virMacAddrPtr mac,
|
|||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("couldn't find IFLA_VF_INFO for VF %d "
|
_("couldn't find IFLA_VF_INFO for VF %d "
|
||||||
"in netlink response"), vf);
|
"in netlink response"), vf);
|
||||||
cleanup:
|
cleanup:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1688,7 +1688,7 @@ virNetDevReplaceVfConfig(const char *pflinkdev, int vf,
|
|||||||
ret = virNetDevSetVfConfig(pflinkdev, ifindex, vf, true,
|
ret = virNetDevSetVfConfig(pflinkdev, ifindex, vf, true,
|
||||||
macaddress, vlanid, NULL);
|
macaddress, vlanid, NULL);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(path);
|
VIR_FREE(path);
|
||||||
VIR_FREE(fileData);
|
VIR_FREE(fileData);
|
||||||
return ret;
|
return ret;
|
||||||
@ -1741,7 +1741,7 @@ virNetDevRestoreVfConfig(const char *pflinkdev, int vf,
|
|||||||
&oldmac, vlanid, NULL);
|
&oldmac, vlanid, NULL);
|
||||||
ignore_value(unlink(path));
|
ignore_value(unlink(path));
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(path);
|
VIR_FREE(path);
|
||||||
VIR_FREE(fileData);
|
VIR_FREE(fileData);
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ virNetDevBandwidthSet(const char *ifname,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
VIR_FREE(average);
|
VIR_FREE(average);
|
||||||
VIR_FREE(peak);
|
VIR_FREE(peak);
|
||||||
@ -316,7 +316,7 @@ virNetDevBandwidthCopy(virNetDevBandwidthPtr *dest,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
virNetDevBandwidthFree(*dest);
|
virNetDevBandwidthFree(*dest);
|
||||||
*dest = NULL;
|
*dest = NULL;
|
||||||
@ -465,7 +465,7 @@ virNetDevBandwidthPlug(const char *brname,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(mac[1]);
|
VIR_FREE(mac[1]);
|
||||||
VIR_FREE(mac[0]);
|
VIR_FREE(mac[0]);
|
||||||
VIR_FREE(ceil);
|
VIR_FREE(ceil);
|
||||||
@ -534,7 +534,7 @@ virNetDevBandwidthUnplug(const char *brname,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(filter_id);
|
VIR_FREE(filter_id);
|
||||||
VIR_FREE(qdisc_id);
|
VIR_FREE(qdisc_id);
|
||||||
VIR_FREE(class_id);
|
VIR_FREE(class_id);
|
||||||
@ -582,7 +582,7 @@ virNetDevBandwidthUpdateRate(const char *ifname,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
VIR_FREE(rate);
|
VIR_FREE(rate);
|
||||||
VIR_FREE(ceil);
|
VIR_FREE(ceil);
|
||||||
|
@ -103,7 +103,7 @@ static int virNetDevBridgeCmd(const char *brname,
|
|||||||
|
|
||||||
ret = ioctl(s, SIOCSDRVSPEC, &ifd);
|
ret = ioctl(s, SIOCSDRVSPEC, &ifd);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(s);
|
VIR_FORCE_CLOSE(s);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -159,7 +159,7 @@ static int virNetDevBridgeSet(const char *brname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(path);
|
VIR_FREE(path);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -213,7 +213,7 @@ static int virNetDevBridgeGet(const char *brname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(path);
|
VIR_FREE(path);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -245,7 +245,7 @@ int virNetDevBridgeCreate(const char *brname)
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -270,7 +270,7 @@ int virNetDevBridgeCreate(const char *brname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(s);
|
VIR_FORCE_CLOSE(s);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -308,7 +308,7 @@ int virNetDevBridgeDelete(const char *brname)
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -330,7 +330,7 @@ int virNetDevBridgeDelete(const char *brname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(s);
|
VIR_FORCE_CLOSE(s);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -376,7 +376,7 @@ int virNetDevBridgeAddPort(const char *brname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -446,7 +446,7 @@ int virNetDevBridgeRemovePort(const char *brname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -507,7 +507,7 @@ int virNetDevBridgeSetSTPDelay(const char *brname,
|
|||||||
ret = virNetDevBridgeSet(brname, "forward_delay", MS_TO_JIFFIES(delay),
|
ret = virNetDevBridgeSet(brname, "forward_delay", MS_TO_JIFFIES(delay),
|
||||||
fd, &ifr);
|
fd, &ifr);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -539,7 +539,7 @@ int virNetDevBridgeGetSTPDelay(const char *brname,
|
|||||||
fd, &ifr);
|
fd, &ifr);
|
||||||
*delayms = JIFFIES_TO_MS(val);
|
*delayms = JIFFIES_TO_MS(val);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -568,7 +568,7 @@ int virNetDevBridgeSetSTP(const char *brname,
|
|||||||
ret = virNetDevBridgeSet(brname, "stp_state", enable ? 1 : 0,
|
ret = virNetDevBridgeSet(brname, "stp_state", enable ? 1 : 0,
|
||||||
fd, &ifr);
|
fd, &ifr);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -599,7 +599,7 @@ int virNetDevBridgeGetSTP(const char *brname,
|
|||||||
fd, &ifr);
|
fd, &ifr);
|
||||||
*enabled = val ? true : false;
|
*enabled = val ? true : false;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -202,17 +202,17 @@ virNetDevMacVLanCreate(const char *ifname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
rc = 0;
|
rc = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
nlmsg_free(nl_msg);
|
nlmsg_free(nl_msg);
|
||||||
VIR_FREE(resp);
|
VIR_FREE(resp);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
malformed_resp:
|
malformed_resp:
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("malformed netlink response message"));
|
_("malformed netlink response message"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
buffer_too_small:
|
buffer_too_small:
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("allocated netlink buffer is too small"));
|
_("allocated netlink buffer is too small"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -279,17 +279,17 @@ int virNetDevMacVLanDelete(const char *ifname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
rc = 0;
|
rc = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
nlmsg_free(nl_msg);
|
nlmsg_free(nl_msg);
|
||||||
VIR_FREE(resp);
|
VIR_FREE(resp);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
malformed_resp:
|
malformed_resp:
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("malformed netlink response message"));
|
_("malformed netlink response message"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
buffer_too_small:
|
buffer_too_small:
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("allocated netlink buffer is too small"));
|
_("allocated netlink buffer is too small"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -786,7 +786,7 @@ virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virNetlinkCallbackDataFree(calld);
|
virNetlinkCallbackDataFree(calld);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -871,7 +871,7 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *tgifname,
|
|||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
create_name:
|
create_name:
|
||||||
retries = 5;
|
retries = 5;
|
||||||
if (virNetDevMacVLanCreateMutexInitialize() < 0)
|
if (virNetDevMacVLanCreateMutexInitialize() < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -960,7 +960,7 @@ create_name:
|
|||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
disassociate_exit:
|
disassociate_exit:
|
||||||
ignore_value(virNetDevVPortProfileDisassociate(cr_ifname,
|
ignore_value(virNetDevVPortProfileDisassociate(cr_ifname,
|
||||||
virtPortProfile,
|
virtPortProfile,
|
||||||
macaddress,
|
macaddress,
|
||||||
@ -968,7 +968,7 @@ disassociate_exit:
|
|||||||
vf,
|
vf,
|
||||||
vmOp));
|
vmOp));
|
||||||
|
|
||||||
link_del_exit:
|
link_del_exit:
|
||||||
ignore_value(virNetDevMacVLanDelete(cr_ifname));
|
ignore_value(virNetDevMacVLanDelete(cr_ifname));
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
@ -1053,7 +1053,7 @@ int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname,
|
|||||||
vmuuid,
|
vmuuid,
|
||||||
vmOp, true));
|
vmOp, true));
|
||||||
|
|
||||||
error:
|
error:
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virBufferFreeAndReset(&buf);
|
virBufferFreeAndReset(&buf);
|
||||||
VIR_FREE(attachedmac_ex_id);
|
VIR_FREE(attachedmac_ex_id);
|
||||||
VIR_FREE(ifaceid_ex_id);
|
VIR_FREE(ifaceid_ex_id);
|
||||||
@ -189,7 +189,7 @@ int virNetDevOpenvswitchRemovePort(const char *brname ATTRIBUTE_UNUSED, const ch
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -224,7 +224,7 @@ int virNetDevOpenvswitchGetMigrateData(char **migrate, const char *ifname)
|
|||||||
/* Wipeout the newline */
|
/* Wipeout the newline */
|
||||||
(*migrate)[strlen(*migrate) - 1] = '\0';
|
(*migrate)[strlen(*migrate) - 1] = '\0';
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -256,7 +256,7 @@ int virNetDevOpenvswitchSetMigrateData(char *migrate, const char *ifname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -226,7 +226,7 @@ int virNetDevTapCreate(char **ifname,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
while (i--)
|
while (i--)
|
||||||
@ -273,7 +273,7 @@ int virNetDevTapDelete(const char *ifname)
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -359,7 +359,7 @@ int virNetDevTapCreate(char **ifname,
|
|||||||
|
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(s);
|
VIR_FORCE_CLOSE(s);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -382,7 +382,7 @@ int virNetDevTapDelete(const char *ifname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(s);
|
VIR_FORCE_CLOSE(s);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -500,7 +500,7 @@ int virNetDevTapCreateInBridgePort(const char *brname,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
for (i = 0; i < tapfdSize && tapfd[i] >= 0; i++)
|
for (i = 0; i < tapfdSize && tapfd[i] >= 0; i++)
|
||||||
VIR_FORCE_CLOSE(tapfd[i]);
|
VIR_FORCE_CLOSE(tapfd[i]);
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ int virNetDevVethCreate(char** veth1, char** veth2)
|
|||||||
_("Failed to allocate free veth pair after %d attempts"),
|
_("Failed to allocate free veth pair after %d attempts"),
|
||||||
MAX_VETH_RETRIES);
|
MAX_VETH_RETRIES);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virMutexUnlock(&virNetDevVethCreateMutex);
|
virMutexUnlock(&virNetDevVethCreateMutex);
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
VIR_FREE(veth1auto);
|
VIR_FREE(veth1auto);
|
||||||
@ -237,7 +237,7 @@ int virNetDevVethDelete(const char *veth)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -434,7 +434,7 @@ int virNetDevVPortProfileMerge3(virNetDevVPortProfilePtr *result,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
VIR_FREE(*result);
|
VIR_FREE(*result);
|
||||||
return ret;
|
return ret;
|
||||||
@ -578,7 +578,7 @@ virNetDevVPortProfileGetStatus(struct nlattr **tb, int32_t vf,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cleanup:
|
cleanup:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -747,17 +747,17 @@ virNetDevVPortProfileOpSetLink(const char *ifname, int ifindex,
|
|||||||
}
|
}
|
||||||
|
|
||||||
rc = 0;
|
rc = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
nlmsg_free(nl_msg);
|
nlmsg_free(nl_msg);
|
||||||
VIR_FREE(resp);
|
VIR_FREE(resp);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
malformed_resp:
|
malformed_resp:
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("malformed netlink response message"));
|
_("malformed netlink response message"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
buffer_too_small:
|
buffer_too_small:
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("allocated netlink buffer is too small"));
|
_("allocated netlink buffer is too small"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -907,7 +907,7 @@ virNetDevVPortProfileOpCommon(const char *ifname, int ifindex,
|
|||||||
rc = -2;
|
rc = -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -1006,7 +1006,7 @@ virNetDevVPortProfileOp8021Qbg(const char *ifname,
|
|||||||
vf,
|
vf,
|
||||||
op,
|
op,
|
||||||
setlink_only);
|
setlink_only);
|
||||||
cleanup:
|
cleanup:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1109,7 +1109,7 @@ virNetDevVPortProfileOp8021Qbh(const char *ifname,
|
|||||||
rc = -1;
|
rc = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(physfndev);
|
VIR_FREE(physfndev);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -264,7 +264,7 @@ int virNetlinkCommand(struct nl_msg *nl_msg,
|
|||||||
"%s", _("nl_recv failed"));
|
"%s", _("nl_recv failed"));
|
||||||
rc = -1;
|
rc = -1;
|
||||||
}
|
}
|
||||||
error:
|
error:
|
||||||
if (rc == -1) {
|
if (rc == -1) {
|
||||||
VIR_FREE(*resp);
|
VIR_FREE(*resp);
|
||||||
*resp = NULL;
|
*resp = NULL;
|
||||||
@ -578,12 +578,12 @@ virNetlinkEventServiceStart(unsigned int protocol, unsigned int groups)
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
server[protocol] = srv;
|
server[protocol] = srv;
|
||||||
|
|
||||||
error_server:
|
error_server:
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
nl_close(srv->netlinknh);
|
nl_close(srv->netlinknh);
|
||||||
virNetlinkFree(srv->netlinknh);
|
virNetlinkFree(srv->netlinknh);
|
||||||
}
|
}
|
||||||
error_locked:
|
error_locked:
|
||||||
virNetlinkEventServerUnlock(srv);
|
virNetlinkEventServerUnlock(srv);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
virMutexDestroy(&srv->lock);
|
virMutexDestroy(&srv->lock);
|
||||||
@ -652,7 +652,7 @@ virNetlinkEventAddClient(virNetlinkEventHandleCallback handleCB,
|
|||||||
}
|
}
|
||||||
r = srv->handlesCount++;
|
r = srv->handlesCount++;
|
||||||
|
|
||||||
addentry:
|
addentry:
|
||||||
srv->handles[r].watch = nextWatch;
|
srv->handles[r].watch = nextWatch;
|
||||||
srv->handles[r].handleCB = handleCB;
|
srv->handles[r].handleCB = handleCB;
|
||||||
srv->handles[r].removeCB = removeCB;
|
srv->handles[r].removeCB = removeCB;
|
||||||
@ -667,7 +667,7 @@ addentry:
|
|||||||
VIR_DEBUG("added client to loop slot: %d. with macaddr ptr=%p", r, macaddr);
|
VIR_DEBUG("added client to loop slot: %d. with macaddr ptr=%p", r, macaddr);
|
||||||
|
|
||||||
ret = nextWatch++;
|
ret = nextWatch++;
|
||||||
error:
|
error:
|
||||||
virNetlinkEventServerUnlock(srv);
|
virNetlinkEventServerUnlock(srv);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -724,7 +724,7 @@ virNetlinkEventRemoveClient(int watch, const virMacAddr *macaddr,
|
|||||||
}
|
}
|
||||||
VIR_DEBUG("no client found to remove.");
|
VIR_DEBUG("no client found to remove.");
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virNetlinkEventServerUnlock(srv);
|
virNetlinkEventServerUnlock(srv);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ static int virNodeSuspendSetNodeWakeup(unsigned long long alarmTime)
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(setAlarmCmd);
|
virCommandFree(setAlarmCmd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -240,7 +240,7 @@ int nodeSuspendForDuration(unsigned int target,
|
|||||||
|
|
||||||
aboutToSuspend = true;
|
aboutToSuspend = true;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virNodeSuspendUnlock();
|
virNodeSuspendUnlock();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -296,7 +296,7 @@ virNodeSuspendSupportsTarget(unsigned int target, bool *supported)
|
|||||||
*supported = (status == 0);
|
*supported = (status == 0);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -349,7 +349,7 @@ virNodeSuspendGetTargetMask(unsigned int *bitmask)
|
|||||||
|
|
||||||
*bitmask = nodeSuspendTargetMask;
|
*bitmask = nodeSuspendTargetMask;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virNodeSuspendUnlock();
|
virNodeSuspendUnlock();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ virNumaSetupMemoryPolicy(virNumaTuneDef numatune,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,7 +320,7 @@ virNumaGetNodeCPUs(int node,
|
|||||||
cpumap = NULL;
|
cpumap = NULL;
|
||||||
ret = ncpus;
|
ret = ncpus;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(mask);
|
VIR_FREE(mask);
|
||||||
VIR_FREE(allonesmask);
|
VIR_FREE(allonesmask);
|
||||||
VIR_FREE(cpumap);
|
VIR_FREE(cpumap);
|
||||||
|
@ -147,7 +147,7 @@ virClassPtr virClassNew(virClassPtr parent,
|
|||||||
|
|
||||||
return klass;
|
return klass;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
VIR_FREE(klass);
|
VIR_FREE(klass);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -266,7 +266,7 @@ virPCIDeviceGetDriverPathAndName(virPCIDevicePtr dev, char **path, char **name)
|
|||||||
/* name = "${drivername}" */
|
/* name = "${drivername}" */
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(drvlink);
|
VIR_FREE(drvlink);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
VIR_FREE(*path);
|
VIR_FREE(*path);
|
||||||
@ -379,7 +379,7 @@ virPCIDeviceReadClass(virPCIDevicePtr dev, uint16_t *device_class)
|
|||||||
|
|
||||||
*device_class = (value >> 8) & 0xFFFF;
|
*device_class = (value >> 8) & 0xFFFF;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(id_str);
|
VIR_FREE(id_str);
|
||||||
VIR_FREE(path);
|
VIR_FREE(path);
|
||||||
return ret;
|
return ret;
|
||||||
@ -746,7 +746,7 @@ virPCIDeviceIsParent(virPCIDevicePtr dev, virPCIDevicePtr check, void *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virPCIDeviceConfigClose(check, fd);
|
virPCIDeviceConfigClose(check, fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -838,7 +838,7 @@ virPCIDeviceTrySecondaryBusReset(virPCIDevicePtr dev,
|
|||||||
}
|
}
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
virPCIDeviceConfigClose(parent, parentfd);
|
virPCIDeviceConfigClose(parent, parentfd);
|
||||||
virPCIDeviceFree(parent);
|
virPCIDeviceFree(parent);
|
||||||
return ret;
|
return ret;
|
||||||
@ -972,7 +972,7 @@ virPCIDeviceReset(virPCIDevicePtr dev,
|
|||||||
_("no FLR, PM reset or bus reset available"));
|
_("no FLR, PM reset or bus reset available"));
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(drvPath);
|
VIR_FREE(drvPath);
|
||||||
VIR_FREE(drvName);
|
VIR_FREE(drvName);
|
||||||
virPCIDeviceConfigClose(dev, fd);
|
virPCIDeviceConfigClose(dev, fd);
|
||||||
@ -986,7 +986,7 @@ virPCIProbeStubDriver(const char *driver)
|
|||||||
char *drvpath = NULL;
|
char *drvpath = NULL;
|
||||||
bool probed = false;
|
bool probed = false;
|
||||||
|
|
||||||
recheck:
|
recheck:
|
||||||
if (virPCIDriverDir(&drvpath, driver) == 0 && virFileExists(drvpath)) {
|
if (virPCIDriverDir(&drvpath, driver) == 0 && virFileExists(drvpath)) {
|
||||||
/* driver already loaded, return */
|
/* driver already loaded, return */
|
||||||
VIR_FREE(drvpath);
|
VIR_FREE(drvpath);
|
||||||
@ -1007,7 +1007,7 @@ recheck:
|
|||||||
goto recheck;
|
goto recheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
/* If we know failure was because of blacklist, let's report that;
|
/* If we know failure was because of blacklist, let's report that;
|
||||||
* otherwise, report a more generic failure message
|
* otherwise, report a more generic failure message
|
||||||
*/
|
*/
|
||||||
@ -1056,7 +1056,7 @@ virPCIDeviceUnbind(virPCIDevicePtr dev, bool reprobe)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(path);
|
VIR_FREE(path);
|
||||||
VIR_FREE(drvpath);
|
VIR_FREE(drvpath);
|
||||||
VIR_FREE(driver);
|
VIR_FREE(driver);
|
||||||
@ -1109,7 +1109,7 @@ virPCIDeviceUnbindFromStub(virPCIDevicePtr dev)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
dev->unbind_from_stub = false;
|
dev->unbind_from_stub = false;
|
||||||
|
|
||||||
remove_slot:
|
remove_slot:
|
||||||
if (!dev->remove_slot)
|
if (!dev->remove_slot)
|
||||||
goto reprobe;
|
goto reprobe;
|
||||||
|
|
||||||
@ -1126,7 +1126,7 @@ remove_slot:
|
|||||||
}
|
}
|
||||||
dev->remove_slot = false;
|
dev->remove_slot = false;
|
||||||
|
|
||||||
reprobe:
|
reprobe:
|
||||||
if (!dev->reprobe) {
|
if (!dev->reprobe) {
|
||||||
result = 0;
|
result = 0;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -1151,7 +1151,7 @@ reprobe:
|
|||||||
|
|
||||||
result = 0;
|
result = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
/* do not do it again */
|
/* do not do it again */
|
||||||
dev->unbind_from_stub = false;
|
dev->unbind_from_stub = false;
|
||||||
dev->remove_slot = false;
|
dev->remove_slot = false;
|
||||||
@ -1257,7 +1257,7 @@ virPCIDeviceBindToStub(virPCIDevicePtr dev,
|
|||||||
|
|
||||||
result = 0;
|
result = 0;
|
||||||
|
|
||||||
remove_id:
|
remove_id:
|
||||||
err = virSaveLastError();
|
err = virSaveLastError();
|
||||||
|
|
||||||
/* If 'remove_id' exists, remove the device id from pci-stub's dynamic
|
/* If 'remove_id' exists, remove the device id from pci-stub's dynamic
|
||||||
@ -1289,7 +1289,7 @@ remove_id:
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(stubDriverPath);
|
VIR_FREE(stubDriverPath);
|
||||||
VIR_FREE(driverLink);
|
VIR_FREE(driverLink);
|
||||||
VIR_FREE(path);
|
VIR_FREE(path);
|
||||||
@ -1534,7 +1534,7 @@ virPCIGetAddrString(unsigned int domain,
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virPCIDeviceFree(dev);
|
virPCIDeviceFree(dev);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1597,12 +1597,12 @@ virPCIDeviceNew(unsigned int domain,
|
|||||||
|
|
||||||
VIR_DEBUG("%s %s: initialized", dev->id, dev->name);
|
VIR_DEBUG("%s %s: initialized", dev->id, dev->name);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(product);
|
VIR_FREE(product);
|
||||||
VIR_FREE(vendor);
|
VIR_FREE(vendor);
|
||||||
return dev;
|
return dev;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virPCIDeviceFree(dev);
|
virPCIDeviceFree(dev);
|
||||||
dev = NULL;
|
dev = NULL;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -1629,7 +1629,7 @@ virPCIDeviceCopy(virPCIDevicePtr dev)
|
|||||||
}
|
}
|
||||||
return copy;
|
return copy;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virPCIDeviceFree(copy);
|
virPCIDeviceFree(copy);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -1938,7 +1938,7 @@ int virPCIDeviceFileIterate(virPCIDevicePtr dev,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (dir)
|
if (dir)
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
VIR_FREE(file);
|
VIR_FREE(file);
|
||||||
@ -1998,7 +1998,7 @@ virPCIDeviceAddressIOMMUGroupIterate(virPCIDeviceAddressPtr orig,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(groupPath);
|
VIR_FREE(groupPath);
|
||||||
if (groupDir)
|
if (groupDir)
|
||||||
closedir(groupDir);
|
closedir(groupDir);
|
||||||
@ -2022,7 +2022,7 @@ virPCIDeviceGetIOMMUGroupAddOne(virPCIDeviceAddressPtr newDevAddr, void *opaque)
|
|||||||
|
|
||||||
newDev = NULL; /* it's now on the list */
|
newDev = NULL; /* it's now on the list */
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virPCIDeviceFree(newDev);
|
virPCIDeviceFree(newDev);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -2051,7 +2051,7 @@ virPCIDeviceGetIOMMUGroupList(virPCIDevicePtr dev)
|
|||||||
|
|
||||||
return groupList;
|
return groupList;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virObjectUnref(groupList);
|
virObjectUnref(groupList);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -2081,7 +2081,7 @@ virPCIGetIOMMUGroupAddressesAddOne(virPCIDeviceAddressPtr newDevAddr, void *opaq
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(copyAddr);
|
VIR_FREE(copyAddr);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -2109,7 +2109,7 @@ virPCIDeviceAddressGetIOMMUGroupAddresses(virPCIDeviceAddressPtr devAddr,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2156,7 +2156,7 @@ virPCIDeviceAddressGetIOMMUGroupNum(virPCIDeviceAddressPtr addr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = groupNum;
|
ret = groupNum;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(devName);
|
VIR_FREE(devName);
|
||||||
VIR_FREE(devPath);
|
VIR_FREE(devPath);
|
||||||
VIR_FREE(groupPath);
|
VIR_FREE(groupPath);
|
||||||
@ -2191,7 +2191,7 @@ virPCIDeviceGetIOMMUGroupDev(virPCIDevicePtr dev)
|
|||||||
if (virAsprintf(&groupDev, "/dev/vfio/%s",
|
if (virAsprintf(&groupDev, "/dev/vfio/%s",
|
||||||
last_component(groupPath)) < 0)
|
last_component(groupPath)) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(devPath);
|
VIR_FREE(devPath);
|
||||||
VIR_FREE(groupPath);
|
VIR_FREE(groupPath);
|
||||||
return groupDev;
|
return groupDev;
|
||||||
@ -2241,7 +2241,7 @@ virPCIDeviceDownstreamLacksACS(virPCIDevicePtr dev)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virPCIDeviceConfigClose(dev, fd);
|
virPCIDeviceConfigClose(dev, fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -2374,7 +2374,7 @@ virPCIDeviceAddressParse(char *address,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2439,7 +2439,7 @@ virPCIGetDeviceAddressFromSysfsLink(const char *device_link,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
VIR_FREE(device_path);
|
VIR_FREE(device_path);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -2514,12 +2514,12 @@ virPCIGetVirtualFunctions(const char *sysfs_path,
|
|||||||
} while (1);
|
} while (1);
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(device_link);
|
VIR_FREE(device_link);
|
||||||
VIR_FREE(config_addr);
|
VIR_FREE(config_addr);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
for (i = 0; i < *num_virtual_functions; i++)
|
for (i = 0; i < *num_virtual_functions; i++)
|
||||||
VIR_FREE((*virtual_functions)[i]);
|
VIR_FREE((*virtual_functions)[i]);
|
||||||
VIR_FREE(*virtual_functions);
|
VIR_FREE(*virtual_functions);
|
||||||
@ -2581,7 +2581,7 @@ virPCIGetVirtualFunctionIndex(const char *pf_sysfs_device_link,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|
||||||
/* free virtual functions */
|
/* free virtual functions */
|
||||||
for (i = 0; i < num_virt_fns; i++)
|
for (i = 0; i < num_virt_fns; i++)
|
||||||
@ -2651,7 +2651,7 @@ virPCIGetNetName(char *device_link_sysfs_path, char **netname)
|
|||||||
|
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
VIR_FREE(pcidev_sysfs_net_path);
|
VIR_FREE(pcidev_sysfs_net_path);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -2681,7 +2681,7 @@ virPCIGetVirtualFunctionInfo(const char *vf_sysfs_device_path,
|
|||||||
|
|
||||||
ret = virPCIGetNetName(pf_sysfs_device_path, pfname);
|
ret = virPCIGetNetName(pf_sysfs_device_path, pfname);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(pf_config_address);
|
VIR_FREE(pf_config_address);
|
||||||
VIR_FREE(pf_sysfs_device_path);
|
VIR_FREE(pf_sysfs_device_path);
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ int virPidFileWritePath(const char *pidfile,
|
|||||||
|
|
||||||
rc = 0;
|
rc = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (VIR_CLOSE(fd) < 0)
|
if (VIR_CLOSE(fd) < 0)
|
||||||
rc = -errno;
|
rc = -errno;
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ int virPidFileWrite(const char *dir,
|
|||||||
|
|
||||||
rc = virPidFileWritePath(pidfile, pid);
|
rc = virPidFileWritePath(pidfile, pid);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(pidfile);
|
VIR_FREE(pidfile);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -150,7 +150,7 @@ int virPidFileReadPath(const char *path,
|
|||||||
*pid = pid_value;
|
*pid = pid_value;
|
||||||
rc = 0;
|
rc = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (VIR_CLOSE(fd) < 0)
|
if (VIR_CLOSE(fd) < 0)
|
||||||
rc = -errno;
|
rc = -errno;
|
||||||
|
|
||||||
@ -282,7 +282,7 @@ int virPidFileReadPathIfAlive(const char *path,
|
|||||||
|
|
||||||
ret = STREQ(resolvedBinPath, resolvedProcLink) ? 0 : -1;
|
ret = STREQ(resolvedBinPath, resolvedProcLink) ? 0 : -1;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(procPath);
|
VIR_FREE(procPath);
|
||||||
VIR_FREE(procLink);
|
VIR_FREE(procLink);
|
||||||
VIR_FREE(resolvedProcLink);
|
VIR_FREE(resolvedProcLink);
|
||||||
@ -333,7 +333,7 @@ int virPidFileReadIfAlive(const char *dir,
|
|||||||
|
|
||||||
rc = virPidFileReadPathIfAlive(pidfile, pid, binpath);
|
rc = virPidFileReadPathIfAlive(pidfile, pid, binpath);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(pidfile);
|
VIR_FREE(pidfile);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -368,7 +368,7 @@ int virPidFileDelete(const char *dir,
|
|||||||
|
|
||||||
rc = virPidFileDeletePath(pidfile);
|
rc = virPidFileDeletePath(pidfile);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(pidfile);
|
VIR_FREE(pidfile);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -469,7 +469,7 @@ int virPidFileAcquire(const char *dir,
|
|||||||
|
|
||||||
rc = virPidFileAcquirePath(pidfile, waitForLock, pid);
|
rc = virPidFileAcquirePath(pidfile, waitForLock, pid);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(pidfile);
|
VIR_FREE(pidfile);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -517,7 +517,7 @@ int virPidFileRelease(const char *dir,
|
|||||||
|
|
||||||
rc = virPidFileReleasePath(pidfile, fd);
|
rc = virPidFileReleasePath(pidfile, fd);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(pidfile);
|
VIR_FREE(pidfile);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ static int virPortAllocatorBindToPort(bool *used,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -217,7 +217,7 @@ int virPortAllocatorAcquire(virPortAllocatorPtr pa,
|
|||||||
_("Unable to find an unused port in range '%s' (%d-%d)"),
|
_("Unable to find an unused port in range '%s' (%d-%d)"),
|
||||||
pa->name, pa->start, pa->end);
|
pa->name, pa->start, pa->end);
|
||||||
}
|
}
|
||||||
cleanup:
|
cleanup:
|
||||||
virObjectUnlock(pa);
|
virObjectUnlock(pa);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -248,7 +248,7 @@ int virPortAllocatorRelease(virPortAllocatorPtr pa,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virObjectUnlock(pa);
|
virObjectUnlock(pa);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ virProcessAbort(pid_t pid)
|
|||||||
}
|
}
|
||||||
VIR_DEBUG("failed to reap child %lld, abandoning it", (long long) pid);
|
VIR_DEBUG("failed to reap child %lld, abandoning it", (long long) pid);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(tmp);
|
VIR_FREE(tmp);
|
||||||
errno = saved_errno;
|
errno = saved_errno;
|
||||||
}
|
}
|
||||||
@ -210,7 +210,7 @@ virProcessWait(pid_t pid, int *exitstatus, bool raw)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
{
|
{
|
||||||
char *st = virProcessTranslateStatus(status);
|
char *st = virProcessTranslateStatus(status);
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
@ -341,7 +341,7 @@ virProcessKillPainfully(pid_t pid, bool force)
|
|||||||
_("Failed to terminate process %lld with SIG%s"),
|
_("Failed to terminate process %lld with SIG%s"),
|
||||||
(long long)pid, signame);
|
(long long)pid, signame);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -365,7 +365,7 @@ int virProcessSetAffinity(pid_t pid, virBitmapPtr map)
|
|||||||
*
|
*
|
||||||
* http://lkml.org/lkml/2009/7/28/620
|
* http://lkml.org/lkml/2009/7/28/620
|
||||||
*/
|
*/
|
||||||
realloc:
|
realloc:
|
||||||
masklen = CPU_ALLOC_SIZE(numcpus);
|
masklen = CPU_ALLOC_SIZE(numcpus);
|
||||||
mask = CPU_ALLOC(numcpus);
|
mask = CPU_ALLOC(numcpus);
|
||||||
|
|
||||||
@ -434,7 +434,7 @@ int virProcessGetAffinity(pid_t pid,
|
|||||||
*
|
*
|
||||||
* http://lkml.org/lkml/2009/7/28/620
|
* http://lkml.org/lkml/2009/7/28/620
|
||||||
*/
|
*/
|
||||||
realloc:
|
realloc:
|
||||||
masklen = CPU_ALLOC_SIZE(numcpus);
|
masklen = CPU_ALLOC_SIZE(numcpus);
|
||||||
mask = CPU_ALLOC(numcpus);
|
mask = CPU_ALLOC(numcpus);
|
||||||
|
|
||||||
@ -591,7 +591,7 @@ int virProcessGetNamespaces(pid_t pid,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(nsfile);
|
VIR_FREE(nsfile);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
for (i = 0; i < *nfdlist; i++)
|
for (i = 0; i < *nfdlist; i++)
|
||||||
@ -856,7 +856,7 @@ int virProcessGetStartTime(pid_t pid,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virStringFreeList(tokens);
|
virStringFreeList(tokens);
|
||||||
VIR_FREE(filename);
|
VIR_FREE(filename);
|
||||||
VIR_FREE(buf);
|
VIR_FREE(buf);
|
||||||
@ -984,7 +984,7 @@ virProcessRunInMountNamespace(pid_t pid,
|
|||||||
VIR_FREE(buf);
|
VIR_FREE(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(errfd[0]);
|
VIR_FORCE_CLOSE(errfd[0]);
|
||||||
VIR_FORCE_CLOSE(errfd[1]);
|
VIR_FORCE_CLOSE(errfd[1]);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -141,7 +141,7 @@ virSCSIDeviceGetSgName(const char *sysfs_prefix,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
VIR_FREE(path);
|
VIR_FREE(path);
|
||||||
return sg;
|
return sg;
|
||||||
@ -186,7 +186,7 @@ virSCSIDeviceGetDevName(const char *sysfs_prefix,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
VIR_FREE(path);
|
VIR_FREE(path);
|
||||||
return name;
|
return name;
|
||||||
@ -256,7 +256,7 @@ virSCSIDeviceNew(const char *sysfs_prefix,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = dev;
|
ret = dev;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(sg);
|
VIR_FREE(sg);
|
||||||
VIR_FREE(vendor);
|
VIR_FREE(vendor);
|
||||||
VIR_FREE(model);
|
VIR_FREE(model);
|
||||||
@ -309,7 +309,7 @@ virSCSIDeviceSetUsedBy(virSCSIDevicePtr dev,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virSCSIDeviceUsedByInfoFree(copy);
|
virSCSIDeviceUsedByInfoFree(copy);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -430,7 +430,7 @@ sexpr_lookup_key(const struct sexpr *sexpr, const char *node)
|
|||||||
|
|
||||||
result = (struct sexpr *) sexpr;
|
result = (struct sexpr *) sexpr;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(buffer);
|
VIR_FREE(buffer);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -343,7 +343,7 @@ virSocketAddrFormatFull(const virSocketAddr *addr,
|
|||||||
|
|
||||||
return addrstr;
|
return addrstr;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -802,7 +802,7 @@ virSocketAddrPrefixToNetmask(unsigned int prefix,
|
|||||||
result = 0;
|
result = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
error:
|
error:
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,7 +317,7 @@ qcow2GetBackingStoreFormat(int *format,
|
|||||||
offset += len;
|
offset += len;
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -484,7 +484,7 @@ vmdk4GetBackingStore(char **res,
|
|||||||
|
|
||||||
ret = BACKING_STORE_OK;
|
ret = BACKING_STORE_OK;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(desc);
|
VIR_FREE(desc);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -584,7 +584,7 @@ virFindBackingFile(const char *start, bool start_is_dir, const char *path,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (combined != path)
|
if (combined != path)
|
||||||
VIR_FREE(combined);
|
VIR_FREE(combined);
|
||||||
return ret;
|
return ret;
|
||||||
@ -714,7 +714,7 @@ virStorageFileProbeFormatFromBuf(const char *path,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_DEBUG("format=%d", format);
|
VIR_DEBUG("format=%d", format);
|
||||||
return format;
|
return format;
|
||||||
}
|
}
|
||||||
@ -868,11 +868,11 @@ virStorageFileGetMetadataInternal(const char *path,
|
|||||||
VIR_STRDUP(meta->compat, "1.1") < 0)
|
VIR_STRDUP(meta->compat, "1.1") < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
ret = meta;
|
ret = meta;
|
||||||
meta = NULL;
|
meta = NULL;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virStorageFileFreeMetadata(meta);
|
virStorageFileFreeMetadata(meta);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -928,7 +928,7 @@ virStorageFileProbeFormat(const char *path, uid_t uid, gid_t gid)
|
|||||||
|
|
||||||
ret = virStorageFileProbeFormatFromBuf(path, header, len);
|
ret = virStorageFileProbeFormatFromBuf(path, header, len);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(header);
|
VIR_FREE(header);
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
|
|
||||||
@ -1004,7 +1004,7 @@ virStorageFileGetMetadataFromFDInternal(const char *path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = virStorageFileGetMetadataInternal(path, buf, len, directory, format);
|
ret = virStorageFileGetMetadataInternal(path, buf, len, directory, format);
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(buf);
|
VIR_FREE(buf);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1163,7 +1163,7 @@ virStorageFileChainGetBroken(virStorageFileMetadataPtr chain,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1248,7 +1248,7 @@ virStorageFileResize(const char *path,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1423,7 +1423,7 @@ int virStorageFileGetLVMKey(const char *path,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (*key && STREQ(*key, ""))
|
if (*key && STREQ(*key, ""))
|
||||||
VIR_FREE(*key);
|
VIR_FREE(*key);
|
||||||
|
|
||||||
@ -1473,7 +1473,7 @@ int virStorageFileGetSCSIKey(const char *path,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (*key && STREQ(*key, ""))
|
if (*key && STREQ(*key, ""))
|
||||||
VIR_FREE(*key);
|
VIR_FREE(*key);
|
||||||
|
|
||||||
@ -1550,7 +1550,7 @@ virStorageFileChainLookup(virStorageFileMetadataPtr chain, const char *start,
|
|||||||
*meta = owner->backingMeta;
|
*meta = owner->backingMeta;
|
||||||
return owner->backingStore;
|
return owner->backingStore;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
*parent = NULL;
|
*parent = NULL;
|
||||||
if (meta)
|
if (meta)
|
||||||
*meta = NULL;
|
*meta = NULL;
|
||||||
|
@ -111,7 +111,7 @@ char **virStringSplit(const char *string,
|
|||||||
|
|
||||||
return tokens;
|
return tokens;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
for (i = 0; i < ntokens; i++)
|
for (i = 0; i < ntokens; i++)
|
||||||
VIR_FREE(tokens[i]);
|
VIR_FREE(tokens[i]);
|
||||||
VIR_FREE(tokens);
|
VIR_FREE(tokens);
|
||||||
@ -743,7 +743,7 @@ virStringSearch(const char *str,
|
|||||||
|
|
||||||
ret = nmatches - 1; /* don't count the trailing null */
|
ret = nmatches - 1; /* don't count the trailing null */
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
regfree(&re);
|
regfree(&re);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
virStringFreeList(*matches);
|
virStringFreeList(*matches);
|
||||||
|
@ -239,7 +239,7 @@ virSysinfoRead(void)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
no_memory:
|
no_memory:
|
||||||
VIR_FREE(outbuf);
|
VIR_FREE(outbuf);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -325,7 +325,7 @@ virSysinfoParseProcessor(const char *base, virSysinfoDefPtr ret)
|
|||||||
VIR_FREE(processor_type);
|
VIR_FREE(processor_type);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
VIR_FREE(processor_type);
|
VIR_FREE(processor_type);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -357,7 +357,7 @@ virSysinfoRead(void)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
no_memory:
|
no_memory:
|
||||||
VIR_FREE(outbuf);
|
VIR_FREE(outbuf);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -452,7 +452,7 @@ virSysinfoParseProcessor(const char *base, virSysinfoDefPtr ret)
|
|||||||
}
|
}
|
||||||
result = 0;
|
result = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(manufacturer);
|
VIR_FREE(manufacturer);
|
||||||
VIR_FREE(procline);
|
VIR_FREE(procline);
|
||||||
return result;
|
return result;
|
||||||
@ -496,7 +496,7 @@ virSysinfoRead(void)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
no_memory:
|
no_memory:
|
||||||
virSysinfoDefFree(ret);
|
virSysinfoDefFree(ret);
|
||||||
VIR_FREE(outbuf);
|
VIR_FREE(outbuf);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -864,13 +864,13 @@ virSysinfoRead(void)
|
|||||||
if (virSysinfoParseMemory(outbuf, ret) < 0)
|
if (virSysinfoParseMemory(outbuf, ret) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(outbuf);
|
VIR_FREE(outbuf);
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virSysinfoDefFree(ret);
|
virSysinfoDefFree(ret);
|
||||||
ret = NULL;
|
ret = NULL;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -1119,6 +1119,6 @@ bool virSysinfoIsEqual(virSysinfoDefPtr src,
|
|||||||
|
|
||||||
identical = true;
|
identical = true;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
return identical;
|
return identical;
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ char *virSystemdMakeMachineName(const char *name,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(username);
|
VIR_FREE(username);
|
||||||
|
|
||||||
return machinename;
|
return machinename;
|
||||||
@ -260,7 +260,7 @@ int virSystemdCreateMachine(const char *name,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(creatorname);
|
VIR_FREE(creatorname);
|
||||||
VIR_FREE(machinename);
|
VIR_FREE(machinename);
|
||||||
VIR_FREE(slicename);
|
VIR_FREE(slicename);
|
||||||
@ -313,7 +313,7 @@ int virSystemdTerminateMachine(const char *name,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(machinename);
|
VIR_FREE(machinename);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -229,7 +229,7 @@ int virThreadCreate(virThreadPtr thread,
|
|||||||
/* New thread owns 'args' in success case, so don't free */
|
/* New thread owns 'args' in success case, so don't free */
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
pthread_attr_destroy(&attr);
|
pthread_attr_destroy(&attr);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
errno = err;
|
errno = err;
|
||||||
|
@ -147,7 +147,7 @@ static void virThreadPoolWorker(void *opaque)
|
|||||||
virMutexLock(&pool->mutex);
|
virMutexLock(&pool->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (priority)
|
if (priority)
|
||||||
pool->nPrioWorkers--;
|
pool->nPrioWorkers--;
|
||||||
else
|
else
|
||||||
@ -231,7 +231,7 @@ virThreadPoolPtr virThreadPoolNew(size_t minWorkers,
|
|||||||
|
|
||||||
return pool;
|
return pool;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
VIR_FREE(data);
|
VIR_FREE(data);
|
||||||
virThreadPoolFree(pool);
|
virThreadPoolFree(pool);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -366,7 +366,7 @@ int virThreadPoolSendJob(virThreadPoolPtr pool,
|
|||||||
virMutexUnlock(&pool->mutex);
|
virMutexUnlock(&pool->mutex);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virMutexUnlock(&pool->mutex);
|
virMutexUnlock(&pool->mutex);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,6 @@ virTPMCreateCancelPath(const char *devpath)
|
|||||||
_("Missing TPM device path"));
|
_("Missing TPM device path"));
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ virTypedParamsValidate(virTypedParameterPtr params, int nparams, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -227,7 +227,7 @@ virTypedParameterAssign(virTypedParameterPtr param, const char *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -321,7 +321,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param, const char *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -381,7 +381,7 @@ virTypedParamsReplaceString(virTypedParameterPtr *params,
|
|||||||
*nparams = n;
|
*nparams = n;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -769,7 +769,7 @@ virTypedParamsAddInt(virTypedParameterPtr *params,
|
|||||||
*nparams += 1;
|
*nparams += 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virDispatchError(NULL);
|
virDispatchError(NULL);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -817,7 +817,7 @@ virTypedParamsAddUInt(virTypedParameterPtr *params,
|
|||||||
*nparams += 1;
|
*nparams += 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virDispatchError(NULL);
|
virDispatchError(NULL);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -865,7 +865,7 @@ virTypedParamsAddLLong(virTypedParameterPtr *params,
|
|||||||
*nparams += 1;
|
*nparams += 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virDispatchError(NULL);
|
virDispatchError(NULL);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -913,7 +913,7 @@ virTypedParamsAddULLong(virTypedParameterPtr *params,
|
|||||||
*nparams += 1;
|
*nparams += 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virDispatchError(NULL);
|
virDispatchError(NULL);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -961,7 +961,7 @@ virTypedParamsAddDouble(virTypedParameterPtr *params,
|
|||||||
*nparams += 1;
|
*nparams += 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virDispatchError(NULL);
|
virDispatchError(NULL);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1009,7 +1009,7 @@ virTypedParamsAddBoolean(virTypedParameterPtr *params,
|
|||||||
*nparams += 1;
|
*nparams += 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virDispatchError(NULL);
|
virDispatchError(NULL);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1065,7 +1065,7 @@ virTypedParamsAddString(virTypedParameterPtr *params,
|
|||||||
*nparams += 1;
|
*nparams += 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virDispatchError(NULL);
|
virDispatchError(NULL);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1117,7 +1117,7 @@ virTypedParamsAddFromString(virTypedParameterPtr *params,
|
|||||||
*nparams += 1;
|
*nparams += 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virDispatchError(NULL);
|
virDispatchError(NULL);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ virURIParamAppend(virURIPtr uri,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
VIR_FREE(pname);
|
VIR_FREE(pname);
|
||||||
VIR_FREE(pvalue);
|
VIR_FREE(pvalue);
|
||||||
return -1;
|
return -1;
|
||||||
@ -210,7 +210,7 @@ virURIParse(const char *uri)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
xmlFreeURI(xmluri);
|
xmlFreeURI(xmluri);
|
||||||
virURIFree(ret);
|
virURIFree(ret);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -264,7 +264,7 @@ virURIFormat(virURIPtr uri)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(tmpserver);
|
VIR_FREE(tmpserver);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -114,7 +114,7 @@ static int virUSBSysReadFile(const char *f_name, const char *d_name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(filename);
|
VIR_FREE(filename);
|
||||||
VIR_FREE(buf);
|
VIR_FREE(buf);
|
||||||
return ret;
|
return ret;
|
||||||
@ -199,7 +199,7 @@ virUSBDeviceSearch(unsigned int vendor,
|
|||||||
}
|
}
|
||||||
ret = list;
|
ret = list;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (dir) {
|
if (dir) {
|
||||||
int saved_errno = errno;
|
int saved_errno = errno;
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
|
@ -213,7 +213,7 @@ virPipeReadUntilEOF(int outfd, int errfd,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
VIR_FREE(*outbuf);
|
VIR_FREE(*outbuf);
|
||||||
VIR_FREE(*errbuf);
|
VIR_FREE(*errbuf);
|
||||||
return -1;
|
return -1;
|
||||||
@ -649,7 +649,7 @@ char *virGetHostname(void)
|
|||||||
|
|
||||||
freeaddrinfo(info);
|
freeaddrinfo(info);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -721,7 +721,7 @@ virGetUserEnt(uid_t uid, char **name, gid_t *group, char **dir)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(strbuf);
|
VIR_FREE(strbuf);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -883,7 +883,7 @@ virGetUserIDByName(const char *name, uid_t *uid)
|
|||||||
*uid = pw->pw_uid;
|
*uid = pw->pw_uid;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(strbuf);
|
VIR_FREE(strbuf);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -963,7 +963,7 @@ virGetGroupIDByName(const char *name, gid_t *gid)
|
|||||||
*gid = gr->gr_gid;
|
*gid = gr->gr_gid;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(strbuf);
|
VIR_FREE(strbuf);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -1043,7 +1043,7 @@ virGetGroupList(uid_t uid, gid_t gid, gid_t **list)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(user);
|
VIR_FREE(user);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1426,7 +1426,7 @@ virSetUIDGIDWithCaps(uid_t uid, gid_t gid, gid_t *groups, int ngroups,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1610,7 +1610,7 @@ virSetDeviceUnprivSGIO(const char *path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(sysfs_path);
|
VIR_FREE(sysfs_path);
|
||||||
VIR_FREE(val);
|
VIR_FREE(val);
|
||||||
return ret;
|
return ret;
|
||||||
@ -1648,7 +1648,7 @@ virGetDeviceUnprivSGIO(const char *path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(sysfs_path);
|
VIR_FREE(sysfs_path);
|
||||||
VIR_FREE(buf);
|
VIR_FREE(buf);
|
||||||
return ret;
|
return ret;
|
||||||
@ -1701,7 +1701,7 @@ virReadFCHost(const char *sysfs_prefix,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(sysfs_path);
|
VIR_FREE(sysfs_path);
|
||||||
VIR_FREE(buf);
|
VIR_FREE(buf);
|
||||||
return ret;
|
return ret;
|
||||||
@ -1752,7 +1752,7 @@ virIsCapableVport(const char *sysfs_prefix,
|
|||||||
virFileExists(scsi_host_path))
|
virFileExists(scsi_host_path))
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(fc_host_path);
|
VIR_FREE(fc_host_path);
|
||||||
VIR_FREE(scsi_host_path);
|
VIR_FREE(scsi_host_path);
|
||||||
return ret;
|
return ret;
|
||||||
@ -1819,7 +1819,7 @@ virManageVport(const int parent_host,
|
|||||||
"vport create/delete failed"),
|
"vport create/delete failed"),
|
||||||
vport_name, operation_path);
|
vport_name, operation_path);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(vport_name);
|
VIR_FREE(vport_name);
|
||||||
VIR_FREE(operation_path);
|
VIR_FREE(operation_path);
|
||||||
return ret;
|
return ret;
|
||||||
@ -1913,7 +1913,7 @@ virGetFCHostNameByWWN(const char *sysfs_prefix,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
# undef READ_WWN
|
# undef READ_WWN
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
VIR_FREE(wwnn_path);
|
VIR_FREE(wwnn_path);
|
||||||
@ -2003,7 +2003,7 @@ virFindFCHostCapableVport(const char *sysfs_prefix)
|
|||||||
VIR_FREE(vports);
|
VIR_FREE(vports);
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
VIR_FREE(max_vports);
|
VIR_FREE(max_vports);
|
||||||
VIR_FREE(vports);
|
VIR_FREE(vports);
|
||||||
@ -2137,7 +2137,7 @@ virParseOwnershipIds(const char *label, uid_t *uidPtr, gid_t *gidPtr)
|
|||||||
|
|
||||||
rc = 0;
|
rc = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(tmp_label);
|
VIR_FREE(tmp_label);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -771,12 +771,12 @@ virXMLParseHelper(int domcode,
|
|||||||
(*ctxt)->node = xmlDocGetRootElement(xml);
|
(*ctxt)->node = xmlDocGetRootElement(xml);
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
xmlFreeParserCtxt(pctxt);
|
xmlFreeParserCtxt(pctxt);
|
||||||
|
|
||||||
return xml;
|
return xml;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
xmlFreeDoc(xml);
|
xmlFreeDoc(xml);
|
||||||
xml = NULL;
|
xml = NULL;
|
||||||
|
|
||||||
@ -923,7 +923,7 @@ virXMLNodeToString(xmlDocPtr doc,
|
|||||||
|
|
||||||
ignore_value(VIR_STRDUP(ret, (const char *)xmlBufferContent(xmlbuf)));
|
ignore_value(VIR_STRDUP(ret, (const char *)xmlBufferContent(xmlbuf)));
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
xmlBufferFree(xmlbuf);
|
xmlBufferFree(xmlbuf);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -1044,7 +1044,7 @@ virXMLExtractNamespaceXML(xmlNodePtr root,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (doc)
|
if (doc)
|
||||||
*doc = xmlstr;
|
*doc = xmlstr;
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user