From nobody Thu Apr 25 06:49:44 2024 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 From nobody Thu Apr 25 06:49:44 2024 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=1566203628; cv=none; d=zoho.com; s=zohoarc; b=FBhcE6dyCvWMs3cxP0orPYb3KKZ7V0nK2ywjBG52W51HONdb5d+iNK3xGi2EbXc+0BaRpeolrmbL4U44svAuxEeC8Sjquq6VLQP6skWukDvp8s8yRmbZISdCe87ZGpuxnVzEhkP393W5l4hy6fSP3ZL7zcQO6Uj3IX7b683Lb0w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566203628; 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=I6LiZM8O2L6OBoo7peKHHNOgiJeIi4qZMvMJXzc3dUQ=; b=oFmH0pTqwhz37gF+swJO+SMp8UqoZHsgEHuNKQ5OxZijhASYus1Cu547TpoaEUTvAHugCxcOa24B1Ao9wskBh1whVOfzmn4JVRMPnB24BDjvgcNM1YhisYCM2ZJ+ljzjGlrX0h8oGLW5V6bW6yy89y8Wi65R0s01y2XSAXgkBlE= 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 1566203628576844.0714659389462; Mon, 19 Aug 2019 01:33:48 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5CA17C057F31; Mon, 19 Aug 2019 08:33:47 +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 35BE41E8; Mon, 19 Aug 2019 08:33:47 +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 ECB1524F2F; Mon, 19 Aug 2019 08:33:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7J8XjGr031796 for ; Mon, 19 Aug 2019 04:33:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 93A241E1; Mon, 19 Aug 2019 08:33:45 +0000 (UTC) Received: from mx1.redhat.com (ext-mx22.extmail.prod.ext.phx2.redhat.com [10.5.110.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D5EC5FCA6 for ; Mon, 19 Aug 2019 08:33:45 +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 6164E19AD4F7 for ; Mon, 19 Aug 2019 08:33:36 +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 x7J8SPDv019221 for ; Mon, 19 Aug 2019 08:33:35 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2ue90t61e5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 19 Aug 2019 08:33:35 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x7J8XPBV004617 for ; Mon, 19 Aug 2019 08:33:34 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 2ufb46f8xb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 19 Aug 2019 08:33:34 +0000 Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x7J8WYlF006120 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:34 -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=j+MDAQ0QYsU7Uoq1EBbOWY4dzKkcvwNt+hFMTHH7oSA=; b=QiTJ8Zm7+LncxXjMtIWMOF9lPwTl+ixYon65KQK4VSVkq0Cuaym2CNBFaOXQN9rtlKS3 ZauNftXRpafAcy6cb2k/oJA7dfClyjj6SLHoADWmYsldOCxaD9ugkCpSBg9ftWGKmuya fJX5vtHPmWd9CNb5J/PGrkRNYJMWJqwtHc01AuEU2duc+/VHeGc7ffe41yu5GxqTRyZN Ysctap7Jpf2nYsR2DXjwZI3ZuPdL4hoNyLUBhVAs7e1SQ9q6bqb/0wVq/Gvqq71khsJG Jv3cpvomyS9wFp3fCNACNsF/4asBAypNAy+N8IdloelJ5FCU+EUnrzSC9M2czyPDRJic 9Q== From: Menno Lageman To: libvir-list@redhat.com Date: Mon, 19 Aug 2019 10:32:25 +0200 Message-Id: <20190819083226.28640-3-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=43 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=43 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.6.2 (mx1.redhat.com [10.5.110.63]); Mon, 19 Aug 2019 08:33:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Mon, 19 Aug 2019 08:33:41 +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.84 on 10.5.110.63 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] qemu: add hypervisor feature cpu-pm support for kvm 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 19 Aug 2019 08:33:47 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Wim ten Have QEMU introduced a CPU power management feature with commit 6f131f13e68d ("kvm: support -overcommit cpu-pm=3Don|off"). This patch series adds support for controlling QEMU's "-overcommit" command line switch: "-overcommit cpu-pm=3D[on|off]". By default "cpu-pm" i= s off. To turn the CPU power management feature on, the following XML needs to be added to the guest's domain description: Note that the "cpu-pm" element is only available if the CPU mode is set to "host-passthrough": Signed-off-by: Wim ten Have Signed-off-by: Menno Lageman --- docs/formatdomain.html.in | 7 +++++++ docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 4 ++++ src/conf/domain_conf.h | 1 + src/libvirt_private.syms | 1 + src/qemu/qemu_command.c | 16 +++++++++++++++- src/qemu/qemu_domain.c | 25 ++++++++++++++++++------- 7 files changed, 51 insertions(+), 8 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index a18119f9a08e..7ea819ef6fb2 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2045,6 +2045,7 @@ <kvm> <hidden state=3D'on'/> <hint-dedicated state=3D'on'/> + <cpu-pm state=3D'on'/> </kvm> <pvspinlock state=3D'on'/> <gic version=3D'2'/> @@ -2224,6 +2225,12 @@ on, off 5.7.0 (QEMU 2.12.1) + + cpu-pm + Enable guest management of the host CPU's power state. Note= that enabling this will increase latency for other processes running on th= e same host CPU. + on, off + 5.7.0 (QEMU 2.12.1) +
pmu
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 08853f9d9e92..51c9e434aa35 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5970,6 +5970,11 @@ + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 8642927d6bf3..e348aa0bcb5f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -203,6 +203,7 @@ VIR_ENUM_IMPL(virDomainKVM, VIR_DOMAIN_KVM_LAST, "hidden", "hint-dedicated", + "cpu-pm", ); =20 VIR_ENUM_IMPL(virDomainMsrsUnknown, @@ -20412,6 +20413,7 @@ virDomainDefParseXML(xmlDocPtr xml, switch ((virDomainKVM) feature) { case VIR_DOMAIN_KVM_HIDDEN: case VIR_DOMAIN_KVM_DEDICATED: + case VIR_DOMAIN_KVM_CPU_PM: if (!(tmp =3D virXMLPropString(nodes[i], "state"))) { virReportError(VIR_ERR_XML_ERROR, _("missing 'state' attribute for " @@ -22625,6 +22627,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDefP= tr src, switch ((virDomainKVM) i) { case VIR_DOMAIN_KVM_HIDDEN: case VIR_DOMAIN_KVM_DEDICATED: + case VIR_DOMAIN_KVM_CPU_PM: if (src->kvm_features[i] !=3D dst->kvm_features[i]) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of KVM feature '%s' differs: " @@ -28126,6 +28129,7 @@ virDomainDefFormatFeatures(virBufferPtr buf, switch ((virDomainKVM) j) { case VIR_DOMAIN_KVM_HIDDEN: case VIR_DOMAIN_KVM_DEDICATED: + case VIR_DOMAIN_KVM_CPU_PM: if (def->kvm_features[j]) virBufferAsprintf(&childBuf, "<%s state=3D'%s'/>\n= ", virDomainKVMTypeToString(j), diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index f7423b1b6f89..b5a4cee46c1e 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1766,6 +1766,7 @@ typedef enum { typedef enum { VIR_DOMAIN_KVM_HIDDEN =3D 0, VIR_DOMAIN_KVM_DEDICATED, + VIR_DOMAIN_KVM_CPU_PM, =20 VIR_DOMAIN_KVM_LAST } virDomainKVM; diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 9db4ac7933e5..67a3a14c9b36 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -446,6 +446,7 @@ virDomainIOThreadIDDel; virDomainIOThreadIDFind; virDomainKeyWrapCipherNameTypeFromString; virDomainKeyWrapCipherNameTypeToString; +virDomainKVMTypeToString; virDomainLeaseDefFree; virDomainLeaseIndex; virDomainLeaseInsert; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 922456ec679e..163c98bc7d0f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7217,6 +7217,8 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, virBufferAddLit(&buf, ",kvm-hint-dedicated=3Don"); break; =20 + /* Not a -cpu option */ + case VIR_DOMAIN_KVM_CPU_PM: /* coverity[dead_error_begin] */ case VIR_DOMAIN_KVM_LAST: break; @@ -7852,8 +7854,20 @@ qemuBuildOvercommitCommandLine(virCommandPtr cmd, virQEMUCapsPtr qemuCaps) { if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OVERCOMMIT)) { + virBuffer buf =3D VIR_BUFFER_INITIALIZER; + char *overcommit; + + virBufferAsprintf(&buf, "mem-lock=3D%s", def->mem.locked ? "on" : = "off"); + + if (def->features[VIR_DOMAIN_FEATURE_KVM] =3D=3D VIR_TRISTATE_SWIT= CH_ON) + virBufferAsprintf(&buf, ",cpu-pm=3D%s", + def->kvm_features[VIR_DOMAIN_KVM_CPU_PM] =3D= =3D VIR_TRISTATE_SWITCH_ON ? "on" : "off"); + + overcommit =3D virBufferContentAndReset(&buf); virCommandAddArg(cmd, "-overcommit"); - virCommandAddArgFormat(cmd, "mem-lock=3D%s", def->mem.locked ? "on= " : "off"); + virCommandAddArgFormat(cmd, "%s", overcommit); + + VIR_FREE(overcommit); } return 0; } diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index a06672333cf7..5571f52fec47 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4442,7 +4442,7 @@ static int qemuDomainDefValidateFeatures(const virDomainDef *def, virQEMUCapsPtr qemuCaps) { - size_t i; + size_t i, j; =20 for (i =3D 0; i < VIR_DOMAIN_FEATURE_LAST; i++) { const char *featureName =3D virDomainFeatureTypeToString(i); @@ -4499,12 +4499,23 @@ qemuDomainDefValidateFeatures(const virDomainDef *d= ef, break; =20 case VIR_DOMAIN_FEATURE_KVM: - if (def->kvm_features[VIR_DOMAIN_KVM_DEDICATED] =3D=3D VIR_TRI= STATE_SWITCH_ON && - (!def->cpu || def->cpu->mode !=3D VIR_CPU_MODE_HOST_PASSTH= ROUGH)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("kvm-hint-dedicated=3Don is only applicab= le " - "for cpu host-passthrough")); - return -1; + for (j =3D 0; j < VIR_DOMAIN_KVM_LAST; j++) { + switch ((virDomainKVM) j) { + case VIR_DOMAIN_KVM_DEDICATED: + case VIR_DOMAIN_KVM_CPU_PM: + if (def->kvm_features[j] =3D=3D VIR_TRISTATE_SWITCH_ON= && + (!def->cpu || def->cpu->mode !=3D VIR_CPU_MODE_HOS= T_PASSTHROUGH)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("%s=3Don is only applicable for c= pu host-passthrough"), + virDomainKVMTypeToString(j)); + return -1; + } + break; + + case VIR_DOMAIN_KVM_HIDDEN: + case VIR_DOMAIN_KVM_LAST: + break; + } } break; =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 25 06:49:44 2024 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=1566203613; cv=none; d=zoho.com; s=zohoarc; b=eEZLzvr/ZIslividMqR2HIArkL2zi6FHIfk6Jn2cVa9omrJHGAq8Lyl3lWLdafLcYwfCuTCP9+GjnkBNF9Bn/UO23tLxxw8O4OccahQR9oN2b0cJSkS9HufVs+m+WLHCd/lDe0e/a0U+tga4+f7GMiMFTi/+SiPs1aK6xn/CkJo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566203613; 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=VT4Wv/mJhTSTGdz13EW/tc8Y1vaNQdsqhtbfpSSDw/w=; b=NtOy1BvrR6/8grQ5S3El24A+CTZVMftbLwPQlSfrFZmfVw5j9DV+2rdmkFVIl7KxpK3WWFNXskTNzXBivL/6cQD3QfTMDOJgQEP6exsjAG8fxGmR9g+fNL72cHz/MwmROrd56Y/qiynFY/3N3x4HKrwHnd+DD09He+YKgO/wANY= 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 1566203613389686.7960400163287; Mon, 19 Aug 2019 01:33:33 -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 488FD302C068; Mon, 19 Aug 2019 08:33:32 +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 1FB461E1; Mon, 19 Aug 2019 08:33:32 +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 D676824FDF; Mon, 19 Aug 2019 08:33:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7J8XUG2031758 for ; Mon, 19 Aug 2019 04:33:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 500FB84E0; Mon, 19 Aug 2019 08:33:30 +0000 (UTC) Received: from mx1.redhat.com (ext-mx30.extmail.prod.ext.phx2.redhat.com [10.5.110.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4ABE11E1 for ; Mon, 19 Aug 2019 08:33:25 +0000 (UTC) Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) (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 62C0D7F74A for ; Mon, 19 Aug 2019 08:33:16 +0000 (UTC) Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x7J8SU0c052734 for ; Mon, 19 Aug 2019 08:33:15 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 2ue9hp5x80-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 19 Aug 2019 08:33:15 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x7J8XCpS184079 for ; Mon, 19 Aug 2019 08:33:14 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3030.oracle.com with ESMTP id 2ue6qe7uyp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 19 Aug 2019 08:33:12 +0000 Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x7J8WaJg015753 for ; Mon, 19 Aug 2019 08:32:37 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:36 -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=02xzefW1qH3kEjDMG9as/4iCAvUI0tn3wlCpKOOnkDw=; b=aWLZJSZeTw2ltoo5yIHLa5lYf4ZK5l1vm5+9B3etf6SeDo/pyJj1PzmiY9Fv5J6/tXxc aFEstIt4ZWahUoRgiAu29koVy1qO9YJgUFrnW4CTL6iy/xBczHc2RsGZW9iGAZ0zO73i lYaDqOxAjDctKvw51CYKpnjDJNELGLuXu4XiYnLeLKNsI6zEe29BSZ+QXU186v8x7qsx LsaQl08EIqKj3jfI+Mta+piIrMi4xdgkI3WSdSeGyPUrVF0ENiOPj082zlDomhgAr7yn tNV8KzMTTNv0cEPSR3OLS+8zaxzi7gn79IpeCqIZ0e/h/PhNSbEZ6RS4rWQU/lRCZG/N SA== From: Menno Lageman To: libvir-list@redhat.com Date: Mon, 19 Aug 2019 10:32:26 +0200 Message-Id: <20190819083226.28640-4-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.6.2 (mx1.redhat.com [10.5.110.71]); Mon, 19 Aug 2019 08:33:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Mon, 19 Aug 2019 08:33:21 +0000 (UTC) for IP:'141.146.126.78' DOMAIN:'aserp2120.oracle.com' HELO:'aserp2120.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) 141.146.126.78 aserp2120.oracle.com 141.146.126.78 aserp2120.oracle.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.71 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] tests: add tests for cpu-pm feature 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.46]); Mon, 19 Aug 2019 08:33:32 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Update the KVM feature tests for the cpu-pm feature Signed-off-by: Menno Lageman --- tests/qemuxml2argvdata/kvm-features-off.args | 2 +- tests/qemuxml2argvdata/kvm-features-off.xml | 1 + tests/qemuxml2argvdata/kvm-features.args | 2 +- tests/qemuxml2argvdata/kvm-features.xml | 1 + tests/qemuxml2argvtest.c | 4 ++-- tests/qemuxml2xmloutdata/kvm-features-off.xml | 1 + tests/qemuxml2xmloutdata/kvm-features.xml | 1 + 7 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/qemuxml2argvdata/kvm-features-off.args b/tests/qemuxml2a= rgvdata/kvm-features-off.args index 59a79376d140..5150f93986a7 100644 --- a/tests/qemuxml2argvdata/kvm-features-off.args +++ b/tests/qemuxml2argvdata/kvm-features-off.args @@ -12,7 +12,7 @@ QEMU_AUDIO_DRV=3Dnone \ -S \ -machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ -m 214 \ --realtime mlock=3Doff \ +-overcommit mem-lock=3Doff,cpu-pm=3Doff \ -smp 6,sockets=3D6,cores=3D1,threads=3D1 \ -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -display none \ diff --git a/tests/qemuxml2argvdata/kvm-features-off.xml b/tests/qemuxml2ar= gvdata/kvm-features-off.xml index ab2c16202c3d..81970472d2f3 100644 --- a/tests/qemuxml2argvdata/kvm-features-off.xml +++ b/tests/qemuxml2argvdata/kvm-features-off.xml @@ -13,6 +13,7 @@ + diff --git a/tests/qemuxml2argvdata/kvm-features.args b/tests/qemuxml2argvd= ata/kvm-features.args index 8372ca897d8d..315e4cae853c 100644 --- a/tests/qemuxml2argvdata/kvm-features.args +++ b/tests/qemuxml2argvdata/kvm-features.args @@ -13,7 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -machine pc,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ -cpu host,kvm=3Doff,kvm-hint-dedicated=3Don \ -m 214 \ --realtime mlock=3Doff \ +-overcommit mem-lock=3Doff,cpu-pm=3Don \ -smp 6,sockets=3D6,cores=3D1,threads=3D1 \ -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -display none \ diff --git a/tests/qemuxml2argvdata/kvm-features.xml b/tests/qemuxml2argvda= ta/kvm-features.xml index b942e89a9280..fd12a80a574f 100644 --- a/tests/qemuxml2argvdata/kvm-features.xml +++ b/tests/qemuxml2argvdata/kvm-features.xml @@ -13,6 +13,7 @@ + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 26b512d24606..4c048b3e768a 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -915,8 +915,8 @@ mymain(void) DO_TEST("hyperv-off", NONE); DO_TEST("hyperv-panic", NONE); =20 - DO_TEST("kvm-features", NONE); - DO_TEST("kvm-features-off", NONE); + DO_TEST("kvm-features", QEMU_CAPS_OVERCOMMIT); + DO_TEST("kvm-features-off", QEMU_CAPS_OVERCOMMIT); =20 DO_TEST("pmu-feature", NONE); DO_TEST("pmu-feature-off", NONE); diff --git a/tests/qemuxml2xmloutdata/kvm-features-off.xml b/tests/qemuxml2= xmloutdata/kvm-features-off.xml index a0ef9c7e9e15..31d9b586b3f8 100644 --- a/tests/qemuxml2xmloutdata/kvm-features-off.xml +++ b/tests/qemuxml2xmloutdata/kvm-features-off.xml @@ -13,6 +13,7 @@ + diff --git a/tests/qemuxml2xmloutdata/kvm-features.xml b/tests/qemuxml2xmlo= utdata/kvm-features.xml index b6f16ced1dab..7ceaf15ecf1e 100644 --- a/tests/qemuxml2xmloutdata/kvm-features.xml +++ b/tests/qemuxml2xmloutdata/kvm-features.xml @@ -13,6 +13,7 @@ + --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list