提交 f7c7f8ea 编写于 作者: B Bing Niu 提交者: John Ferlan

util: Rename some functions of virresctrl

Some functions in virresctrl are for CAT only, while some of other
functions are for resource allocation, not just CAT. So change
their names to reflect the reality.
Signed-off-by: NBing Niu <bing.niu@intel.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 1077b46d
...@@ -19141,7 +19141,7 @@ virDomainCachetuneDefParseCache(xmlXPathContextPtr ctxt, ...@@ -19141,7 +19141,7 @@ virDomainCachetuneDefParseCache(xmlXPathContextPtr ctxt,
ULLONG_MAX, true) < 0) ULLONG_MAX, true) < 0)
goto cleanup; goto cleanup;
if (virResctrlAllocSetSize(alloc, level, type, cache, size) < 0) if (virResctrlAllocSetCacheSize(alloc, level, type, cache, size) < 0)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
...@@ -27097,9 +27097,9 @@ virDomainCachetuneDefFormat(virBufferPtr buf, ...@@ -27097,9 +27097,9 @@ virDomainCachetuneDefFormat(virBufferPtr buf,
int ret = -1; int ret = -1;
virBufferSetChildIndent(&childrenBuf, buf); virBufferSetChildIndent(&childrenBuf, buf);
virResctrlAllocForeachSize(cachetune->alloc, virResctrlAllocForeachCache(cachetune->alloc,
virDomainCachetuneDefFormatHelper, virDomainCachetuneDefFormatHelper,
&childrenBuf); &childrenBuf);
if (virBufferCheckError(&childrenBuf) < 0) if (virBufferCheckError(&childrenBuf) < 0)
......
...@@ -2647,14 +2647,14 @@ virCacheTypeToString; ...@@ -2647,14 +2647,14 @@ virCacheTypeToString;
virResctrlAllocAddPID; virResctrlAllocAddPID;
virResctrlAllocCreate; virResctrlAllocCreate;
virResctrlAllocDeterminePath; virResctrlAllocDeterminePath;
virResctrlAllocForeachSize; virResctrlAllocForeachCache;
virResctrlAllocFormat; virResctrlAllocFormat;
virResctrlAllocGetID; virResctrlAllocGetID;
virResctrlAllocGetUnused; virResctrlAllocGetUnused;
virResctrlAllocNew; virResctrlAllocNew;
virResctrlAllocRemove; virResctrlAllocRemove;
virResctrlAllocSetCacheSize;
virResctrlAllocSetID; virResctrlAllocSetID;
virResctrlAllocSetSize;
virResctrlInfoGetCache; virResctrlInfoGetCache;
virResctrlInfoNew; virResctrlInfoNew;
......
...@@ -754,11 +754,11 @@ virResctrlAllocCheckCollision(virResctrlAllocPtr alloc, ...@@ -754,11 +754,11 @@ virResctrlAllocCheckCollision(virResctrlAllocPtr alloc,
int int
virResctrlAllocSetSize(virResctrlAllocPtr alloc, virResctrlAllocSetCacheSize(virResctrlAllocPtr alloc,
unsigned int level, unsigned int level,
virCacheType type, virCacheType type,
unsigned int cache, unsigned int cache,
unsigned long long size) unsigned long long size)
{ {
if (virResctrlAllocCheckCollision(alloc, level, type, cache)) { if (virResctrlAllocCheckCollision(alloc, level, type, cache)) {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
...@@ -773,9 +773,9 @@ virResctrlAllocSetSize(virResctrlAllocPtr alloc, ...@@ -773,9 +773,9 @@ virResctrlAllocSetSize(virResctrlAllocPtr alloc,
int int
virResctrlAllocForeachSize(virResctrlAllocPtr alloc, virResctrlAllocForeachCache(virResctrlAllocPtr alloc,
virResctrlAllocForeachSizeCallback cb, virResctrlAllocForeachCacheCallback cb,
void *opaque) void *opaque)
{ {
int ret = 0; int ret = 0;
unsigned int level = 0; unsigned int level = 0;
...@@ -939,9 +939,9 @@ virResctrlAllocParseProcessCache(virResctrlInfoPtr resctrl, ...@@ -939,9 +939,9 @@ virResctrlAllocParseProcessCache(virResctrlInfoPtr resctrl,
static int static int
virResctrlAllocParseProcessLine(virResctrlInfoPtr resctrl, virResctrlAllocParseCacheLine(virResctrlInfoPtr resctrl,
virResctrlAllocPtr alloc, virResctrlAllocPtr alloc,
char *line) char *line)
{ {
char **caches = NULL; char **caches = NULL;
char *tmp = NULL; char *tmp = NULL;
...@@ -1009,7 +1009,7 @@ virResctrlAllocParse(virResctrlInfoPtr resctrl, ...@@ -1009,7 +1009,7 @@ virResctrlAllocParse(virResctrlInfoPtr resctrl,
lines = virStringSplitCount(schemata, "\n", 0, &nlines); lines = virStringSplitCount(schemata, "\n", 0, &nlines);
for (i = 0; i < nlines; i++) { for (i = 0; i < nlines; i++) {
if (virResctrlAllocParseProcessLine(resctrl, alloc, lines[i]) < 0) if (virResctrlAllocParseCacheLine(resctrl, alloc, lines[i]) < 0)
goto cleanup; goto cleanup;
} }
...@@ -1401,8 +1401,8 @@ virResctrlAllocCopyMasks(virResctrlAllocPtr dst, ...@@ -1401,8 +1401,8 @@ virResctrlAllocCopyMasks(virResctrlAllocPtr dst,
* transforming `sizes` into `masks`. * transforming `sizes` into `masks`.
*/ */
static int static int
virResctrlAllocMasksAssign(virResctrlInfoPtr resctrl, virResctrlAllocAssign(virResctrlInfoPtr resctrl,
virResctrlAllocPtr alloc) virResctrlAllocPtr alloc)
{ {
int ret = -1; int ret = -1;
unsigned int level = 0; unsigned int level = 0;
...@@ -1526,7 +1526,7 @@ virResctrlAllocCreate(virResctrlInfoPtr resctrl, ...@@ -1526,7 +1526,7 @@ virResctrlAllocCreate(virResctrlInfoPtr resctrl,
if (lockfd < 0) if (lockfd < 0)
goto cleanup; goto cleanup;
if (virResctrlAllocMasksAssign(resctrl, alloc) < 0) if (virResctrlAllocAssign(resctrl, alloc) < 0)
goto cleanup; goto cleanup;
alloc_str = virResctrlAllocFormat(alloc); alloc_str = virResctrlAllocFormat(alloc);
......
...@@ -67,11 +67,11 @@ virResctrlInfoGetCache(virResctrlInfoPtr resctrl, ...@@ -67,11 +67,11 @@ virResctrlInfoGetCache(virResctrlInfoPtr resctrl,
typedef struct _virResctrlAlloc virResctrlAlloc; typedef struct _virResctrlAlloc virResctrlAlloc;
typedef virResctrlAlloc *virResctrlAllocPtr; typedef virResctrlAlloc *virResctrlAllocPtr;
typedef int virResctrlAllocForeachSizeCallback(unsigned int level, typedef int virResctrlAllocForeachCacheCallback(unsigned int level,
virCacheType type, virCacheType type,
unsigned int cache, unsigned int cache,
unsigned long long size, unsigned long long size,
void *opaque); void *opaque);
virResctrlAllocPtr virResctrlAllocPtr
virResctrlAllocNew(void); virResctrlAllocNew(void);
...@@ -80,16 +80,16 @@ bool ...@@ -80,16 +80,16 @@ bool
virResctrlAllocIsEmpty(virResctrlAllocPtr alloc); virResctrlAllocIsEmpty(virResctrlAllocPtr alloc);
int int
virResctrlAllocSetSize(virResctrlAllocPtr alloc, virResctrlAllocSetCacheSize(virResctrlAllocPtr alloc,
unsigned int level, unsigned int level,
virCacheType type, virCacheType type,
unsigned int cache, unsigned int cache,
unsigned long long size); unsigned long long size);
int int
virResctrlAllocForeachSize(virResctrlAllocPtr alloc, virResctrlAllocForeachCache(virResctrlAllocPtr alloc,
virResctrlAllocForeachSizeCallback cb, virResctrlAllocForeachCacheCallback cb,
void *opaque); void *opaque);
int int
virResctrlAllocSetID(virResctrlAllocPtr alloc, virResctrlAllocSetID(virResctrlAllocPtr alloc,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册