[libvirt] [PATCH 0/2] conf: Tweak how we calculate memory sizes

Patches that allowed to use memory hotplug without NUMA introduced a problem where the size in <memory> wouldn't be right after memory cold unplug. See patch 1/2 for explanation. Peter Krempa (2): conf: Remove pre-calculation of initial memory size conf: Rename virDomainDefGetMemoryActual to virDomainDefGetMemoryTotal src/bhyve/bhyve_driver.c | 2 +- src/conf/domain_audit.c | 2 +- src/conf/domain_conf.c | 103 ++++++++++++++++++++++++--------------------- src/conf/domain_conf.h | 5 +-- src/libvirt_private.syms | 3 +- src/libxl/libxl_driver.c | 6 +-- src/lxc/lxc_driver.c | 10 ++--- src/lxc/lxc_fuse.c | 6 +-- src/openvz/openvz_driver.c | 2 +- src/qemu/qemu_domain.c | 12 +++--- src/qemu/qemu_driver.c | 16 +++---- src/qemu/qemu_hotplug.c | 4 +- src/qemu/qemu_process.c | 4 +- src/test/test_driver.c | 6 +-- src/uml/uml_driver.c | 6 +-- src/vmware/vmware_driver.c | 2 +- src/vmx/vmx.c | 10 ++--- src/vz/vz_driver.c | 4 +- src/vz/vz_sdk.c | 6 +-- src/xen/xm_internal.c | 8 ++-- src/xenapi/xenapi_utils.c | 4 +- src/xenconfig/xen_common.c | 2 +- src/xenconfig/xen_sxpr.c | 6 +-- 23 files changed, 116 insertions(+), 113 deletions(-) -- 2.8.3

While we need to know the difference between the total memory stored in <memory> and the actual size not included in the possible memory modules we can't pre-calculate it reliably. This is due to the fact that libvirt's XML is copied via formatting and parsing the XML and the initial memory size can be reliably calculated only when certain conditions are met due to backwards compatibility. This patch removes the storage of 'initial_memory' and fixes the helpers to recalculate the initial memory size all the time from the total memory size. This conversion is possible when we also make sure that memory hotplug accounts properly for the update of the total memory size and thus the helpers for inserting and removing memory devices need to be tweaked too. This fixes a bug where a cold-plug and cold-remove of a memory device would increase the size reported in <memory> in the XML by the size of the memory device. This would happen as the persistent definition is copied before attaching the device and this would lead to the loss of data in 'initial_memory'. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1344892 --- src/conf/domain_conf.c | 85 +++++++++++++++++++++++++----------------------- src/conf/domain_conf.h | 3 -- src/libvirt_private.syms | 1 - src/qemu/qemu_domain.c | 6 ++-- 4 files changed, 49 insertions(+), 46 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9504e5f..10e9e8b 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3714,21 +3714,24 @@ virDomainDefPostParseMemory(virDomainDefPtr def, parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) numaMemory = virDomainNumaGetMemorySize(def->numa); + /* calculate the sizes of hotplug memory */ + for (i = 0; i < def->nmems; i++) + hotplugMemory += def->mems[i]->size; + if (numaMemory) { - virDomainDefSetMemoryInitial(def, numaMemory); + /* update the sizes in XML if nothing was set in the XML or ABI update + * is supported*/ + virDomainDefSetMemoryTotal(def, numaMemory + hotplugMemory); } else { - /* calculate the sizes of hotplug memory */ - for (i = 0; i < def->nmems; i++) - hotplugMemory += def->mems[i]->size; - + /* verify that the sum of memory modules doesn't exceed the total + * memory. This is necessary for virDomainDefGetMemoryInitial to work + * properly. */ if (hotplugMemory > def->mem.total_memory) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Total size of memory devices exceeds the total " "memory size")); return -1; } - - virDomainDefSetMemoryInitial(def, def->mem.total_memory - hotplugMemory); } if (virDomainDefGetMemoryInitial(def) == 0) { @@ -8041,13 +8044,18 @@ virDomainDefHasMemoryHotplug(const virDomainDef *def) * @def: domain definition * * Returns the size of the initial amount of guest memory. The initial amount - * is the memory size is either the configured amount in the <memory> element - * or the sum of memory sizes of NUMA nodes in case NUMA is enabled in @def. + * is the memory size excluding possible memory modules. */ unsigned long long virDomainDefGetMemoryInitial(const virDomainDef *def) { - return def->mem.initial_memory; + size_t i; + unsigned long long ret = def->mem.total_memory; + + for (i = 0; i < def->nmems; i++) + ret -= def->mems[i]->size; + + return ret; } @@ -8056,30 +8064,14 @@ virDomainDefGetMemoryInitial(const virDomainDef *def) * @def: domain definition * @size: size to set * - * Sets the total memory size in @def. This function should be used only by - * hypervisors that don't support memory hotplug. + * Sets the total memory size in @def. This value needs to include possible + * additional memory modules. */ void virDomainDefSetMemoryTotal(virDomainDefPtr def, unsigned long long size) { def->mem.total_memory = size; - def->mem.initial_memory = size; -} - - -/** - * virDomainDefSetMemoryInitial: - * @def: domain definition - * @size: size to set - * - * Sets the initial memory size (without memory modules) in @def. - */ -void -virDomainDefSetMemoryInitial(virDomainDefPtr def, - unsigned long long size) -{ - def->mem.initial_memory = size; } @@ -8088,21 +8080,12 @@ virDomainDefSetMemoryInitial(virDomainDefPtr def, * @def: domain definition * * Returns the current maximum memory size usable by the domain described by - * @def. This size is a sum of size returned by virDomainDefGetMemoryInitial - * and possible additional memory devices. + * @def. This size includes possible additional memory devices. */ unsigned long long virDomainDefGetMemoryActual(virDomainDefPtr def) { - unsigned long long ret; - size_t i; - - ret = def->mem.initial_memory; - - for (i = 0; i < def->nmems; i++) - ret += def->mems[i]->size; - - return ret; + return def->mem.total_memory; } @@ -14551,10 +14534,18 @@ virDomainMemoryFindInactiveByDef(virDomainDefPtr def, } +/** + * virDomainMemoryInsert: + * + * Inserts a memory device definition into the domain definition. This helper + * should be used only in hotplug cases as it's blindly modifying the total + * memory size. + */ int virDomainMemoryInsert(virDomainDefPtr def, virDomainMemoryDefPtr mem) { + unsigned long long memory = virDomainDefGetMemoryActual(def); int id = def->nmems; if (mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && @@ -14565,24 +14556,38 @@ virDomainMemoryInsert(virDomainDefPtr def, return -1; } - if (VIR_APPEND_ELEMENT(def->mems, def->nmems, mem) < 0) + if (VIR_APPEND_ELEMENT_COPY(def->mems, def->nmems, mem) < 0) return -1; + virDomainDefSetMemoryTotal(def, memory + mem->size); + return id; } +/** + * virDomainMemoryInsert: + * + * Removes a memory device definition into the domain definition. This helper + * should be used only in hotplug cases as it's blindly modifying the total + * memory size. + */ virDomainMemoryDefPtr virDomainMemoryRemove(virDomainDefPtr def, int idx) { + unsigned long long memory = virDomainDefGetMemoryActual(def); virDomainMemoryDefPtr ret = def->mems[idx]; + VIR_DELETE_ELEMENT(def->mems, idx, def->nmems); /* fix up balloon size */ if (def->mem.cur_balloon > virDomainDefGetMemoryActual(def)) def->mem.cur_balloon = virDomainDefGetMemoryActual(def); + /* fix total memory size of the domain */ + virDomainDefSetMemoryTotal(def, memory - ret->size); + return ret; } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 15f9c80..96ac510 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2070,8 +2070,6 @@ struct _virDomainMemtune { /* total memory size including memory modules in kibibytes, this field * should be accessed only via accessors */ unsigned long long total_memory; - /* initial memory size in kibibytes = total_memory excluding memory modules*/ - unsigned long long initial_memory; unsigned long long cur_balloon; /* in kibibytes, capped at ulong thanks to virDomainGetInfo */ @@ -2272,7 +2270,6 @@ virDomainVcpuInfoPtr virDomainDefGetVcpu(virDomainDefPtr def, unsigned int vcpu) unsigned long long virDomainDefGetMemoryInitial(const virDomainDef *def); void virDomainDefSetMemoryTotal(virDomainDefPtr def, unsigned long long size); -void virDomainDefSetMemoryInitial(virDomainDefPtr def, unsigned long long size); unsigned long long virDomainDefGetMemoryActual(virDomainDefPtr def); bool virDomainDefHasMemoryHotplug(const virDomainDef *def); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index e939de3..3d1716c 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -240,7 +240,6 @@ virDomainDefParseFile; virDomainDefParseNode; virDomainDefParseString; virDomainDefPostParse; -virDomainDefSetMemoryInitial; virDomainDefSetMemoryTotal; virDomainDefSetVcpus; virDomainDefSetVcpusMax; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d1f8175..8df3996 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4718,6 +4718,7 @@ qemuDomainAlignMemorySizes(virDomainDefPtr def) unsigned long long maxmemkb = virMemoryMaxValue(false) >> 10; unsigned long long maxmemcapped = virMemoryMaxValue(true) >> 10; unsigned long long initialmem = 0; + unsigned long long hotplugmem = 0; unsigned long long mem; unsigned long long align = qemuDomainGetMemorySizeAlignment(def); size_t ncells = virDomainNumaGetNodeCount(def->numa); @@ -4748,8 +4749,6 @@ qemuDomainAlignMemorySizes(virDomainDefPtr def) return -1; } - virDomainDefSetMemoryInitial(def, initialmem); - def->mem.max_memory = VIR_ROUND_UP(def->mem.max_memory, align); if (def->mem.max_memory > maxmemkb) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -4761,6 +4760,7 @@ qemuDomainAlignMemorySizes(virDomainDefPtr def) for (i = 0; i < def->nmems; i++) { align = qemuDomainGetMemoryModuleSizeAlignment(def, def->mems[i]); def->mems[i]->size = VIR_ROUND_UP(def->mems[i]->size, align); + hotplugmem += def->mems[i]->size; if (def->mems[i]->size > maxmemkb) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -4770,6 +4770,8 @@ qemuDomainAlignMemorySizes(virDomainDefPtr def) } } + virDomainDefSetMemoryTotal(def, initialmem + hotplugmem); + return 0; } -- 2.8.3

On 06/15/2016 09:56 AM, Peter Krempa wrote:
While we need to know the difference between the total memory stored in <memory> and the actual size not included in the possible memory modules we can't pre-calculate it reliably. This is due to the fact that libvirt's XML is copied via formatting and parsing the XML and the initial memory size can be reliably calculated only when certain conditions are met due to backwards compatibility.
This patch removes the storage of 'initial_memory' and fixes the helpers to recalculate the initial memory size all the time from the total memory size. This conversion is possible when we also make sure that memory hotplug accounts properly for the update of the total memory size and thus the helpers for inserting and removing memory devices need to be tweaked too.
This fixes a bug where a cold-plug and cold-remove of a memory device would increase the size reported in <memory> in the XML by the size of the memory device. This would happen as the persistent definition is copied before attaching the device and this would lead to the loss of data in 'initial_memory'.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1344892 --- src/conf/domain_conf.c | 85 +++++++++++++++++++++++++----------------------- src/conf/domain_conf.h | 3 -- src/libvirt_private.syms | 1 - src/qemu/qemu_domain.c | 6 ++-- 4 files changed, 49 insertions(+), 46 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9504e5f..10e9e8b 100644
[...]
+/** + * virDomainMemoryInsert: + * + * Inserts a memory device definition into the domain definition. This helper + * should be used only in hotplug cases as it's blindly modifying the total + * memory size. + */
A nit: I note that it's also called during the attach device config path... While yes hotplug modifies both live & config, a casual reader may mistake it for hotplug/live only. Maybe it's just me.
int virDomainMemoryInsert(virDomainDefPtr def, virDomainMemoryDefPtr mem) { + unsigned long long memory = virDomainDefGetMemoryActual(def); int id = def->nmems;
if (mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && @@ -14565,24 +14556,38 @@ virDomainMemoryInsert(virDomainDefPtr def, return -1; }
- if (VIR_APPEND_ELEMENT(def->mems, def->nmems, mem) < 0) + if (VIR_APPEND_ELEMENT_COPY(def->mems, def->nmems, mem) < 0) return -1;
+ virDomainDefSetMemoryTotal(def, memory + mem->size); + return id; }
+/** + * virDomainMemoryInsert:
s/Insert/Remove
+ * + * Removes a memory device definition into the domain definition. This helper
s/into/from/
+ * should be used only in hotplug cases as it's blindly modifying the total + * memory size. + */ virDomainMemoryDefPtr virDomainMemoryRemove(virDomainDefPtr def, int idx) { + unsigned long long memory = virDomainDefGetMemoryActual(def); virDomainMemoryDefPtr ret = def->mems[idx]; + VIR_DELETE_ELEMENT(def->mems, idx, def->nmems);
/* fix up balloon size */ if (def->mem.cur_balloon > virDomainDefGetMemoryActual(def)) def->mem.cur_balloon = virDomainDefGetMemoryActual(def);
Interesting that on the AttachDevice side there is a corollary, but the Detach device side this code does it. Whether that's a different inconsistency or problem is your call... ACK w/ the function comments changed. Your call on this balloon modification - it's just something I noted... John
+ /* fix total memory size of the domain */ + virDomainDefSetMemoryTotal(def, memory - ret->size); + return ret; }
[...]

On Thu, Jun 16, 2016 at 13:39:39 -0400, John Ferlan wrote:
On 06/15/2016 09:56 AM, Peter Krempa wrote:
While we need to know the difference between the total memory stored in <memory> and the actual size not included in the possible memory modules we can't pre-calculate it reliably. This is due to the fact that libvirt's XML is copied via formatting and parsing the XML and the initial memory size can be reliably calculated only when certain conditions are met due to backwards compatibility.
This patch removes the storage of 'initial_memory' and fixes the helpers to recalculate the initial memory size all the time from the total memory size. This conversion is possible when we also make sure that memory hotplug accounts properly for the update of the total memory size and thus the helpers for inserting and removing memory devices need to be tweaked too.
This fixes a bug where a cold-plug and cold-remove of a memory device would increase the size reported in <memory> in the XML by the size of the memory device. This would happen as the persistent definition is copied before attaching the device and this would lead to the loss of data in 'initial_memory'.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1344892 --- src/conf/domain_conf.c | 85 +++++++++++++++++++++++++----------------------- src/conf/domain_conf.h | 3 -- src/libvirt_private.syms | 1 - src/qemu/qemu_domain.c | 6 ++-- 4 files changed, 49 insertions(+), 46 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9504e5f..10e9e8b 100644
[...]
+/** + * virDomainMemoryInsert: + * + * Inserts a memory device definition into the domain definition. This helper + * should be used only in hotplug cases as it's blindly modifying the total + * memory size. + */
A nit: I note that it's also called during the attach device config path... While yes hotplug modifies both live & config, a casual reader may mistake it for hotplug/live only. Maybe it's just me.
No, the statement indeed implies just hotplug. I'll modify it to hot/cold-plug to be clear. [...]
Interesting that on the AttachDevice side there is a corollary, but the Detach device side this code does it. Whether that's a different inconsistency or problem is your call...
This is actually a valid concern. The handling of updating of the current size is still broken to some extent. I plan to address it separately though since it has semantic implications in the qemu driver.
ACK w/ the function comments changed. Your call on this balloon modification - it's just something I noted...
Thanks! Fixed && pushed.
John

--- src/bhyve/bhyve_driver.c | 2 +- src/conf/domain_audit.c | 2 +- src/conf/domain_conf.c | 22 +++++++++++----------- src/conf/domain_conf.h | 2 +- src/libvirt_private.syms | 2 +- src/libxl/libxl_driver.c | 6 +++--- src/lxc/lxc_driver.c | 10 +++++----- src/lxc/lxc_fuse.c | 6 +++--- src/openvz/openvz_driver.c | 2 +- src/qemu/qemu_domain.c | 6 +++--- src/qemu/qemu_driver.c | 16 ++++++++-------- src/qemu/qemu_hotplug.c | 4 ++-- src/qemu/qemu_process.c | 4 ++-- src/test/test_driver.c | 6 +++--- src/uml/uml_driver.c | 6 +++--- src/vmware/vmware_driver.c | 2 +- src/vmx/vmx.c | 10 +++++----- src/vz/vz_driver.c | 4 ++-- src/vz/vz_sdk.c | 6 +++--- src/xen/xm_internal.c | 8 ++++---- src/xenapi/xenapi_utils.c | 4 ++-- src/xenconfig/xen_common.c | 2 +- src/xenconfig/xen_sxpr.c | 6 +++--- 23 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index 4ed5702..8036661 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -304,7 +304,7 @@ bhyveDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) } info->state = virDomainObjGetState(vm, NULL); - info->maxMem = virDomainDefGetMemoryActual(vm->def); + info->maxMem = virDomainDefGetMemoryTotal(vm->def); info->nrVirtCpu = virDomainDefGetVcpus(vm->def); ret = 0; diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c index 36a3cf6..6ad0acb 100644 --- a/src/conf/domain_audit.c +++ b/src/conf/domain_audit.c @@ -889,7 +889,7 @@ virDomainAuditStart(virDomainObjPtr vm, const char *reason, bool success) if (vm->def->tpm) virDomainAuditTPM(vm, vm->def->tpm, "start", true); - virDomainAuditMemory(vm, 0, virDomainDefGetMemoryActual(vm->def), + virDomainAuditMemory(vm, 0, virDomainDefGetMemoryTotal(vm->def), "start", true); virDomainAuditVcpu(vm, 0, virDomainDefGetVcpus(vm->def), "start", true); if (vm->def->niothreadids) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 10e9e8b..e7f24ef 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3741,9 +3741,9 @@ virDomainDefPostParseMemory(virDomainDefPtr def, return -1; } - if (def->mem.cur_balloon > virDomainDefGetMemoryActual(def) || + if (def->mem.cur_balloon > virDomainDefGetMemoryTotal(def) || def->mem.cur_balloon == 0) - def->mem.cur_balloon = virDomainDefGetMemoryActual(def); + def->mem.cur_balloon = virDomainDefGetMemoryTotal(def); if ((def->mem.max_memory || def->mem.memory_slots) && !(def->mem.max_memory && def->mem.memory_slots)) { @@ -3754,7 +3754,7 @@ virDomainDefPostParseMemory(virDomainDefPtr def, } if (def->mem.max_memory && - def->mem.max_memory < virDomainDefGetMemoryActual(def)) { + def->mem.max_memory < virDomainDefGetMemoryTotal(def)) { virReportError(VIR_ERR_XML_ERROR, "%s", _("maximum memory size must be equal or greater than " "the actual memory size")); @@ -8076,14 +8076,14 @@ virDomainDefSetMemoryTotal(virDomainDefPtr def, /** - * virDomainDefGetMemoryActual: + * virDomainDefGetMemoryTotal: * @def: domain definition * * Returns the current maximum memory size usable by the domain described by * @def. This size includes possible additional memory devices. */ unsigned long long -virDomainDefGetMemoryActual(virDomainDefPtr def) +virDomainDefGetMemoryTotal(virDomainDefPtr def) { return def->mem.total_memory; } @@ -14545,7 +14545,7 @@ int virDomainMemoryInsert(virDomainDefPtr def, virDomainMemoryDefPtr mem) { - unsigned long long memory = virDomainDefGetMemoryActual(def); + unsigned long long memory = virDomainDefGetMemoryTotal(def); int id = def->nmems; if (mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && @@ -14576,14 +14576,14 @@ virDomainMemoryDefPtr virDomainMemoryRemove(virDomainDefPtr def, int idx) { - unsigned long long memory = virDomainDefGetMemoryActual(def); + unsigned long long memory = virDomainDefGetMemoryTotal(def); virDomainMemoryDefPtr ret = def->mems[idx]; VIR_DELETE_ELEMENT(def->mems, idx, def->nmems); /* fix up balloon size */ - if (def->mem.cur_balloon > virDomainDefGetMemoryActual(def)) - def->mem.cur_balloon = virDomainDefGetMemoryActual(def); + if (def->mem.cur_balloon > virDomainDefGetMemoryTotal(def)) + def->mem.cur_balloon = virDomainDefGetMemoryTotal(def); /* fix total memory size of the domain */ virDomainDefSetMemoryTotal(def, memory - ret->size); @@ -22818,7 +22818,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, virBufferAsprintf(buf, " dumpCore='%s'", virTristateSwitchTypeToString(def->mem.dump_core)); virBufferAsprintf(buf, " unit='KiB'>%llu</memory>\n", - virDomainDefGetMemoryActual(def)); + virDomainDefGetMemoryTotal(def)); virBufferAsprintf(buf, "<currentMemory unit='KiB'>%llu</currentMemory>\n", def->mem.cur_balloon); @@ -23714,7 +23714,7 @@ virDomainDefCompatibleDevice(virDomainDefPtr def, if (dev->type == VIR_DOMAIN_DEVICE_MEMORY) { unsigned long long sz = dev->data.memory->size; - if ((virDomainDefGetMemoryActual(def) + sz) > def->mem.max_memory) { + if ((virDomainDefGetMemoryTotal(def) + sz) > def->mem.max_memory) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Attaching memory device with size '%llu' would " "exceed domain's maxMemory config"), sz); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 96ac510..5765bb2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2270,7 +2270,7 @@ virDomainVcpuInfoPtr virDomainDefGetVcpu(virDomainDefPtr def, unsigned int vcpu) unsigned long long virDomainDefGetMemoryInitial(const virDomainDef *def); void virDomainDefSetMemoryTotal(virDomainDefPtr def, unsigned long long size); -unsigned long long virDomainDefGetMemoryActual(virDomainDefPtr def); +unsigned long long virDomainDefGetMemoryTotal(virDomainDefPtr def); bool virDomainDefHasMemoryHotplug(const virDomainDef *def); typedef enum { diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 3d1716c..277893a 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -219,8 +219,8 @@ virDomainDefFormatConvertXMLFlags; virDomainDefFormatInternal; virDomainDefFree; virDomainDefGetDefaultEmulator; -virDomainDefGetMemoryActual; virDomainDefGetMemoryInitial; +virDomainDefGetMemoryTotal; virDomainDefGetOnlineVcpumap; virDomainDefGetSecurityLabelDef; virDomainDefGetVcpu; diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index f507265..c8c1f07 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -1423,7 +1423,7 @@ libxlDomainGetMaxMemory(virDomainPtr dom) if (virDomainGetMaxMemoryEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - ret = virDomainDefGetMemoryActual(vm->def); + ret = virDomainDefGetMemoryTotal(vm->def); cleanup: if (vm) @@ -1483,7 +1483,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem, } else { /* resize the current memory */ - if (newmem > virDomainDefGetMemoryActual(vm->def)) { + if (newmem > virDomainDefGetMemoryTotal(vm->def)) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("cannot set memory higher than max memory")); goto endjob; @@ -1554,7 +1554,7 @@ libxlDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) if (!virDomainObjIsActive(vm)) { info->cpuTime = 0; info->memory = vm->def->mem.cur_balloon; - info->maxMem = virDomainDefGetMemoryActual(vm->def); + info->maxMem = virDomainDefGetMemoryTotal(vm->def); } else { libxl_dominfo_init(&d_info); diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 6894573..a3fa770 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -620,7 +620,7 @@ static int lxcDomainGetInfo(virDomainPtr dom, } } - info->maxMem = virDomainDefGetMemoryActual(vm->def); + info->maxMem = virDomainDefGetMemoryTotal(vm->def); info->nrVirtCpu = virDomainDefGetVcpus(vm->def); ret = 0; @@ -686,7 +686,7 @@ lxcDomainGetMaxMemory(virDomainPtr dom) if (virDomainGetMaxMemoryEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - ret = virDomainDefGetMemoryActual(vm->def); + ret = virDomainDefGetMemoryTotal(vm->def); cleanup: virDomainObjEndAPI(&vm); @@ -744,10 +744,10 @@ static int lxcDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem, unsigned long oldmax = 0; if (def) - oldmax = virDomainDefGetMemoryActual(def); + oldmax = virDomainDefGetMemoryTotal(def); if (persistentDef) { - if (!oldmax || oldmax > virDomainDefGetMemoryActual(persistentDef)) - oldmax = virDomainDefGetMemoryActual(persistentDef); + if (!oldmax || oldmax > virDomainDefGetMemoryTotal(persistentDef)) + oldmax = virDomainDefGetMemoryTotal(persistentDef); } if (newmem > oldmax) { diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c index 1988c19..60d4124 100644 --- a/src/lxc/lxc_fuse.c +++ b/src/lxc/lxc_fuse.c @@ -166,17 +166,17 @@ static int lxcProcReadMeminfo(char *hostpath, virDomainDefPtr def, if (STREQ(line, "MemTotal") && (virMemoryLimitIsSet(def->mem.hard_limit) || - virDomainDefGetMemoryActual(def))) { + virDomainDefGetMemoryTotal(def))) { virBufferAsprintf(new_meminfo, "MemTotal: %8llu kB\n", meminfo.memtotal); } else if (STREQ(line, "MemFree") && (virMemoryLimitIsSet(def->mem.hard_limit) || - virDomainDefGetMemoryActual(def))) { + virDomainDefGetMemoryTotal(def))) { virBufferAsprintf(new_meminfo, "MemFree: %8llu kB\n", (meminfo.memtotal - meminfo.memusage)); } else if (STREQ(line, "MemAvailable") && (virMemoryLimitIsSet(def->mem.hard_limit) || - virDomainDefGetMemoryActual(def))) { + virDomainDefGetMemoryTotal(def))) { /* MemAvailable is actually MemFree + SRReclaimable + some other bits, but MemFree is the closest approximation we have */ diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index e402e64..b66883f 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -460,7 +460,7 @@ static int openvzDomainGetInfo(virDomainPtr dom, } } - info->maxMem = virDomainDefGetMemoryActual(vm->def); + info->maxMem = virDomainDefGetMemoryTotal(vm->def); info->memory = vm->def->mem.cur_balloon; info->nrVirtCpu = virDomainDefGetVcpus(vm->def); ret = 0; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 8df3996..d1765b7 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5119,7 +5119,7 @@ qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver, /* if no balloning is available, the current size equals to the current * full memory size */ if (!virDomainDefHasMemballoon(vm->def)) { - vm->def->mem.cur_balloon = virDomainDefGetMemoryActual(vm->def); + vm->def->mem.cur_balloon = virDomainDefGetMemoryTotal(vm->def); return 0; } @@ -5204,7 +5204,7 @@ qemuDomainGetMemLockLimitBytes(virDomainDefPtr def) } } - memory = virDomainDefGetMemoryActual(def); + memory = virDomainDefGetMemoryTotal(def); if (def->mem.max_memory) maxMemory = def->mem.max_memory; @@ -5276,7 +5276,7 @@ qemuDomainGetMemLockLimitBytes(virDomainDefPtr def) * * Note that this may not be valid for all platforms. */ - memKB = virDomainDefGetMemoryActual(def) + 1024 * 1024; + memKB = virDomainDefGetMemoryTotal(def) + 1024 * 1024; done: return memKB << 10; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 52df21e..e0b3930 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2337,7 +2337,7 @@ qemuDomainGetMaxMemory(virDomainPtr dom) if (virDomainGetMaxMemoryEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - ret = virDomainDefGetMemoryActual(vm->def); + ret = virDomainDefGetMemoryTotal(vm->def); cleanup: virDomainObjEndAPI(&vm); @@ -2416,10 +2416,10 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem, unsigned long oldmax = 0; if (def) - oldmax = virDomainDefGetMemoryActual(def); + oldmax = virDomainDefGetMemoryTotal(def); if (persistentDef) { - if (!oldmax || oldmax > virDomainDefGetMemoryActual(persistentDef)) - oldmax = virDomainDefGetMemoryActual(persistentDef); + if (!oldmax || oldmax > virDomainDefGetMemoryTotal(persistentDef)) + oldmax = virDomainDefGetMemoryTotal(persistentDef); } if (newmem > oldmax) { @@ -2675,7 +2675,7 @@ qemuDomainGetInfo(virDomainPtr dom, info->state = virDomainObjGetState(vm, NULL); - maxmem = virDomainDefGetMemoryActual(vm->def); + maxmem = virDomainDefGetMemoryTotal(vm->def); if (VIR_ASSIGN_IS_OVERFLOW(info->maxMem, maxmem)) { virReportError(VIR_ERR_OVERFLOW, "%s", _("Initial memory size too large")); @@ -7897,7 +7897,7 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef, return -1; } - if (vmdef->mem.cur_balloon == virDomainDefGetMemoryActual(vmdef)) + if (vmdef->mem.cur_balloon == virDomainDefGetMemoryTotal(vmdef)) vmdef->mem.cur_balloon += dev->data.memory->size; if (virDomainMemoryInsert(vmdef, dev->data.memory) < 0) @@ -18617,7 +18617,7 @@ qemuDomainGetStatsBalloon(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, int err = 0; if (!virDomainDefHasMemballoon(dom->def)) { - cur_balloon = virDomainDefGetMemoryActual(dom->def); + cur_balloon = virDomainDefGetMemoryTotal(dom->def); } else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BALLOON_EVENT)) { cur_balloon = dom->def->mem.cur_balloon; } else { @@ -18635,7 +18635,7 @@ qemuDomainGetStatsBalloon(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, &record->nparams, maxparams, "balloon.maximum", - virDomainDefGetMemoryActual(dom->def)) < 0) + virDomainDefGetMemoryTotal(dom->def)) < 0) return -1; return 0; diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 7d05073..3ba5a1d 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1680,7 +1680,7 @@ qemuDomainAttachMemory(virQEMUDriverPtr driver, { qemuDomainObjPrivatePtr priv = vm->privateData; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); - unsigned long long oldmem = virDomainDefGetMemoryActual(vm->def); + unsigned long long oldmem = virDomainDefGetMemoryTotal(vm->def); unsigned long long newmem = oldmem + mem->size; char *devstr = NULL; char *objalias = NULL; @@ -2873,7 +2873,7 @@ qemuDomainRemoveMemoryDevice(virQEMUDriverPtr driver, virDomainMemoryDefPtr mem) { qemuDomainObjPrivatePtr priv = vm->privateData; - unsigned long long oldmem = virDomainDefGetMemoryActual(vm->def); + unsigned long long oldmem = virDomainDefGetMemoryTotal(vm->def); unsigned long long newmem = oldmem - mem->size; virObjectEventPtr event; char *backendAlias = NULL; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 01d607d..373e7a9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2043,7 +2043,7 @@ qemuProcessRefreshBalloonState(virQEMUDriverPtr driver, /* if no ballooning is available, the current size equals to the current * full memory size */ if (!virDomainDefHasMemballoon(vm->def)) { - vm->def->mem.cur_balloon = virDomainDefGetMemoryActual(vm->def); + vm->def->mem.cur_balloon = virDomainDefGetMemoryTotal(vm->def); return 0; } @@ -4854,7 +4854,7 @@ qemuProcessPrepareDomain(virConnectPtr conn, */ if (virDomainDefNeedsPlacementAdvice(vm->def)) { nodeset = virNumaGetAutoPlacementAdvice(virDomainDefGetVcpus(vm->def), - virDomainDefGetMemoryActual(vm->def)); + virDomainDefGetMemoryTotal(vm->def)); if (!nodeset) goto cleanup; diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 6ab939a..88e7362 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -1928,7 +1928,7 @@ static int testDomainGetInfo(virDomainPtr domain, info->state = virDomainObjGetState(privdom, NULL); info->memory = privdom->def->mem.cur_balloon; - info->maxMem = virDomainDefGetMemoryActual(privdom->def); + info->maxMem = virDomainDefGetMemoryTotal(privdom->def); info->nrVirtCpu = virDomainDefGetVcpus(privdom->def); info->cpuTime = ((tv.tv_sec * 1000ll * 1000ll * 1000ll) + (tv.tv_usec * 1000ll)); ret = 0; @@ -2254,7 +2254,7 @@ testDomainGetMaxMemory(virDomainPtr domain) if (!(privdom = testDomObjFromDomain(domain))) return 0; - ret = virDomainDefGetMemoryActual(privdom->def); + ret = virDomainDefGetMemoryTotal(privdom->def); virDomainObjEndAPI(&privdom); return ret; @@ -2284,7 +2284,7 @@ static int testDomainSetMemory(virDomainPtr domain, if (!(privdom = testDomObjFromDomain(domain))) return -1; - if (memory > virDomainDefGetMemoryActual(privdom->def)) { + if (memory > virDomainDefGetMemoryTotal(privdom->def)) { virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__); goto cleanup; } diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 91dcf19..b978453 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -1785,7 +1785,7 @@ umlDomainGetMaxMemory(virDomainPtr dom) if (virDomainGetMaxMemoryEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - ret = virDomainDefGetMemoryActual(vm->def); + ret = virDomainDefGetMemoryTotal(vm->def); cleanup: if (vm) @@ -1858,7 +1858,7 @@ static int umlDomainSetMemory(virDomainPtr dom, unsigned long newmem) goto cleanup; } - if (newmem > virDomainDefGetMemoryActual(vm->def)) { + if (newmem > virDomainDefGetMemoryTotal(vm->def)) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("cannot set memory higher than max memory")); goto cleanup; @@ -1905,7 +1905,7 @@ static int umlDomainGetInfo(virDomainPtr dom, } } - info->maxMem = virDomainDefGetMemoryActual(vm->def); + info->maxMem = virDomainDefGetMemoryTotal(vm->def); info->memory = vm->def->mem.cur_balloon; info->nrVirtCpu = virDomainDefGetVcpus(vm->def); ret = 0; diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index efdf7dc..eea2d1b 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -1140,7 +1140,7 @@ vmwareDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) info->state = virDomainObjGetState(vm, NULL); info->cpuTime = 0; - info->maxMem = virDomainDefGetMemoryActual(vm->def); + info->maxMem = virDomainDefGetMemoryTotal(vm->def); info->memory = vm->def->mem.cur_balloon; info->nrVirtCpu = virDomainDefGetVcpus(vm->def); ret = 0; diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 4727503..d443dd0 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -1429,8 +1429,8 @@ virVMXParseConfig(virVMXContext *ctx, def->mem.cur_balloon = sched_mem_max * 1024; /* Scale from megabytes to kilobytes */ - if (def->mem.cur_balloon > virDomainDefGetMemoryActual(def)) - def->mem.cur_balloon = virDomainDefGetMemoryActual(def); + if (def->mem.cur_balloon > virDomainDefGetMemoryTotal(def)) + def->mem.cur_balloon = virDomainDefGetMemoryTotal(def); /* vmx:sched.mem.minsize -> def:mem.min_guarantee */ if (virVMXGetConfigLong(conf, "sched.mem.minsize", &sched_mem_minsize, 0, @@ -1443,8 +1443,8 @@ virVMXParseConfig(virVMXContext *ctx, def->mem.min_guarantee = sched_mem_minsize * 1024; /* Scale from megabytes to kilobytes */ - if (def->mem.min_guarantee > virDomainDefGetMemoryActual(def)) - def->mem.min_guarantee = virDomainDefGetMemoryActual(def); + if (def->mem.min_guarantee > virDomainDefGetMemoryTotal(def)) + def->mem.min_guarantee = virDomainDefGetMemoryTotal(def); /* vmx:numvcpus -> def:vcpus */ if (virVMXGetConfigLong(conf, "numvcpus", &numvcpus, 1, true) < 0) @@ -3172,7 +3172,7 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virDomainDe /* def:mem.max_balloon -> vmx:memsize */ /* max-memory must be a multiple of 4096 kilobyte */ - max_balloon = VIR_DIV_UP(virDomainDefGetMemoryActual(def), 4096) * 4096; + max_balloon = VIR_DIV_UP(virDomainDefGetMemoryTotal(def), 4096) * 4096; virBufferAsprintf(&buffer, "memsize = \"%llu\"\n", max_balloon / 1024); /* Scale from kilobytes to megabytes */ diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index bb96fa0..2b1c0dd 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -610,7 +610,7 @@ vzDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) info->state = virDomainObjGetState(dom, NULL); info->memory = dom->def->mem.cur_balloon; - info->maxMem = virDomainDefGetMemoryActual(dom->def); + info->maxMem = virDomainDefGetMemoryTotal(dom->def); info->nrVirtCpu = virDomainDefGetVcpus(dom->def); info->cpuTime = 0; @@ -1292,7 +1292,7 @@ vzDomainGetMaxMemory(virDomainPtr domain) if (!(dom = vzDomObjFromDomain(domain))) return -1; - ret = virDomainDefGetMemoryActual(dom->def); + ret = virDomainDefGetMemoryTotal(dom->def); virObjectUnlock(dom); return ret; } diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index 99c5d4a..34432fd 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -2082,14 +2082,14 @@ prlsdkCheckUnsupportedParams(PRL_HANDLE sdkdom, virDomainDefPtr def) return -1; } - if (virDomainDefGetMemoryActual(def) != def->mem.cur_balloon) { + if (virDomainDefGetMemoryTotal(def) != def->mem.cur_balloon) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("changing balloon parameters is not supported " "by vz driver")); return -1; } - if (virDomainDefGetMemoryActual(def) % (1 << 10) != 0) { + if (virDomainDefGetMemoryTotal(def) % (1 << 10) != 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Memory size should be multiple of 1Mb.")); return -1; @@ -3599,7 +3599,7 @@ prlsdkDoApplyConfig(vzDriverPtr driver, prlsdkCheckRetGoto(pret, error); } - pret = PrlVmCfg_SetRamSize(sdkdom, virDomainDefGetMemoryActual(def) >> 10); + pret = PrlVmCfg_SetRamSize(sdkdom, virDomainDefGetMemoryTotal(def) >> 10); prlsdkCheckRetGoto(pret, error); pret = PrlVmCfg_SetCpuCount(sdkdom, virDomainDefGetVcpus(def)); diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c index 4c9dcdf..f7486b5 100644 --- a/src/xen/xm_internal.c +++ b/src/xen/xm_internal.c @@ -480,7 +480,7 @@ xenXMDomainGetInfo(virConnectPtr conn, goto error; memset(info, 0, sizeof(virDomainInfo)); - info->maxMem = virDomainDefGetMemoryActual(entry->def); + info->maxMem = virDomainDefGetMemoryTotal(entry->def); info->memory = entry->def->mem.cur_balloon; info->nrVirtCpu = virDomainDefGetVcpus(entry->def); info->state = VIR_DOMAIN_SHUTOFF; @@ -558,8 +558,8 @@ xenXMDomainSetMemory(virConnectPtr conn, goto cleanup; entry->def->mem.cur_balloon = memory; - if (entry->def->mem.cur_balloon > virDomainDefGetMemoryActual(entry->def)) - entry->def->mem.cur_balloon = virDomainDefGetMemoryActual(entry->def); + if (entry->def->mem.cur_balloon > virDomainDefGetMemoryTotal(entry->def)) + entry->def->mem.cur_balloon = virDomainDefGetMemoryTotal(entry->def); /* If this fails, should we try to undo our changes to the * in-memory representation of the config file. I say not! @@ -637,7 +637,7 @@ xenXMDomainGetMaxMemory(virConnectPtr conn, if (!(entry = virHashLookup(priv->configCache, filename))) goto cleanup; - ret = virDomainDefGetMemoryActual(entry->def); + ret = virDomainDefGetMemoryTotal(entry->def); cleanup: xenUnifiedUnlock(priv); diff --git a/src/xenapi/xenapi_utils.c b/src/xenapi/xenapi_utils.c index 5d6da36..0b16f89 100644 --- a/src/xenapi/xenapi_utils.c +++ b/src/xenapi/xenapi_utils.c @@ -499,8 +499,8 @@ createVMRecordFromXml(virConnectPtr conn, virDomainDefPtr def, if (def->mem.cur_balloon) (*record)->memory_static_max = (int64_t) (def->mem.cur_balloon * 1024); - if (virDomainDefGetMemoryActual(def)) - (*record)->memory_dynamic_max = (int64_t) (virDomainDefGetMemoryActual(def) * 1024); + if (virDomainDefGetMemoryTotal(def)) + (*record)->memory_dynamic_max = (int64_t) (virDomainDefGetMemoryTotal(def) * 1024); else (*record)->memory_dynamic_max = (*record)->memory_static_max; diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c index a568666..e2538b8 100644 --- a/src/xenconfig/xen_common.c +++ b/src/xenconfig/xen_common.c @@ -1339,7 +1339,7 @@ static int xenFormatMem(virConfPtr conf, virDomainDefPtr def) { if (xenConfigSetInt(conf, "maxmem", - VIR_DIV_UP(virDomainDefGetMemoryActual(def), 1024)) < 0) + VIR_DIV_UP(virDomainDefGetMemoryTotal(def), 1024)) < 0) return -1; if (xenConfigSetInt(conf, "memory", diff --git a/src/xenconfig/xen_sxpr.c b/src/xenconfig/xen_sxpr.c index 6c7b2c7..1631a14 100644 --- a/src/xenconfig/xen_sxpr.c +++ b/src/xenconfig/xen_sxpr.c @@ -1218,8 +1218,8 @@ xenParseSxpr(const struct sexpr *root, virDomainDefSetMemoryTotal(def, (sexpr_u64(root, "domain/maxmem") << 10)); def->mem.cur_balloon = (sexpr_u64(root, "domain/memory") << 10); - if (def->mem.cur_balloon > virDomainDefGetMemoryActual(def)) - def->mem.cur_balloon = virDomainDefGetMemoryActual(def); + if (def->mem.cur_balloon > virDomainDefGetMemoryTotal(def)) + def->mem.cur_balloon = virDomainDefGetMemoryTotal(def); if (cpus != NULL) { if (virBitmapParse(cpus, 0, &def->cpumask, @@ -2183,7 +2183,7 @@ xenFormatSxpr(virConnectPtr conn, virDomainDefPtr def) virBufferEscapeSexpr(&buf, "(name '%s')", def->name); virBufferAsprintf(&buf, "(memory %llu)(maxmem %llu)", VIR_DIV_UP(def->mem.cur_balloon, 1024), - VIR_DIV_UP(virDomainDefGetMemoryActual(def), 1024)); + VIR_DIV_UP(virDomainDefGetMemoryTotal(def), 1024)); virBufferAsprintf(&buf, "(vcpus %u)", virDomainDefGetVcpusMax(def)); /* Computing the vcpu_avail bitmask works because MAX_VIRT_CPUS is either 32, or 64 on a platform where long is big enough. */ -- 2.8.3

On 06/15/2016 09:56 AM, Peter Krempa wrote:
--- src/bhyve/bhyve_driver.c | 2 +- src/conf/domain_audit.c | 2 +- src/conf/domain_conf.c | 22 +++++++++++----------- src/conf/domain_conf.h | 2 +- src/libvirt_private.syms | 2 +- src/libxl/libxl_driver.c | 6 +++--- src/lxc/lxc_driver.c | 10 +++++----- src/lxc/lxc_fuse.c | 6 +++--- src/openvz/openvz_driver.c | 2 +- src/qemu/qemu_domain.c | 6 +++--- src/qemu/qemu_driver.c | 16 ++++++++-------- src/qemu/qemu_hotplug.c | 4 ++-- src/qemu/qemu_process.c | 4 ++-- src/test/test_driver.c | 6 +++--- src/uml/uml_driver.c | 6 +++--- src/vmware/vmware_driver.c | 2 +- src/vmx/vmx.c | 10 +++++----- src/vz/vz_driver.c | 4 ++-- src/vz/vz_sdk.c | 6 +++--- src/xen/xm_internal.c | 8 ++++---- src/xenapi/xenapi_utils.c | 4 ++-- src/xenconfig/xen_common.c | 2 +- src/xenconfig/xen_sxpr.c | 6 +++--- 23 files changed, 69 insertions(+), 69 deletions(-)
[...] ACK - however, since you're changing it, why not use "const virDomainDef *", too John
/** - * virDomainDefGetMemoryActual: + * virDomainDefGetMemoryTotal: * @def: domain definition * * Returns the current maximum memory size usable by the domain described by * @def. This size includes possible additional memory devices. */ unsigned long long -virDomainDefGetMemoryActual(virDomainDefPtr def) +virDomainDefGetMemoryTotal(virDomainDefPtr def)
const virDomainDef *def
{ return def->mem.total_memory; } @@ -14545,7 +14545,7 @@ int
[...]
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 96ac510..5765bb2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2270,7 +2270,7 @@ virDomainVcpuInfoPtr virDomainDefGetVcpu(virDomainDefPtr def, unsigned int vcpu)
unsigned long long virDomainDefGetMemoryInitial(const virDomainDef *def); void virDomainDefSetMemoryTotal(virDomainDefPtr def, unsigned long long size); -unsigned long long virDomainDefGetMemoryActual(virDomainDefPtr def); +unsigned long long virDomainDefGetMemoryTotal(virDomainDefPtr def);
const virDomainDef *def
bool virDomainDefHasMemoryHotplug(const virDomainDef *def);
[...]

On Thu, Jun 16, 2016 at 13:51:30 -0400, John Ferlan wrote:
On 06/15/2016 09:56 AM, Peter Krempa wrote:
--- src/bhyve/bhyve_driver.c | 2 +- src/conf/domain_audit.c | 2 +- src/conf/domain_conf.c | 22 +++++++++++----------- src/conf/domain_conf.h | 2 +- src/libvirt_private.syms | 2 +- src/libxl/libxl_driver.c | 6 +++--- src/lxc/lxc_driver.c | 10 +++++----- src/lxc/lxc_fuse.c | 6 +++--- src/openvz/openvz_driver.c | 2 +- src/qemu/qemu_domain.c | 6 +++--- src/qemu/qemu_driver.c | 16 ++++++++-------- src/qemu/qemu_hotplug.c | 4 ++-- src/qemu/qemu_process.c | 4 ++-- src/test/test_driver.c | 6 +++--- src/uml/uml_driver.c | 6 +++--- src/vmware/vmware_driver.c | 2 +- src/vmx/vmx.c | 10 +++++----- src/vz/vz_driver.c | 4 ++-- src/vz/vz_sdk.c | 6 +++--- src/xen/xm_internal.c | 8 ++++---- src/xenapi/xenapi_utils.c | 4 ++-- src/xenconfig/xen_common.c | 2 +- src/xenconfig/xen_sxpr.c | 6 +++--- 23 files changed, 69 insertions(+), 69 deletions(-)
[...]
ACK - however, since you're changing it, why not use "const virDomainDef *", too
Good call. I'll change it. I just run sed on git ls-files for this to happen :)
participants (2)
-
John Ferlan
-
Peter Krempa