From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <daniel@bowdernet.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 13DB9712B9
 for <pve-devel@lists.proxmox.com>; Wed,  8 Jun 2022 13:55:27 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 0AD9E775E
 for <pve-devel@lists.proxmox.com>; Wed,  8 Jun 2022 13:54:57 +0200 (CEST)
Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com
 [IPv6:2607:f8b0:4864:20::102e])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS id 871ED7755
 for <pve-devel@lists.proxmox.com>; Wed,  8 Jun 2022 13:54:56 +0200 (CEST)
Received: by mail-pj1-x102e.google.com with SMTP id cx11so18391127pjb.1
 for <pve-devel@lists.proxmox.com>; Wed, 08 Jun 2022 04:54:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=bowdernet.com; s=google;
 h=from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=CYSSVukSy6wiSud6DZ5TEjPGiRMi3AfOU2voKJGcOQk=;
 b=PpFKJrm4jrxHtKsyxugXPBg3BoGV9SKgrxtVAwavyCdwHGRfpY/qDqAtpVMu40JXXY
 eRehaki3qjMMEr9EPYfh1gGLCp1dYrRTdVw093GK/khZbNWSMXYGcHMZvqdNLRL3BuA9
 n4VxPLCUDmqCIr1D6/QlNpjYAul6Nag7fCzgezEBpunFOl/AQY0XeTqcnfdtH9bNX+Pc
 nSfpAceps4Yns+ODF+YBlNkhQB+rXWbINuEktPuk7FA2ibYN5l0z6DQg33m42WFdMgQJ
 IBJN8IoLybGf4tEG1mp2lzKDI+xIsJg00w9rDjOTNpqttxy2ZP71AOxFJINnyVYFD8MU
 NZ1w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=CYSSVukSy6wiSud6DZ5TEjPGiRMi3AfOU2voKJGcOQk=;
 b=HfYIhlSEw7ybULXYK8w3JHeXdac5P7r3TnQ8eHX5sOYDwwYSMGlvM6XCg5qURS8Ba2
 D6fQkNDhk3tYDE9Of13CCa1mLpwkJFWS0SiR7XHjssD0vBh2qCNgCMAur63K3oN4XA5p
 ISzz7dY2QbTbpxwDHRyGrR6+ixebdVOCO+yWmel0VHAIs0BD4xPTCRB3mlD4nZsGS6QT
 3+Yh7CRpWJwJcUvMpMiMSmux2D0GQIFP81hdLdNXx0YY4WYgc60Dz3UQP4pF2gCcieNa
 0si12SU4WeEoA/pQozEQfcZAbZU/Eha8weMFiMNn4dQUwcFqajYG2+MBg4mSQeuYLnNV
 dl0g==
X-Gm-Message-State: AOAM531OIUVKnPXl1TPrIlgMc+6F/jGlJ4AmKA7jqffv9mnXWvxRvsDy
 BSB+gtwmpawDLpmqrt5C1+awPXMQGa3JPcAS
X-Google-Smtp-Source: ABdhPJxu1UJTkRb2bwdzAcQivAdj//z5PVghe70hGcbCnpQf61Ao6DEGKhN/QCXVpPQFifGDxBG0ew==
X-Received: by 2002:a17:902:e5cb:b0:165:1500:a69b with SMTP id
 u11-20020a170902e5cb00b001651500a69bmr139953plf.29.1654689288809; 
 Wed, 08 Jun 2022 04:54:48 -0700 (PDT)
Received: from pve-dev.dbnet.in (c-24-19-168-226.hsd1.wa.comcast.net.
 [24.19.168.226]) by smtp.gmail.com with ESMTPSA id
 t6-20020a654b86000000b003fba6db1b50sm14902820pgq.85.2022.06.08.04.54.48
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Jun 2022 04:54:48 -0700 (PDT)
From: Daniel Bowder <daniel@bowdernet.com>
To: pve-devel@lists.proxmox.com
Cc: Daniel Bowder <daniel@bowdernet.com>
Date: Wed,  8 Jun 2022 04:54:28 -0700
Message-Id: <20220608115428.250668-6-daniel@bowdernet.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20220608115428.250668-1-daniel@bowdernet.com>
References: <20220608115428.250668-1-daniel@bowdernet.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.000 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
 RCVD_IN_DNSWL_NONE     -0.0001 Sender listed at https://www.dnswl.org/,
 no trust
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 T_SCC_BODY_TEXT_LINE    -0.01 -
 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more
 information. [bowdernet.com]
X-Mailman-Approved-At: Wed, 08 Jun 2022 14:30:46 +0200
Subject: [pve-devel] [PATCH 5/5] fix #3593: Added vm core pinning pve-manager
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Wed, 08 Jun 2022 11:55:27 -0000

Signed-off-by: Daniel Bowder <daniel@bowdernet.com>
---
 The fifth patch adds the cpuset value to the GUI under the VM.Config.Options panel. The cpuset is set as a vtype of CPUSet so that it can be checked by the regex match in the fouth patch. This was modeled after the existing 'name' option, where the labels and textfield type have been changed.
 www/manager6/qemu/Options.js | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/www/manager6/qemu/Options.js b/www/manager6/qemu/Options.js
index a1def4bb..ce356130 100644
--- a/www/manager6/qemu/Options.js
+++ b/www/manager6/qemu/Options.js
@@ -341,6 +341,36 @@ Ext.define('PVE.qemu.Options', {
 	    hookscript: {
 		header: gettext('Hookscript'),
 	    },
+		cpuset: {
+		required: false,
+		header: gettext('CPU Set'),
+		defaultValue: "",
+		editor: caps.vms['VM.Config.Options'] ? {
+		    xtype: 'proxmoxWindowEdit',
+		    subject: gettext('CPU Set'),
+		    items: {
+			xtype: 'inputpanel',
+			items: {
+			    xtype: 'textfield',
+			    name: 'cpuset',
+				vtype: 'CPUSet',
+			    value: '',
+			    fieldLabel: gettext('cpuset'),
+			    allowBlank: true,
+				emptyText: gettext("Pin to cores (e.g. 0,2-6,8)"),
+			},
+			onGetValues: function(values) {
+			    var params = values;
+			    if (values.cpuset === undefined ||
+				values.cpuset === null ||
+				values.cpuset === '') {
+				params = { 'delete': 'cpuset' };
+			    }
+			    return params;
+			},
+		    },
+		} : undefined,
+		},
 	};
 
 	var baseurl = 'nodes/' + nodename + '/qemu/' + vmid + '/config';
-- 
2.30.2