From nobody Sun Feb 8 16:12:35 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=1652281419; cv=none; d=zohomail.com; s=zohoarc; b=MqvfT9NHBhHdFE3An5gLAptGMwkhh71NpeoTdqwtnHosv1rYgu/nZlrJPdB+fS2dzwfe0roaIjuQuNLB3jNZz47ehFS7pyorsBZnfNhB+DxZgybx+dlgZepyhAgpu81S9SjSTcqS9/0dN14g//g3pDoctevSibDYQyKeWv+2FuM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652281419; 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=J6Kf697weuUCaETB1mfvpGQHP41YK+ZsN4l5EHJ905g=; b=YrzAN0HaqE3LFblrnl8+nY0QX48Hq/VVRw5R94c+oEyfHQ44gwCtuAXGcjG7hSm6ky+EB+Fqr8gTMsy1KeBWtnt//eku2a2hE1x1cuWv4a+/RfDqWONDoVMEVWCcKyRXtMRN3dPEXhM1wF4p8w1uJoN8MpzMqdTGMPBEKdwtNXo= 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 1652281419065565.195863314456; Wed, 11 May 2022 08:03:39 -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-441-FSZamstYMVy806byX8yq9Q-1; Wed, 11 May 2022 11:03:34 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 21F46805F46; Wed, 11 May 2022 15:03:30 +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 0EC002026D64; Wed, 11 May 2022 15:03:30 +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 E7A5A1947B84; Wed, 11 May 2022 15:03:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F1F4E194707B for ; Wed, 11 May 2022 15:03:26 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E56511121315; Wed, 11 May 2022 15:03:26 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8D4BD1121314 for ; Wed, 11 May 2022 15:03:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652281418; 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=J6Kf697weuUCaETB1mfvpGQHP41YK+ZsN4l5EHJ905g=; b=PLVXG2t+LreohdLA+1Ul0ADY+4J2fC790i8BYLs8d/k78wzJWw4BsiSR0OuHdgctJsxw3N NfXtHenhioS9R7AryUhr/QATR0SNCWq0pdg/g0c0IMnfNAXyz2ZMVoOdEEJ4545Ec0Rwcb zd7dO2QQ2duBf9H+s6zeq9RXLMNEv2I= X-MC-Unique: FSZamstYMVy806byX8yq9Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/4] conf: Move virDomainObj::originalMemlock into qemuDomainObjPrivate Date: Wed, 11 May 2022 17:03:16 +0200 Message-Id: <4bfd63f9e2723e291a22babafe4fb0e79e06c7d0.1652281291.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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.4 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: 1652281420264100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Since v1.3.0-90-gafbe1d4c56 the original value of memlock limit is stored inside virDomainObj struct directly (under originalMemlock member). This is needless because the value is used only inside QEMU driver and thus can reside in qemuDomainObjPrivate struct. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.h | 3 --- src/qemu/qemu_domain.c | 9 +++++---- src/qemu/qemu_domain.h | 3 +++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 8a48646160..f5d9df3fab 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3064,9 +3064,6 @@ struct _virDomainObj { int taint; size_t ndeprecations; char **deprecations; - - unsigned long long originalMemlock; /* Original RLIMIT_MEMLOCK, zero i= f no - * restore will be required later = */ }; =20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainObj, virObjectUnref); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 7974cdb00b..4edae9cca9 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9445,6 +9445,7 @@ int qemuDomainAdjustMaxMemLock(virDomainObj *vm, bool forceVFIO) { + qemuDomainObjPrivate *priv =3D vm->privateData; unsigned long long currentMemLock =3D 0; unsigned long long desiredMemLock =3D 0; =20 @@ -9457,8 +9458,8 @@ qemuDomainAdjustMaxMemLock(virDomainObj *vm, /* If this is the first time adjusting the limit, save the cur= rent * value so that we can restore it once memory locking is no l= onger * required */ - if (vm->originalMemlock =3D=3D 0) { - vm->originalMemlock =3D currentMemLock; + if (priv->originalMemlock =3D=3D 0) { + priv->originalMemlock =3D currentMemLock; } } else { /* If the limit is already high enough, we can assume @@ -9471,8 +9472,8 @@ qemuDomainAdjustMaxMemLock(virDomainObj *vm, } else { /* Once memory locking is no longer required, we can restore the * original, usually very low, limit */ - desiredMemLock =3D vm->originalMemlock; - vm->originalMemlock =3D 0; + desiredMemLock =3D priv->originalMemlock; + priv->originalMemlock =3D 0; } =20 if (desiredMemLock > 0 && diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index c7125722e0..248af92649 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -241,6 +241,9 @@ struct _qemuDomainObjPrivate { GSList *dbusVMStateIds; /* true if -object dbus-vmstate was added */ bool dbusVMState; + + unsigned long long originalMemlock; /* Original RLIMIT_MEMLOCK, zero i= f no + * restore will be required later = */ }; =20 #define QEMU_DOMAIN_PRIVATE(vm) \ --=20 2.35.1