There's nothing domain specific about NUMA memory caches. Rename the virDomainCache* structures and enums to virNumaCache*. Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> Reviewed-by: Martin Kletzander <mkletzan@xxxxxxxxxx> --- src/conf/numa_conf.c | 40 ++++++++++++++++++++-------------------- src/conf/numa_conf.h | 28 ++++++++++++++-------------- src/libvirt_private.syms | 8 ++++---- src/qemu/qemu_command.c | 20 ++++++++++---------- 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c index 8fd5635aca..2a32b4ca06 100644 --- a/src/conf/numa_conf.c +++ b/src/conf/numa_conf.c @@ -60,15 +60,15 @@ VIR_ENUM_IMPL(virDomainMemoryAccess, "private", ); -VIR_ENUM_IMPL(virDomainCacheAssociativity, - VIR_DOMAIN_CACHE_ASSOCIATIVITY_LAST, +VIR_ENUM_IMPL(virNumaCacheAssociativity, + VIR_NUMA_CACHE_ASSOCIATIVITY_LAST, "none", "direct", "full", ); -VIR_ENUM_IMPL(virDomainCachePolicy, - VIR_DOMAIN_CACHE_POLICY_LAST, +VIR_ENUM_IMPL(virNumaCachePolicy, + VIR_NUMA_CACHE_POLICY_LAST, "none", "writeback", "writethrough", @@ -82,7 +82,7 @@ VIR_ENUM_IMPL(virDomainMemoryLatency, "write" ); -typedef struct _virDomainNumaCache virDomainNumaCache; +typedef struct _virNumaCache virNumaCache; typedef struct _virDomainNumaInterconnect virDomainNumaInterconnect; @@ -107,12 +107,12 @@ struct _virDomainNuma { virNumaDistance *distances; /* remote node distances */ size_t ndistances; - struct _virDomainNumaCache { + struct _virNumaCache { unsigned int level; /* cache level */ unsigned int size; /* cache size */ unsigned int line; /* line size, !!! in bytes !!! */ - virDomainCacheAssociativity associativity; /* cache associativity */ - virDomainCachePolicy policy; /* cache policy */ + virNumaCacheAssociativity associativity; /* cache associativity */ + virNumaCachePolicy policy; /* cache policy */ } *caches; size_t ncaches; } *mem_nodes; /* guest node configuration */ @@ -845,11 +845,11 @@ virDomainNumaDefNodeCacheParseXML(virDomainNuma *def, if ((n = virXPathNodeSet("./cache", ctxt, &nodes)) < 0) return -1; - def->mem_nodes[cur_cell].caches = g_new0(virDomainNumaCache, n); + def->mem_nodes[cur_cell].caches = g_new0(virNumaCache, n); for (i = 0; i < n; i++) { VIR_XPATH_NODE_AUTORESTORE(ctxt) - virDomainNumaCache *cache = &def->mem_nodes[cur_cell].caches[i]; + virNumaCache *cache = &def->mem_nodes[cur_cell].caches[i]; g_autofree char *tmp = NULL; unsigned int level; int associativity; @@ -883,7 +883,7 @@ virDomainNumaDefNodeCacheParseXML(virDomainNuma *def, return -1; } - if ((associativity = virDomainCacheAssociativityTypeFromString(tmp)) < 0) { + if ((associativity = virNumaCacheAssociativityTypeFromString(tmp)) < 0) { virReportError(VIR_ERR_XML_ERROR, _("Invalid cache associativity '%s'"), tmp); @@ -898,7 +898,7 @@ virDomainNumaDefNodeCacheParseXML(virDomainNuma *def, cur_cell); } - if ((policy = virDomainCachePolicyTypeFromString(tmp)) < 0) { + if ((policy = virNumaCachePolicyTypeFromString(tmp)) < 0) { virReportError(VIR_ERR_XML_ERROR, _("Invalid cache policy '%s'"), tmp); @@ -915,7 +915,7 @@ virDomainNumaDefNodeCacheParseXML(virDomainNuma *def, ctxt, &line, 1, ULLONG_MAX, true) < 0) return -1; - *cache = (virDomainNumaCache){level, size, line, associativity, policy}; + *cache = (virNumaCache){level, size, line, associativity, policy}; def->mem_nodes[cur_cell].ncaches++; } @@ -1132,17 +1132,17 @@ virDomainNumaDefFormatXML(virBuffer *buf, def->mem_nodes[i].ndistances); for (j = 0; j < def->mem_nodes[i].ncaches; j++) { - virDomainNumaCache *cache = &def->mem_nodes[i].caches[j]; + virNumaCache *cache = &def->mem_nodes[i].caches[j]; virBufferAsprintf(&childBuf, "<cache level='%u'", cache->level); if (cache->associativity) { virBufferAsprintf(&childBuf, " associativity='%s'", - virDomainCacheAssociativityTypeToString(cache->associativity)); + virNumaCacheAssociativityTypeToString(cache->associativity)); } if (cache->policy) { virBufferAsprintf(&childBuf, " policy='%s'", - virDomainCachePolicyTypeToString(cache->policy)); + virNumaCachePolicyTypeToString(cache->policy)); } virBufferAddLit(&childBuf, ">\n"); @@ -1226,7 +1226,7 @@ virDomainNumaDefValidate(const virDomainNuma *def) g_autoptr(virBitmap) levelsSeen = virBitmapNew(0); for (j = 0; j < node->ncaches; j++) { - const virDomainNumaCache *cache = &node->caches[j]; + const virNumaCache *cache = &node->caches[j]; /* Relax this if there's ever fourth layer of cache */ if (cache->level > 3) { @@ -1270,7 +1270,7 @@ virDomainNumaDefValidate(const virDomainNuma *def) if (l->cache > 0) { for (j = 0; j < def->mem_nodes[l->target].ncaches; j++) { - const virDomainNumaCache *cache = &def->mem_nodes[l->target].caches[j]; + const virNumaCache *cache = &def->mem_nodes[l->target].caches[j]; if (l->cache == cache->level) break; @@ -1712,8 +1712,8 @@ virDomainNumaGetNodeCache(const virDomainNuma *numa, unsigned int *level, unsigned int *size, unsigned int *line, - virDomainCacheAssociativity *associativity, - virDomainCachePolicy *policy) + virNumaCacheAssociativity *associativity, + virNumaCachePolicy *policy) { const virDomainNumaNode *cell; diff --git a/src/conf/numa_conf.h b/src/conf/numa_conf.h index 6682580ded..1ef6455fb5 100644 --- a/src/conf/numa_conf.h +++ b/src/conf/numa_conf.h @@ -51,22 +51,22 @@ typedef enum { VIR_ENUM_DECL(virDomainMemoryAccess); typedef enum { - VIR_DOMAIN_CACHE_ASSOCIATIVITY_NONE, /* No associativity */ - VIR_DOMAIN_CACHE_ASSOCIATIVITY_DIRECT, /* Direct mapped cache */ - VIR_DOMAIN_CACHE_ASSOCIATIVITY_FULL, /* Fully associative cache */ + VIR_NUMA_CACHE_ASSOCIATIVITY_NONE, /* No associativity */ + VIR_NUMA_CACHE_ASSOCIATIVITY_DIRECT, /* Direct mapped cache */ + VIR_NUMA_CACHE_ASSOCIATIVITY_FULL, /* Fully associative cache */ - VIR_DOMAIN_CACHE_ASSOCIATIVITY_LAST -} virDomainCacheAssociativity; -VIR_ENUM_DECL(virDomainCacheAssociativity); + VIR_NUMA_CACHE_ASSOCIATIVITY_LAST +} virNumaCacheAssociativity; +VIR_ENUM_DECL(virNumaCacheAssociativity); typedef enum { - VIR_DOMAIN_CACHE_POLICY_NONE, /* No policy */ - VIR_DOMAIN_CACHE_POLICY_WRITEBACK, /* Write-back policy */ - VIR_DOMAIN_CACHE_POLICY_WRITETHROUGH, /* Write-through policy */ + VIR_NUMA_CACHE_POLICY_NONE, /* No policy */ + VIR_NUMA_CACHE_POLICY_WRITEBACK, /* Write-back policy */ + VIR_NUMA_CACHE_POLICY_WRITETHROUGH, /* Write-through policy */ - VIR_DOMAIN_CACHE_POLICY_LAST -} virDomainCachePolicy; -VIR_ENUM_DECL(virDomainCachePolicy); + VIR_NUMA_CACHE_POLICY_LAST +} virNumaCachePolicy; +VIR_ENUM_DECL(virNumaCachePolicy); typedef enum { VIR_DOMAIN_NUMA_INTERCONNECT_TYPE_LATENCY, @@ -233,8 +233,8 @@ int virDomainNumaGetNodeCache(const virDomainNuma *numa, unsigned int *level, unsigned int *size, unsigned int *line, - virDomainCacheAssociativity *associativity, - virDomainCachePolicy *policy); + virNumaCacheAssociativity *associativity, + virNumaCachePolicy *policy); ssize_t virDomainNumaGetNodeInitiator(const virDomainNuma *numa, size_t node); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 0ced2a7990..9e9171a6d9 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -861,10 +861,6 @@ virNodeDeviceDeleteVport; virNodeDeviceGetParentName; # conf/numa_conf.h -virDomainCacheAssociativityTypeFromString; -virDomainCacheAssociativityTypeToString; -virDomainCachePolicyTypeFromString; -virDomainCachePolicyTypeToString; virDomainMemoryAccessTypeFromString; virDomainMemoryAccessTypeToString; virDomainMemoryLatencyTypeFromString; @@ -913,6 +909,10 @@ virDomainNumatunePlacementTypeFromString; virDomainNumatunePlacementTypeToString; virDomainNumatuneSet; virDomainNumatuneSpecifiedMaxNode; +virNumaCacheAssociativityTypeFromString; +virNumaCacheAssociativityTypeToString; +virNumaCachePolicyTypeFromString; +virNumaCachePolicyTypeToString; virNumaDistanceFormat; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 7834fc2130..c3523c25c7 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7198,8 +7198,8 @@ qemuBuilNumaCellCache(virCommand *cmd, unsigned int level; unsigned int size; unsigned int line; - virDomainCacheAssociativity associativity; - virDomainCachePolicy policy; + virNumaCacheAssociativity associativity; + virNumaCachePolicy policy; if (virDomainNumaGetNodeCache(def->numa, cell, i, &level, &size, &line, @@ -7214,30 +7214,30 @@ qemuBuilNumaCellCache(virCommand *cmd, cell, size, level); switch (associativity) { - case VIR_DOMAIN_CACHE_ASSOCIATIVITY_NONE: + case VIR_NUMA_CACHE_ASSOCIATIVITY_NONE: virBufferAddLit(&buf, ",associativity=none"); break; - case VIR_DOMAIN_CACHE_ASSOCIATIVITY_DIRECT: + case VIR_NUMA_CACHE_ASSOCIATIVITY_DIRECT: virBufferAddLit(&buf, ",associativity=direct"); break; - case VIR_DOMAIN_CACHE_ASSOCIATIVITY_FULL: + case VIR_NUMA_CACHE_ASSOCIATIVITY_FULL: virBufferAddLit(&buf, ",associativity=complex"); break; - case VIR_DOMAIN_CACHE_ASSOCIATIVITY_LAST: + case VIR_NUMA_CACHE_ASSOCIATIVITY_LAST: break; } switch (policy) { - case VIR_DOMAIN_CACHE_POLICY_NONE: + case VIR_NUMA_CACHE_POLICY_NONE: virBufferAddLit(&buf, ",policy=none"); break; - case VIR_DOMAIN_CACHE_POLICY_WRITEBACK: + case VIR_NUMA_CACHE_POLICY_WRITEBACK: virBufferAddLit(&buf, ",policy=write-back"); break; - case VIR_DOMAIN_CACHE_POLICY_WRITETHROUGH: + case VIR_NUMA_CACHE_POLICY_WRITETHROUGH: virBufferAddLit(&buf, ",policy=write-through"); break; - case VIR_DOMAIN_CACHE_POLICY_LAST: + case VIR_NUMA_CACHE_POLICY_LAST: break; } -- 2.31.1