From nobody Mon Feb 9 01:21:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1655992714; cv=none; d=zohomail.com; s=zohoarc; b=B5grKRWgEEXrnIwX/PB0rgbWtjsEta2j7bONDk0WzziTokiu+Itmeb2rTPvz1KoLGFcTQwQo7xWtxIN+1EH8lotcNP+JJuWMppjQ8U/MH1Lq/QzR3E2Y3rrbIJtrWvNydeag9KctiF3XG4zBRP67PGNzuguBC3BIz0e8hg+Y8mE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655992714; 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=+XYTAjzc9d7cWhczld7O5McHsh2b7Kh3oY+g8nnrZ0k=; b=D6xlkQKnkhzgq3+BstP1ymGvnUvCvtPjtG6tclcyeqOsgxHfnMRuxAVC52Mvvw4JvNoLMdLUmqTecRi79pppAiul+4RrseArcP8rm+5NdiLaeZk7WjoifvWMP3QtMAN5ufTpmZQLtV4tGdBjMqsGILf1E8LRAPrtLhfs418Gjw0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 165599271445851.151753063332876; Thu, 23 Jun 2022 06:58:34 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-638-XgYfh4RWMCqABMY0sy9EOQ-1; Thu, 23 Jun 2022 09:58:31 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1E2BF8037B7; Thu, 23 Jun 2022 13:58:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 087C217452; Thu, 23 Jun 2022 13:58:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 11DE4194B978; Thu, 23 Jun 2022 13:58:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 90CFB194B955 for ; Thu, 23 Jun 2022 13:58:15 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 78A742026D2D; Thu, 23 Jun 2022 13:58:15 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.227]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5959D2026D64 for ; Thu, 23 Jun 2022 13:58:15 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 18ED6241E3E; Thu, 23 Jun 2022 15:58:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655992713; 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=+XYTAjzc9d7cWhczld7O5McHsh2b7Kh3oY+g8nnrZ0k=; b=YuTSej1cI+VcBtNHw7AIHSc30EvIR6ggUCz7svZ/oMG60AYFTi96mgKNKR9pVASyPbV5z5 xHHGAHjU0MtFdeuXTZlSjpVcl1hS4IJKFA0R8/1511kBksZfmXEhzIQmhF8Bjjunc/8Vk8 ihG7qcZwiIDiI/c76crijguDZBSZHUw= X-MC-Unique: XgYfh4RWMCqABMY0sy9EOQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 2/7] qemu_migration: Use qemuDomainSetMaxMemLock Date: Thu, 23 Jun 2022 15:58:07 +0200 Message-Id: <483e31dec98cd525af8cb48ac2c718981c928e30.1655992592.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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: 1655992716323100001 Content-Type: text/plain; charset="utf-8" This helper will not try to set the limit if it is already big enough, which may be useful when libvirt daemon is running in a containerized environment and is not allowed to change memory locking limit. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index d93e7e9c74..fe63f45629 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -3181,7 +3181,7 @@ qemuMigrationDstPrepareActive(virQEMUDriver *driver, =20 if (STREQ_NULLABLE(protocol, "rdma") && vm->def->mem.hard_limit > 0 && - virProcessSetMaxMemLock(vm->pid, vm->def->mem.hard_limit << 10) < = 0) { + qemuDomainSetMaxMemLock(vm, vm->def->mem.hard_limit << 10, NULL) <= 0) { goto error; } =20 @@ -4615,7 +4615,7 @@ qemuMigrationSrcStart(virDomainObj *vm, case MIGRATION_DEST_HOST: if (STREQ(spec->dest.host.protocol, "rdma") && vm->def->mem.hard_limit > 0 && - virProcessSetMaxMemLock(vm->pid, vm->def->mem.hard_limit << 10= ) < 0) { + qemuDomainSetMaxMemLock(vm, vm->def->mem.hard_limit << 10, NUL= L) < 0) { return -1; } return qemuMonitorMigrateToHost(priv->mon, migrateFlags, --=20 2.35.1