From nobody Mon Feb 9 12:24:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1566203573; cv=none; d=zoho.com; s=zohoarc; b=SLYbX9TvfM4zFAubGQpthywpAGSi70t7MIWf0E5vJomMftlOUMroxv0dQXZoTTHTcXpLEU8ICqblEmkty0UtBCjZw5UfHzP/r7u5BtvYRHQeT2voLd5WXOkOFzuG/qhdaQM6NczXZR2TqIE8Yz0nffITV7EAe+YTY72M6ydl8LI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566203573; 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:ARC-Authentication-Results; bh=pTe7HZtoCqaaDVFUPfu5iVl7T/DOhBZtZhatcldHTAc=; b=ATHQR1G6CUukyNc/oFyX5yBmJGllUhB9XpQ1MhjkO3jG6QoYnkiTSDmWOCHD3i7kS1fh1lNmgrbmGhOq3Efq+obxboma2yvr7CpOZ7C9y4xLX21LUjDbqX23YQbvwEqiu0+3DQvPfOsW7OAoUoGPpzV409YjT74DBak9SbybIYc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566203573648820.7365780734806; Mon, 19 Aug 2019 01:32:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5ADE2C00F7E6; Mon, 19 Aug 2019 08:32:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51EDE1E1; Mon, 19 Aug 2019 08:32:50 +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 A6A0D2551C; Mon, 19 Aug 2019 08:32:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7J8Wj9j031694 for ; Mon, 19 Aug 2019 04:32:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8331E1D8; Mon, 19 Aug 2019 08:32:45 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7AE691CF for ; Mon, 19 Aug 2019 08:32:43 +0000 (UTC) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9B58265F58 for ; Mon, 19 Aug 2019 08:32:39 +0000 (UTC) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x7J8SQdt019250 for ; Mon, 19 Aug 2019 08:32:39 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2ue90t617t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 19 Aug 2019 08:32:39 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x7J8WcVk194481 for ; Mon, 19 Aug 2019 08:32:38 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 2ue8wxuan0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 19 Aug 2019 08:32:37 +0000 Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x7J8WXYU012340 for ; Mon, 19 Aug 2019 08:32:34 GMT Received: from maximegalon.us.oracle.com (/10.175.42.78) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 19 Aug 2019 01:32:33 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2019-08-05; bh=GIGLb8CNQl/lPPmk7jG34cgCLAJmF91aZrYSjUYTN0g=; b=ZjLUL2VTIAQueRs/BF5pjhoouAJqzNMFufMcEK9LQWKntIOpRp96mpAra3fxj2A10bIN gknpCbQtERY6Sxy/D5gt97e6xCkvpSh/veDvEkCpniG/OOvZShF8QM/zXLxgSkqsK0oF x6AhCP0xEa4SP4ExaSnZbW5JuOE26kYX7LQqK1fRAdRU55p9BJvsFN1YaZXW9Dgclwlb /eh7KRWKYLbL28CRh/mcCXKXDnQJ4rN3uDyBjytRuhNZwPfNTWQ9dFHKbwanayL4osfC 0Ws7rY75LenoxECPRMhl3GmKPgdkbQe07fbGzIXAoygcsQdRf8PRSx6KwCwnvGTqrenn 1w== From: Menno Lageman To: libvir-list@redhat.com Date: Mon, 19 Aug 2019 10:32:24 +0200 Message-Id: <20190819083226.28640-2-menno.lageman@oracle.com> In-Reply-To: <20190819083226.28640-1-menno.lageman@oracle.com> References: <20190819083226.28640-1-menno.lageman@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9353 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908190099 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9353 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908190098 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 19 Aug 2019 08:32:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 19 Aug 2019 08:32:39 +0000 (UTC) for IP:'156.151.31.86' DOMAIN:'userp2130.oracle.com' HELO:'userp2130.oracle.com' FROM:'menno.lageman@oracle.com' RCPT:'' X-RedHat-Spam-Score: -102.4 (DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_MED, SPF_HELO_PASS, SPF_NONE, UNPARSEABLE_RELAY, USER_IN_WHITELIST) 156.151.31.86 userp2130.oracle.com 156.151.31.86 userp2130.oracle.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] qemu: introduce qemuBuildOvercommitCommandLine() 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 19 Aug 2019 08:32:52 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" In preparation for adding support for '-overcommit cpu-pm=3D[on|off]', add qemuBuildOvercommitCommandLine() to generate the '-overcommit' commandline. Move the existing '-overcommit mem-lock=3D[on|off]' generation code from qemuBuildMemCommandline() to this function. Signed-off-by: Menno Lageman --- src/qemu/qemu_command.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index f096e8f27e58..922456ec679e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7832,10 +7832,11 @@ qemuBuildMemCommandLine(virCommandPtr cmd, qemuBuildMemPathStr(cfg, def, cmd, priv) < 0) return -1; =20 - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OVERCOMMIT)) { - virCommandAddArg(cmd, "-overcommit"); - virCommandAddArgFormat(cmd, "mem-lock=3D%s", def->mem.locked ? "on= " : "off"); - } else { + /* + * '-overcommit mem-lock=3Don|off' is handled with other + * overcommit options later on. + */ + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OVERCOMMIT)) { virCommandAddArg(cmd, "-realtime"); virCommandAddArgFormat(cmd, "mlock=3D%s", def->mem.locked ? "on" : "off"); @@ -7845,6 +7846,19 @@ qemuBuildMemCommandLine(virCommandPtr cmd, } =20 =20 +static int +qemuBuildOvercommitCommandLine(virCommandPtr cmd, + const virDomainDef *def, + virQEMUCapsPtr qemuCaps) +{ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OVERCOMMIT)) { + virCommandAddArg(cmd, "-overcommit"); + virCommandAddArgFormat(cmd, "mem-lock=3D%s", def->mem.locked ? "on= " : "off"); + } + return 0; +} + + static int qemuBuildIOThreadCommandLine(virCommandPtr cmd, const virDomainDef *def) @@ -10657,6 +10671,9 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, if (qemuBuildMemCommandLine(cmd, cfg, def, qemuCaps, priv) < 0) goto error; =20 + if (qemuBuildOvercommitCommandLine(cmd, def, qemuCaps) < 0) + goto error; + if (qemuBuildSmpCommandLine(cmd, def) < 0) goto error; =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list