public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] config2command: add warning when SPICE memory configuration can lead to failing display initialization
@ 2024-01-12 12:56 Fiona Ebner
  2024-01-12 12:56 ` [pve-devel] [PATCH manager] ui: display edit: " Fiona Ebner
  0 siblings, 1 reply; 2+ messages in thread
From: Fiona Ebner @ 2024-01-12 12:56 UTC (permalink / raw)
  To: pve-devel

which happens with either SeaBIOS+q35 or OVMF+efitype=2m as reported
in https://bugzilla.proxmox.com/show_bug.cgi?id=3726

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 PVE/QemuServer.pm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index bbd19186..303895f9 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3489,6 +3489,27 @@ my sub print_ovmf_drive_commandlines {
     return ("if=pflash,unit=0,format=raw,readonly=on,file=$ovmf_code", $var_drive_str);
 }
 
+# See bug #3726
+my sub check_spice_memory {
+    my ($memory, $ovmf, $efidisk, $q35) = @_;
+
+    return if !$memory || $memory <= 128;
+
+    if ($ovmf) {
+	my $efitype = '2m';
+	if ($efidisk) {
+	    my $drive = parse_drive('efidisk0', $efidisk);
+	    $efitype = $drive->{efitype} if $drive->{efitype};
+	}
+
+	log_warn("limit SPICE memory to 128 MiB or use efitype=4m EFI disk if display init fails")
+	    if $efitype && $efitype eq '2m';
+    } else {
+	log_warn("limit SPICE memory to 128 MiB or use machine type i440fx if display init fails")
+	    if $q35;
+    }
+}
+
 sub config_to_command {
     my ($storecfg, $vmid, $conf, $defaults, $forcemachine, $forcecpu,
         $pbs_backing) = @_;
@@ -3650,6 +3671,9 @@ sub config_to_command {
 	}
     }
 
+    check_spice_memory($vga->{memory}, ($conf->{bios} // '') eq 'ovmf', $conf->{efidisk0}, $q35)
+	if $vga->{type} eq 'qxl';
+
     # enable absolute mouse coordinates (needed by vnc)
     my $tablet = $conf->{tablet};
     if (!defined($tablet)) {
-- 
2.39.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] [PATCH manager] ui: display edit: add warning when SPICE memory configuration can lead to failing display initialization
  2024-01-12 12:56 [pve-devel] [PATCH qemu-server] config2command: add warning when SPICE memory configuration can lead to failing display initialization Fiona Ebner
@ 2024-01-12 12:56 ` Fiona Ebner
  0 siblings, 0 replies; 2+ messages in thread
From: Fiona Ebner @ 2024-01-12 12:56 UTC (permalink / raw)
  To: pve-devel

which happens with either SeaBIOS+q35 or OVMF+efitype=2m as reported
in https://bugzilla.proxmox.com/show_bug.cgi?id=3726

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 www/manager6/qemu/DisplayEdit.js | 40 ++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/www/manager6/qemu/DisplayEdit.js b/www/manager6/qemu/DisplayEdit.js
index 9bb1763e..10ef3242 100644
--- a/www/manager6/qemu/DisplayEdit.js
+++ b/www/manager6/qemu/DisplayEdit.js
@@ -3,6 +3,8 @@ Ext.define('PVE.qemu.DisplayInputPanel', {
     xtype: 'pveDisplayInputPanel',
     onlineHelp: 'qm_display',
 
+    spiceMemoryHintRelevant: false,
+
     onGetValues: function(values) {
 	let ret = PVE.Parser.printPropertyString(values, 'type');
 	if (ret === '') {
@@ -11,6 +13,16 @@ Ext.define('PVE.qemu.DisplayInputPanel', {
 	return { vga: ret };
     },
 
+    updateSpiceMemoryHint: function() {
+	if (this.spiceMemoryHintRelevant) {
+	    let type = this.down('field[name=type]').getValue();
+	    let memory = this.down('field[name=memory]').getValue();
+	    this.down('label[name=spice-memory-hint]').setHidden(
+		!type?.match(/^qxl\d?$/) || memory <= 128
+	    );
+	}
+    },
+
     items: [{
 	name: 'type',
 	xtype: 'proxmoxKVComboBox',
@@ -49,6 +61,8 @@ Ext.define('PVE.qemu.DisplayInputPanel', {
 		    memoryfield.setEmptyText(Proxmox.Utils.defaultText);
 		}
 		memoryfield.setDisabled(disableMemoryField);
+
+		this.up('panel').updateSpiceMemoryHint();
 	    },
 	},
     },
@@ -60,6 +74,18 @@ Ext.define('PVE.qemu.DisplayInputPanel', {
 	maxValue: 512,
 	step: 4,
 	name: 'memory',
+	listeners: {
+	    change: function(cb, val) {
+		this.up('panel').updateSpiceMemoryHint();
+	    },
+	},
+    },
+    {
+	xtype: 'label',
+	text: gettext("SPICE memory > 128 MiB may not work with current EFI type or machine type"),
+	userCls: 'pmx-hint',
+	name: 'spice-memory-hint',
+	hidden: true,
     }],
 });
 
@@ -83,6 +109,20 @@ Ext.define('PVE.qemu.DisplayEdit', {
 	me.load({
 	    success: function(response) {
 		me.vmconfig = response.result.data;
+
+		// see bug #3726
+		if (me.vmconfig.bios === 'ovmf') {
+		    let efitype = '2m';
+		    if (me.vmconfig.efidisk0) {
+			let drive = PVE.Parser.parsePropertyString(me.vmconfig.efidisk0, 'file');
+			efitype = drive.efitype ? drive.efitype : efitype;
+		    }
+		    me.down('pveDisplayInputPanel').spiceMemoryHintRelevant = efitype === '2m';
+		} else {
+		    me.down('pveDisplayInputPanel').spiceMemoryHintRelevant =
+			me.vmconfig.machine?.match(/q35/);
+		}
+
 		let vga = me.vmconfig.vga || '__default__';
 		me.setValues(PVE.Parser.parsePropertyString(vga, 'type'));
 	    },
-- 
2.39.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-12 12:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-12 12:56 [pve-devel] [PATCH qemu-server] config2command: add warning when SPICE memory configuration can lead to failing display initialization Fiona Ebner
2024-01-12 12:56 ` [pve-devel] [PATCH manager] ui: display edit: " Fiona Ebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal