[PATCH 2/2] conf: Rename virDomainDefGetMemoryActual to virDomainDefGetMemoryTotal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]