Re: [PATCH 02/11] conf: Add support for parsing and formatting max memory and slot count

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

 



On Thu, Feb 19, 2015 at 04:38:27PM +0100, Peter Krempa wrote:
Add a XML element that will allow to specify maximum supportable memory
and the count of memory slots to use with memory hotplug.

To avoid possible confusion and misuse of the new element this patch
also explicitly forbids the use of the maxMemory setting in individual
drivers's post parse callbacks. This limitation will be lifted when the
support will be implemented.

s/will be/is/ ?  I'm always unsure when it comes to such "details" :)

---
docs/formatdomain.html.in            | 19 +++++++++++
docs/schemas/domaincommon.rng        |  8 +++++
src/bhyve/bhyve_domain.c             |  4 +++
src/conf/domain_conf.c               | 66 ++++++++++++++++++++++++++++++++++++
src/conf/domain_conf.h               |  7 ++++
src/libvirt_private.syms             |  1 +
src/libxl/libxl_domain.c             |  5 +++
src/lxc/lxc_domain.c                 |  4 +++
src/openvz/openvz_driver.c           | 11 ++++--
src/parallels/parallels_driver.c     |  6 +++-
src/phyp/phyp_driver.c               |  6 +++-
src/qemu/qemu_domain.c               |  4 +++
src/uml/uml_driver.c                 |  6 +++-
src/vbox/vbox_common.c               |  6 +++-
src/vmware/vmware_driver.c           |  6 +++-
src/vmx/vmx.c                        |  6 +++-
src/xen/xen_driver.c                 |  4 +++
src/xenapi/xenapi_driver.c           |  6 +++-
tests/domainschemadata/maxMemory.xml | 19 +++++++++++
19 files changed, 185 insertions(+), 9 deletions(-)
create mode 100644 tests/domainschemadata/maxMemory.xml

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a4cb930..fb35880 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3194,6 +3215,22 @@ virDomainDefPostParseInternal(virDomainDefPtr def,
        def->mem.cur_balloon = virDomainDefGetMemoryCurrent(def);
    }

+    if ((def->mem.max_memory || def->mem.memory_slots) &&
+        !(def->mem.max_memory && def->mem.memory_slots)) {
+        virReportError(VIR_ERR_XML_ERROR, "%s",
+                       _("both maximum memory size and "
+                         "memory slot count must be sepcified"));

s/sepcified/specified/

@@ -19701,6 +19761,12 @@ virDomainDefFormatInternal(virDomainDefPtr def,
        xmlIndentTreeOutput = oldIndentTreeOutput;
    }

+    if (def->mem.memory_slots && def->mem.max_memory) {

Another dead code, but I like this one because it makes sure all the
coverities etc. will not misunderstand the code.

visual-based ACK,

Martin

Attachment: pgpClK5RT88n1.pgp
Description: PGP signature

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