]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Allow VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE in qemuDomainSetNumaParamsLive()
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 15 Dec 2021 15:11:28 +0000 (16:11 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 17 Dec 2021 12:18:54 +0000 (13:18 +0100)
The whole idea of VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE is that the
memory location is restricted only via CGroups and thus can be
changed on the fly (which is exactly what
qemuDomainSetNumaParamsLive() does. Allow this mode there then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
docs/formatdomain.rst
docs/manpages/virsh.rst
src/libvirt-domain.c
src/qemu/qemu_driver.c

index 51ca23aeceb9c61317a983f6101d807cbc182427..d4f30bb8af576bc0737fa0d0ec7593f84d4c8388 100644 (file)
@@ -1127,6 +1127,9 @@ NUMA Node Tuning
    will be ignored if it's specified. If ``placement`` of ``vcpu`` is 'auto',
    and ``numatune`` is not specified, a default ``numatune`` with ``placement``
    'auto' and ``mode`` 'strict' will be added implicitly. :since:`Since 0.9.3`
+   See `virDomainSetNumaParameters
+   <html/libvirt-libvirt-domain.html#virDomainSetNumaParameters>`__ for more
+   information on update of this element.
 ``memnode``
    Optional ``memnode`` elements can specify memory allocation policies per each
    guest NUMA node. For those nodes having no corresponding ``memnode`` element,
index cd739c32c437056ef8771c77639f2543ebcdfb83..baee508d04fd340c8c911d13a6bb61605cb28022 100644 (file)
@@ -3549,7 +3549,7 @@ displayed.
 \'restrictive' or any valid number from the virDomainNumatuneMemMode enum
 in case the daemon supports it.  For a running domain, the mode can't be
 changed, and the nodeset can be changed only if the domain was started with
-a mode of \`strict'.
+a mode of either \`strict' or \`restrictive'.
 
 *nodeset* is a list of numa nodes used by the host for running the domain.
 Its syntax is a comma separated list, with '-' for ranges and '^' for
index 5708ff839b06f8f7639ac5200e3710379871d880..90b8918bb5273b306985c85f299c97b3850fcaa3 100644 (file)
@@ -2182,6 +2182,14 @@ virDomainGetMemoryParameters(virDomainPtr domain,
  * Change all or a subset of the numa tunables.
  * This function may require privileged access to the hypervisor.
  *
+ * Changing live configuration may be possible only in some cases. For
+ * instance, for QEMU driver the mode (VIR_DOMAIN_NUMA_MODE) can not be
+ * changed, and changing the nodeset (VIR_DOMAIN_NUMA_NODESET) is possible
+ * only for VIR_DOMAIN_NUMATUNE_MEM_STRICT and
+ * VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE modes.
+ *
+ * Changing persistent configuration does not pose such limitations.
+ *
  * Returns -1 in case of error, 0 in case of success.
  */
 int
index bae8b7c39b606c3b9792c7feb4369cebb6438771..e884dde7217eda9db0540af38dacf029bda34ffd 100644 (file)
@@ -8777,10 +8777,10 @@ qemuDomainSetNumaParamsLive(virDomainObj *vm,
     size_t i = 0;
 
     if (virDomainNumatuneGetMode(vm->def->numa, -1, &mode) == 0 &&
-        mode != VIR_DOMAIN_NUMATUNE_MEM_STRICT) {
+        mode != VIR_DOMAIN_NUMATUNE_MEM_STRICT &&
+        mode != VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) {
         virReportError(VIR_ERR_OPERATION_INVALID, "%s",
-                       _("change of nodeset for running domain "
-                         "requires strict numa mode"));
+                       _("change of nodeset for running domain requires strict or restrictive numa mode"));
         return -1;
     }