From: Kaiyang Wu <wukaiyang2003@gmail.com>
To: pve-devel@lists.proxmox.com
Cc: Kaiyang Wu <wukaiyang@loongfans.cn>
Subject: [PATCH qemu-server v3 2/2] qemuserver: make vga model mapping architecture-aware
Date: Thu, 16 Jul 2026 18:43:51 +0800 [thread overview]
Message-ID: <20260716104440.302873-3-wukaiyang@loongfans.cn> (raw)
In-Reply-To: <20260716104440.302873-1-wukaiyang@loongfans.cn>
Fix virtio-gpu not being available on aarch64.
QEMU only provides the non-VGA variant of virtio-gpu-gl on aarch64.
Add 'map_vga_model' subroutine to map VGA models to correct device
names on different architectures accordingly, replacing the old 'vga_map'
look up method.
Suggested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Kaiyang Wu <wukaiyang@loongfans.cn>
---
src/PVE/QemuServer.pm | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index c11351bb..e4e15f12 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -1475,21 +1475,29 @@ sub print_netdev_full {
return $netdev;
}
-my $vga_map = {
- 'cirrus' => 'cirrus-vga',
- 'std' => 'VGA',
- 'vmware' => 'vmware-svga',
- 'virtio' => 'virtio-vga',
- 'virtio-gl' => 'virtio-vga-gl',
-};
+sub map_vga_model {
+ my ($vga_type, $arch) = @_;
+ my $vga_map = {
+ 'cirrus' => 'cirrus-vga',
+ 'std' => 'VGA',
+ 'vmware' => 'vmware-svga',
+ };
+
+ if ($arch eq 'x86_64') {
+ $vga_map->{'virtio'} = 'virtio-vga';
+ $vga_map->{'virtio-gl'} = 'virtio-vga-gl';
+ } elsif ($arch eq 'aarch64') {
+ $vga_map->{'virtio'} = 'virtio-gpu';
+ $vga_map->{'virtio-gl'} = 'virtio-gpu-gl';
+ }
+
+ return $vga_map->{$vga_type};
+}
sub print_vga_device {
my ($conf, $vga, $arch, $machine_version, $id, $qxlnum, $bridges) = @_;
- my $type = $vga_map->{ $vga->{type} };
- if ($arch eq 'aarch64' && defined($type) && $type eq 'virtio-vga') {
- $type = 'virtio-gpu';
- }
+ my $type = map_vga_model($vga->{type}, $arch);
my $vgamem_mb = $vga->{memory};
my $max_outputs = '';
--
2.52.0
prev parent reply other threads:[~2026-07-16 10:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 10:43 [PATCH qemu-server v3 0/2] qemuserver: fix virtio-gpu not being available on aarch64 Kaiyang Wu
2026-07-16 10:43 ` [PATCH qemu-server v3 1/2] qemuserver: make base path of libGL and libEGL libraries architecture-aware Kaiyang Wu
2026-07-16 10:43 ` Kaiyang Wu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260716104440.302873-3-wukaiyang@loongfans.cn \
--to=wukaiyang2003@gmail.com \
--cc=pve-devel@lists.proxmox.com \
--cc=wukaiyang@loongfans.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox