[pve-devel] applied-series: [PATCH manager 1/2] gui: qemu HardwareView: specify hardware counts in Utils

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Jan 24 10:11:27 CET 2020


On 1/17/20 5:14 PM, Dominik Csapak wrote:
> this also fixes the issue that we only showed 4 hostpci devices in
> the gui despite raising the limit in the backend to 16
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  www/manager6/Utils.js             | 2 ++
>  www/manager6/qemu/HardwareView.js | 8 ++++----
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
> index e61e2693..4c6cb258 100644
> --- a/www/manager6/Utils.js
> +++ b/www/manager6/Utils.js
> @@ -1210,6 +1210,8 @@ Ext.define('PVE.Utils', { utilities: {
>  	}
>      },
>  
> +    hardware_counts: { net: 32, usb: 5, hostpci: 16, audio: 1, efidisk: 1, serial: 4 },
> +
>      cleanEmptyObjectKeys: function (obj) {
>  	var propName;
>  	for (propName in obj) {
> diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js
> index 583b4000..7bd39726 100644
> --- a/www/manager6/qemu/HardwareView.js
> +++ b/www/manager6/qemu/HardwareView.js
> @@ -234,7 +234,7 @@ Ext.define('PVE.qemu.HardwareView', {
>  		cloudheader: gettext('CloudInit Drive') + ' (' + confid + ')'
>  	    };
>  	});
> -	for (i = 0; i < 32; i++) {
> +	for (i = 0; i < PVE.Utils.hardware_counts.net; i++) {
>  	    confid = "net" + i.toString();
>  	    rows[confid] = {
>  		group: 15,
> @@ -252,7 +252,7 @@ Ext.define('PVE.qemu.HardwareView', {
>  	    never_delete: caps.vms['VM.Config.Disk'] ? false : true,
>  	    header: gettext('EFI Disk')
>  	};
> -	for (i = 0; i < 5; i++) {
> +	for (i = 0; i < PVE.Utils.hardware_counts.usb; i++) {
>  	    confid = "usb" + i.toString();
>  	    rows[confid] = {
>  		group: 25,
> @@ -263,7 +263,7 @@ Ext.define('PVE.qemu.HardwareView', {
>  		header: gettext('USB Device') + ' (' + confid + ')'
>  	    };
>  	}
> -	for (i = 0; i < 4; i++) {
> +	for (i = 0; i < PVE.Utils.hardware_counts.hostpci; i++) {
>  	    confid = "hostpci" + i.toString();
>  	    rows[confid] = {
>  		group: 30,
> @@ -274,7 +274,7 @@ Ext.define('PVE.qemu.HardwareView', {
>  		header: gettext('PCI Device') + ' (' + confid + ')'
>  	    };
>  	}
> -	for (i = 0; i < 4; i++) {
> +	for (i = 0; i < PVE.Utils.hardware_counts.serial; i++) {
>  	    confid = "serial" + i.toString();
>  	    rows[confid] = {
>  		group: 35,
> 

applied both patches, thanks!




More information about the pve-devel mailing list