diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 9b7fbb080b..5475c073d3 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -496,7 +496,7 @@ virCPUDefParseXML(xmlNodePtr node, goto error; } - ret = virStrToLong_ui(memory, NULL, 10, &def->cells[cur_cell].mem); + ret = virStrToLong_ull(memory, NULL, 10, &def->cells[cur_cell].mem); if (ret == -1) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Invalid 'memory' attribute in NUMA cell")); @@ -702,7 +702,7 @@ virCPUDefFormatBuf(virBufferPtr buf, virBufferAddLit(buf, "cells[i].cpustr); - virBufferAsprintf(buf, " memory='%d'", def->cells[i].mem); + virBufferAsprintf(buf, " memory='%llu'", def->cells[i].mem); if (memAccess) virBufferAsprintf(buf, " memAccess='%s'", virMemAccessTypeToString(memAccess)); diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h index d45210be3e..5bcf10178b 100644 --- a/src/conf/cpu_conf.h +++ b/src/conf/cpu_conf.h @@ -105,7 +105,7 @@ typedef virCellDef *virCellDefPtr; struct _virCellDef { virBitmapPtr cpumask; /* CPUs that are part of this node */ char *cpustr; /* CPUs stored in string form for dumpxml */ - unsigned int mem; /* Node memory in kB */ + unsigned long long mem; /* Node memory in kB */ virMemAccess memAccess; }; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 917639e0db..13b54dd02f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6693,7 +6693,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, } for (i = 0; i < def->cpu->ncells; i++) { - int cellmem = VIR_DIV_UP(def->cpu->cells[i].mem, 1024); + unsigned long long cellmem = VIR_DIV_UP(def->cpu->cells[i].mem, 1024); def->cpu->cells[i].mem = cellmem * 1024; virMemAccess memAccess = def->cpu->cells[i].memAccess; @@ -6799,7 +6799,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, virBufferAddLit(&buf, "memory-backend-ram"); } - virBufferAsprintf(&buf, ",size=%dM,id=ram-node%zu", cellmem, i); + virBufferAsprintf(&buf, ",size=%lluM,id=ram-node%zu", cellmem, i); if (virDomainNumatuneMaybeFormatNodeset(def->numatune, nodeset, &nodemask, i) < 0) @@ -6849,7 +6849,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE)) { virBufferAsprintf(&buf, ",memdev=ram-node%zu", i); } else { - virBufferAsprintf(&buf, ",mem=%d", cellmem); + virBufferAsprintf(&buf, ",mem=%llu", cellmem); } virCommandAddArgBuffer(cmd, &buf);