[pve-devel] [PATCH manager] add PCID checkbox to ProcessorEdit

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Jan 10 08:50:39 CET 2018


On 1/9/18 4:27 PM, Dominik Csapak wrote:
> but not in wizard, and default is off
> (because we do not know if the cpu supports it)
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>

Reviewed-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht at proxmox.com>

> ---
>  www/manager6/qemu/CreateWizard.js  |  1 +
>  www/manager6/qemu/ProcessorEdit.js | 20 ++++++++++++++++++++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/www/manager6/qemu/CreateWizard.js b/www/manager6/qemu/CreateWizard.js
> index c508bb7f..55bc1d50 100644
> --- a/www/manager6/qemu/CreateWizard.js
> +++ b/www/manager6/qemu/CreateWizard.js
> @@ -114,6 +114,7 @@ Ext.define('PVE.qemu.CreateWizard', {
>  		},
>  		{
>  		    xtype: 'pveQemuProcessorPanel',
> +		    insideWizard: true,
>  		    title: gettext('CPU')
>  		},
>  		{
> diff --git a/www/manager6/qemu/ProcessorEdit.js b/www/manager6/qemu/ProcessorEdit.js
> index 01da7036..2bb86a3a 100644
> --- a/www/manager6/qemu/ProcessorEdit.js
> +++ b/www/manager6/qemu/ProcessorEdit.js
> @@ -3,12 +3,19 @@ Ext.define('PVE.qemu.ProcessorInputPanel', {
>      alias: 'widget.pveQemuProcessorPanel',
>      onlineHelp: 'qm_cpu',
>  
> +    insideWizard: false,
> +
>      onGetValues: function(values) {
>  	var me = this;
>  
>  	// build the cpu options:
>  	me.cpu.cputype = values.cputype;
> +
> +	// as long as flags is not a textfield, we
> +	// have to manuall set the value
> +	me.cpu.flags = (values.flags)?'+pcid':undefined;

Readability (spaces)?

>  	delete values.cputype;
> +	delete values.flags;
>  	var cpustring = PVE.Parser.printQemuCpu(me.cpu);
>  
>  	// remove cputype delete request:
> @@ -95,6 +102,16 @@ Ext.define('PVE.qemu.ProcessorInputPanel', {
>  		fieldLabel: gettext('Total cores'),
>  		name: 'totalcores',
>  		value: '1'
> +	    },
> +	    {
> +		// will be a textfield probably someday,
> +		// so we name it flags
> +		hidden: me.insideWizard,
> +		disabled: me.insideWizard,
> +		xtype: 'pvecheckbox',
> +		fieldLabel: 'PCID',
> +		name: 'flags',
> +		uncheckedValue: 0
>  	    }
>  
>  	];
> @@ -126,6 +143,9 @@ Ext.define('PVE.qemu.ProcessorEdit', {
>  		    var cpu = PVE.Parser.parseQemuCpu(value);
>  		    ipanel.cpu = cpu;
>  		    data.cputype = cpu.cputype;
> +		    /*jslint confusion: true*/
> +		    // .flags is boolean and string
> +		    data.flags = (cpu.flags === '+pcid');
>  		}
>  		me.setValues(data);
>  	    }
> 





More information about the pve-devel mailing list