From nobody Wed May 15 21:03:53 2024 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 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 1656081261434720.9275828559145; Fri, 24 Jun 2022 07:34:21 -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-502-3ikdW-q1PxGW9bfIEqrA-Q-1; Fri, 24 Jun 2022 10:34:13 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 37B15801E67; Fri, 24 Jun 2022 14:34:10 +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 DDEBB2166B26; Fri, 24 Jun 2022 14:34:08 +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 6C7EF194B94E; Fri, 24 Jun 2022 14:34:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0C681194B946 for ; Fri, 24 Jun 2022 14:34:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E778C1415111; Fri, 24 Jun 2022 14:34:06 +0000 (UTC) Received: from rein.int.mamuti.net (unknown [10.40.192.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C6BDC141510C for ; Fri, 24 Jun 2022 14:34:06 +0000 (UTC) Received: by rein.int.mamuti.net (Postfix, from userid 500) id 779DD1800BC; Fri, 24 Jun 2022 16:33:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656081260; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=SSfiECJCehn1ZsxCDksJBtoDGkuU0yqhOXFtWdN1LCE=; b=Wq7dvl/PjD+3k3ZJNvjbOIW7dyOPmMq5zzCP340WXW+atVh59G4tBX3sGVwnngsPSmjT5X d7lP0gcf6UPUcGgZJU6uTuyjN0bWA3TYLv/EZyb6Qt/BwqFw0cvAo0yvK7ljTF+nks3YQN l5Jx80PD6D2fZW3ffaix3N58mMKVQug= X-MC-Unique: 3ikdW-q1PxGW9bfIEqrA-Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH] qemu_migration: Avoid mem.hard_limit > 0 check Date: Fri, 24 Jun 2022 16:33:22 +0200 Message-Id: <8b59a2e2fe17c53b6d1a2bb1b78065896a0e2763.1656081202.git.jdenemar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 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.78 on 10.11.54.6 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: 1656081263531100001 Content-Type: text/plain; charset="utf-8" My original commit v8.4.0-288-gf01fc4d119 accidentally forgot to fix both instances of the same problem. While it fixed the destination side of migration, the source one remained broken. However, that commit was also wrong in saying the issue could have caused unlimited memory locking to be allowed for QEMU when RDMA migration was used. It could not, because the code would refuse to even think about starting RDMA migration if hard_limit was not set. But avoiding the "mem.hard_limit > 0" check is useful anyway. Signed-off-by: Jiri Denemark Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 2a6b7b7819..9a10ce4abe 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -4623,7 +4623,7 @@ qemuMigrationSrcStart(virDomainObj *vm, switch (spec->destType) { case MIGRATION_DEST_HOST: if (STREQ(spec->dest.host.protocol, "rdma") && - vm->def->mem.hard_limit > 0 && + virMemoryLimitIsSet(vm->def->mem.hard_limit) && qemuDomainSetMaxMemLock(vm, vm->def->mem.hard_limit << 10, &priv->preMigrationMemlock) < 0) { return -1; --=20 2.35.1