From nobody Sun May 5 20:05:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=yandex.ru ARC-Seal: i=1; a=rsa-sha256; t=1631794590; cv=none; d=zohomail.com; s=zohoarc; b=P+YVgUO4pWGJRS549LCGZcs3k8FL9bCkbyyYyqEKsYFnjf/wLhtXn6Z8iwBuARGeEj2ttGp1bWSKSBX5aDcgkmc+AhYwNxfno81GfhgrUFQqbTUEUsh+AvAZ4yM7NfPmbzXxrIh/qURKMqGNRn0N7zExgo05GyAs8pjkg+iOgPE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631794590; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=g3vf8XCHFE0NhfW12scKRmlBoFDcRBGQvYgVAD2JBkY=; b=ETLKvFK2kG/BS6FfEyP9fPX58VVN1A0UF+2/+zVCeVCOCcy85kp3Fpjib2mtAJNVE2w+NooagEUMWk+5XpBOOzxp/LTH/3oQGbLECcHwHaM7Z79ZPMnElnn3zid3rQwvFdvW8i7+NPMc1E8fuEtgA8lA7+G6XjEBO+etztJm1gg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1631794590533552.9515099604475; Thu, 16 Sep 2021 05:16:30 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.188437.337593 (Exim 4.92) (envelope-from ) id 1mQqJK-0007KT-NQ; Thu, 16 Sep 2021 12:16:14 +0000 Received: by outflank-mailman (output) from mailman id 188437.337593; Thu, 16 Sep 2021 12:16:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQqJK-0007KL-Ju; Thu, 16 Sep 2021 12:16:14 +0000 Received: by outflank-mailman (input) for mailman id 188437; Thu, 16 Sep 2021 12:16:12 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQqJI-00074J-Ek for xen-devel@lists.xenproject.org; Thu, 16 Sep 2021 12:16:12 +0000 Received: from forward105o.mail.yandex.net (unknown [2a02:6b8:0:1a2d::608]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 11bc9e2e-3565-47e4-bc63-6d940a048772; Thu, 16 Sep 2021 12:16:00 +0000 (UTC) Received: from myt6-48cb7adf5983.qloud-c.yandex.net (myt6-48cb7adf5983.qloud-c.yandex.net [IPv6:2a02:6b8:c12:4c9c:0:640:48cb:7adf]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 731FF4C43F7; Thu, 16 Sep 2021 15:15:57 +0300 (MSK) Received: from myt6-efff10c3476a.qloud-c.yandex.net (myt6-efff10c3476a.qloud-c.yandex.net [2a02:6b8:c12:13a3:0:640:efff:10c3]) by myt6-48cb7adf5983.qloud-c.yandex.net (mxback/Yandex) with ESMTP id B2htycwpgs-FvDm3JOh; Thu, 16 Sep 2021 15:15:57 +0300 Received: by myt6-efff10c3476a.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id wX5Y1UDLGI-FtDKBARt; Thu, 16 Sep 2021 15:15:56 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 11bc9e2e-3565-47e4-bc63-6d940a048772 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1631794557; bh=g3vf8XCHFE0NhfW12scKRmlBoFDcRBGQvYgVAD2JBkY=; h=Message-Id:Date:Subject:To:From:Cc; b=IL4XfRKHasKz2dw63v8RALFFZD2Lku0dUKzAxPqwr7QoZaUQvskd3iDVZ07eMBdhG lZOcf9QFYF0ye91MbNNpKl1C6DswKhoKrX40/nA8nLqQZleAjw4m9ZfgX5sSi1CjxP Jte673XsjSAHWNnEwBNR/tQ3E8QQMY9n7pLJxxco= Authentication-Results: myt6-48cb7adf5983.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru From: Dmitry Isaykin To: xen-devel@lists.xenproject.org Cc: Dmitry Isaykin , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH v3] tools/xl: fix autoballoon regex Date: Thu, 16 Sep 2021 15:15:21 +0300 Message-Id: X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @yandex.ru) X-ZM-MESSAGEID: 1631794592394100001 Content-Type: text/plain; charset="utf-8" This regex is used for auto-balloon mode detection based on Xen command lin= e. The case of specifying a negative size was handled incorrectly. From misc/xen-command-line documentation: dom0_mem (x86) =3D List of ( min: | max: | ) If a size is positive, it represents an absolute value. If a size is negative, it is subtracted from the total available memory. Also add support for [tT] granularity suffix. Also add support for memory fractions (i.e. '50%' or '1G+25%'). Signed-off-by: Dmitry Isaykin --- Changes in v3: - add support for [tT] granularity suffix - add support for memory fractions Changes in v2: - add missing Signed-off-by tag --- tools/xl/xl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/xl/xl.c b/tools/xl/xl.c index 4107d10fd4..8500b3ac57 100644 --- a/tools/xl/xl.c +++ b/tools/xl/xl.c @@ -81,7 +81,7 @@ static int auto_autoballoon(void) return 1; /* default to on */ =20 ret =3D regcomp(®ex, - "(^| )dom0_mem=3D((|min:|max:)[0-9]+[bBkKmMgG]?,?)+($| )= ", + "(^| )dom0_mem=3D((|min:|max:)(-?[0-9]+[bBkKmMgGtT]?)?(\= +?[0-9]+%)?,?)+($| )", REG_NOSUB | REG_EXTENDED); if (ret) return 1; --=20 2.33.0