[pve-devel] [PATCH manager v3 4/8] Use the noVirtIO ControllerSelector property to build the list of controllers

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Sep 27 11:19:37 CEST 2017


On 09/26/2017 02:17 PM, Emmanuel Kasper wrote:
> ---
>   www/manager6/form/ControllerSelector.js | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/www/manager6/form/ControllerSelector.js b/www/manager6/form/ControllerSelector.js
> index 15023a7a..489b97de 100644
> --- a/www/manager6/form/ControllerSelector.js
> +++ b/www/manager6/form/ControllerSelector.js
> @@ -61,9 +61,9 @@ Ext.define('PVE.form.ControllerSelector', {
>   	var bussel = me.down('field[name=controller]');
>   	var deviceid = me.down('field[name=deviceid]');
>   
> -	if (autoSelect === 'cdrom') {
> +	if (me.noVirtIO) {
>   	    clist = ['ide', 'scsi', 'sata'];
> -	    if (!Ext.isDefined(me.vmconfig.ide2)) {
> +	    if (autoSelect === 'cdrom' && !Ext.isDefined(me.vmconfig.ide2)) {

noVirtIO gets only set in qemu/CDEdit.js this is also the only place
where autoSelect gets set, AFAIS.

I'd remove this fastpath here and with it the autoSelect parameter
of setVMConfig, then we just re-set the clist in the `if (me.noVirtIO)`
branch and pull out the sorting from the else, would make the code do
the same and much clearer, IMO.

>   		bussel.setValue('ide');
>   		deviceid.setValue(2);
>   		return;
> @@ -76,9 +76,6 @@ Ext.define('PVE.form.ControllerSelector', {
>   
>   	Ext.Array.each(clist, function(controller) {
>   	    var confid, i;
> -	    if (controller === 'virtio' && me.noVirtIO) {
> -		return; //continue
> -	    }
>   	    bussel.setValue(controller);
>   	    for (i = 0; i <= PVE.form.ControllerSelector.maxIds[controller]; i++) {
>   		confid = controller + i.toString();
> 





More information about the pve-devel mailing list