From nobody Sun Feb 8 07:21:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1639670486; cv=none; d=zohomail.com; s=zohoarc; b=h0A3O8xnXUhGGySwHUYmFTDep6qwnFh/N58AZYBlTt3jdiAMB7spc3fs8DwLlpFq5QHKmybc95UzKrN/BkCJmZ1XsiihefJxZ6M/ylYNhhe1ctcRghIHeJPyqMPiDyvNF18lRu1zYelB4NYyQEiH/p1o2TrUggxZmb0v+SYHlMg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639670486; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WRPVpEsWYJ3JK+H3porQKtlK1uybHhhcu523jArQLgI=; b=euVy3KVc3u6Zh7SfZzMkt9DxHdnL15UvugCOx2Gh4DFmis/eE5N2skYLGt7dVqdVoggXb2SY3eA6kHlCG1zNULroHpyATi/7HEXstGrTcZWJy5MombOQv7i9lES3TaYfriPu5s9GdANqCfhWa6WEe4PxOiePzowkMzoq9s/VKZs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1639670486614311.41585550181526; Thu, 16 Dec 2021 08:01:26 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-45-LnAafd7COTWIFEV2xisHEA-1; Thu, 16 Dec 2021 11:01:21 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 007B81923B82; Thu, 16 Dec 2021 16:01:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF13C45D9A; Thu, 16 Dec 2021 16:01:14 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6DA301809CBA; Thu, 16 Dec 2021 16:01:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1BGG1ADM005502 for ; Thu, 16 Dec 2021 11:01:10 -0500 Received: by smtp.corp.redhat.com (Postfix) id 852BE1037F39; Thu, 16 Dec 2021 16:01:10 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D9031037F3F for ; Thu, 16 Dec 2021 16:01:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639670485; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=WRPVpEsWYJ3JK+H3porQKtlK1uybHhhcu523jArQLgI=; b=J+NZVNcn9aSvlpHwHjX0N0xkDoL6msLo0zPXbfTQewsDgRXIhhIE3K/S/bbI9k4vYLHACY zmE6+jMAnaVzmM4T+fdpm3k/EhUK9zollo0+B+gi+eCy5rRnh/xj4HsviAAyxhD0cb0qOi /rDbmWIZNGyNxK3oj0z61rjKpNvnqdg= X-MC-Unique: LnAafd7COTWIFEV2xisHEA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 3/6] qemu: Allow VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE in qemuDomainSetNumaParamsLive() Date: Thu, 16 Dec 2021 17:01:03 +0100 Message-Id: <83a6145198a052ff4c94f83bff7cedaba77fe882.1639670293.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1639670506221100001 Content-Type: text/plain; charset="utf-8" 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 --- docs/formatdomain.rst | 3 +++ docs/manpages/virsh.rst | 2 +- src/libvirt-domain.c | 8 ++++++++ src/qemu/qemu_driver.c | 6 +++--- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 2e9c450606..572ea15b35 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1127,6 +1127,9 @@ NUMA Node Tuning will be ignored if it's specified. If ``placement`` of ``vcpu`` is 'aut= o', and ``numatune`` is not specified, a default ``numatune`` with ``placem= ent`` 'auto' and ``mode`` 'strict' will be added implicitly. :since:`Since 0.= 9.3` + See `virDomainSetNumaParameters + `__ for mo= re + information on update of this element. ``memnode`` Optional ``memnode`` elements can specify memory allocation policies pe= r each guest NUMA node. For those nodes having no corresponding ``memnode`` el= ement, diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index cd739c32c4..baee508d04 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -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'. =20 *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 diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 5708ff839b..90b8918bb5 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -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 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index bae8b7c39b..e884dde721 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -8777,10 +8777,10 @@ qemuDomainSetNumaParamsLive(virDomainObj *vm, size_t i =3D 0; =20 if (virDomainNumatuneGetMode(vm->def->numa, -1, &mode) =3D=3D 0 && - mode !=3D VIR_DOMAIN_NUMATUNE_MEM_STRICT) { + mode !=3D VIR_DOMAIN_NUMATUNE_MEM_STRICT && + mode !=3D 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 st= rict or restrictive numa mode")); return -1; } =20 --=20 2.32.0