Re: [PATCH 03/11] qemu: Implement setup of memory hotplug parameters

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

 



On Thu, Feb 19, 2015 at 04:38:28PM +0100, Peter Krempa wrote:
To enable memory hotplug the maximum memory size and slot count need to
be specified. As qemu supports now other units than mebibytes when
specifying memory, use the new interface in this case.
---
docs/formatdomain.html.in                          |  2 +-
src/qemu/qemu_command.c                            | 34 ++++++++++++++++++----
src/qemu/qemu_domain.c                             |  8 ++---
.../qemuxml2argv-memory-hotplug-nonuma.xml         | 22 ++++++++++++++
.../qemuxml2argv-memory-hotplug.args               |  6 ++++
.../qemuxml2argv-memory-hotplug.xml                | 34 ++++++++++++++++++++++
tests/qemuxml2argvtest.c                           |  4 +++
tests/qemuxml2xmltest.c                            |  3 ++
8 files changed, 102 insertions(+), 11 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nonuma.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug.xml

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 7b83f9f..d9666c3 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -8313,13 +8313,35 @@ qemuBuildCommandLine(virConnectPtr conn,
    if (qemuDomainAlignMemorySizes(def) < 0)
        goto error;

-    /* Set '-m MB' based on maxmem, because the lower 'memory' limit
-     * is set post-startup using the balloon driver. If balloon driver
-     * is not supported, then they're out of luck anyway.  Update the
-     * XML to reflect our rounding.
-     */
    virCommandAddArg(cmd, "-m");
-    virCommandAddArgFormat(cmd, "%llu", virDomainDefGetMemoryInitial(def)  / 1024);
+
+    if (def->mem.max_memory || def->mem.memory_slots) {

Bit more cofusing, having this one one place:

 (def->mem.memory_slots && def->mem.max_memory)

and this one second one:

 (def->mem.max_memory || def->mem.memory_slots)

but that's just a detail (unless we drift off and with the values and
end up with only one being set).

diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 39ed66b..92b5fc5 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1533,6 +1533,10 @@ mymain(void)
    DO_TEST_PARSE_ERROR("shmem-msi-only", NONE);
    DO_TEST("cpu-host-passthrough-features", QEMU_CAPS_KVM, QEMU_CAPS_CPU_HOST);

+    DO_TEST_FAILURE("memory-hotplug-nonuma", QEMU_CAPS_DEVICE_PC_DIMM);
+    DO_TEST_FAILURE("memory-hotplug", 0);

Use NONE instead '0', please.

ACK with this ^^ one thing change changed.

Attachment: pgp7QBs8loRM0.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]