]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Forbid setting maximum memory size with the API with NUMA enabled
authorPeter Krempa <pkrempa@redhat.com>
Tue, 17 Feb 2015 15:53:25 +0000 (16:53 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 2 Mar 2015 15:41:32 +0000 (16:41 +0100)
NUMA enabled guest configuration explicitly specifies memory sizes for
individual nodes. Allowing the virDomainSetMemoryFlags API (and friends)
to change the total doesn't make sense as the individual node configs
are not updated in that case.

Forbid use of the API in case NUMA is specified.

src/qemu/qemu_driver.c
tools/virsh.pod

index 83a4e18ae662f436025fd20986a4501dd526bea6..e59f501c6d921342dbab2026a2b86834d826b068 100644 (file)
@@ -2308,6 +2308,16 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
         if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
             /* Help clang 2.8 decipher the logic flow.  */
             sa_assert(persistentDef);
+
+            /* resizing memory with NUMA nodes specified doesn't work as there
+             * is no way to change the individual node sizes with this API */
+            if (virDomainNumaGetNodeCount(persistentDef->numa) > 0) {
+                virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+                               _("maximum memory size of a domain with NUMA "
+                                 "nodes cannot be modified with this API"));
+                goto endjob;
+            }
+
             persistentDef->mem.max_balloon = newmem;
             if (persistentDef->mem.cur_balloon > newmem)
                 persistentDef->mem.cur_balloon = newmem;
index 85ce257f7155d5f85492c03aba8002cb83490af6..7c927a5e43c07a01570da0a078587a7f53313e1a 100644 (file)
@@ -1938,7 +1938,10 @@ exclusive. If no flag is specified, behavior is different depending
 on hypervisor.
 
 Some hypervisors such as QEMU/KVM don't support live changes (especially
-increasing) of the maximum memory limit.
+increasing) of the maximum memory limit.  Even persistent configuration changes
+might not be performed with some hypervisors/configuration (e.g. on NUMA enabled
+domains on QEMU).  For complex configuration changes use command B<edit>
+instead).
 
 I<size> is a scaled integer (see B<NOTES> above); it defaults to kibibytes
 (blocks of 1024 bytes) unless you provide a suffix (and the older option