Add EL9 qemu path + svirt XML fixes; require glibc-langpack-en

Verified test-perl-testsuite passing on AlmaLinux 9 x86_64:
- qemu.pm: fall back to /usr/libexec/qemu-kvm when QEMU is set (RHEL ships
  no /usr/bin/qemu-system-<arch>), and use /usr/share/qemu-kvm as the qemu
  datadir (RHEL path) for KERNEL/INITRD/ipxe lookups.
- sshVirtsh.pm: pass '' instead of undef to setAttribute (EL9 XML::LibXML
  warns on undef), preserving the previous empty-attribute output.
- BuildRequires glibc-langpack-en so the full-stack/isotovideo tests have
  the en_US.UTF-8 locale.
This commit is contained in:
Andrew Lukoshko 2026-07-21 19:25:21 +02:00
parent c89b5a4f4b
commit 01eb0ddcc6
2 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,49 @@
--- a/backend/qemu.pm 2026-07-21 18:30:16.779003040 +0200
+++ b/backend/qemu.pm 2026-07-21 18:30:16.785002994 +0200
@@ -696,6 +696,8 @@
unless ($qemubin) {
if ($vars->{QEMU}) {
$qemubin = find_bin('/usr/bin/', 'qemu-system-' . $vars->{QEMU});
+ # AlmaLinux/EL9: RHEL ships qemu only as /usr/libexec/qemu-kvm
+ $qemubin ||= find_bin('/usr/libexec/', 'qemu-kvm');
}
else {
(my $class = $vars->{WORKER_CLASS} || '') =~ s/qemu_/qemu-system\-/g;
@@ -729,7 +731,7 @@
foreach my $attribute (qw(KERNEL INITRD)) {
if ($vars->{$attribute} && $vars->{$attribute} !~ /^\//) {
# Non-absolute paths are assumed relative to /usr/share/qemu
- $vars->{$attribute} = '/usr/share/qemu/' . $vars->{$attribute};
+ $vars->{$attribute} = '/usr/share/qemu-kvm/' . $vars->{$attribute};
}
if ($vars->{$attribute} && !-e $vars->{$attribute}) {
die "'$vars->{$attribute}' missing, check $attribute\n";
@@ -985,7 +987,7 @@
die "Need variable WORKER_HOSTNAME\n" unless $vars->{WORKER_HOSTNAME};
my $ipxe_binary = $vars->{UEFI} ? 'ipxe-x86_64.efi' : 'ipxe.lkrn';
my $ipxe_binary_path = "/usr/share/ipxe/$ipxe_binary";
- sp('kernel', -e $ipxe_binary_path ? $ipxe_binary_path : "/usr/share/qemu/$ipxe_binary");
+ sp('kernel', -e $ipxe_binary_path ? $ipxe_binary_path : "/usr/share/qemu-kvm/$ipxe_binary");
my $worker_ip = inet_ntoa(inet_aton($vars->{WORKER_HOSTNAME}));
die "Unable to determine worker IP from WORKER_HOSTNAME\n" unless $worker_ip;
sp('append', "dhcp && sanhook iscsi:${worker_ip}::3260:1:$vars->{NBF}", no_quotes => 1);
--- a/consoles/sshVirtsh.pm 2026-06-01 18:40:12.000000000 +0200
+++ b/consoles/sshVirtsh.pm 2026-07-21 18:40:07.631435129 +0200
@@ -210,7 +210,7 @@
if ($args->{target_type}) {
$elem->setAttribute(type => $args->{target_type});
}
- $elem->setAttribute(port => $args->{target_port});
+ $elem->setAttribute(port => $args->{target_port} // q{});
$console->appendChild($elem);
if ($args->{protocol_type}) {
@@ -285,7 +285,7 @@
my $type = delete $args->{type};
my $interface = $doc->createElement('interface');
- $interface->setAttribute(type => $type);
+ $interface->setAttribute(type => $type // q{});
$devices->appendChild($interface);
for my $key (keys %$args) {

View File

@ -52,6 +52,11 @@ Patch: 0001-fix-test-use-linuxboot_dma.bin-in-18-backend-qemu.t.patch
# off (avoids the SLOF once=d trap), add BOOTFROM=d one-shot CD boot opt-in,
# and skip audio which EL9 ppc64le QEMU has no device model for.
Patch: 0001-Add-ppc64le-support-to-QEMU-backend.patch
# AlmaLinux/EL9: RHEL ships qemu only as /usr/libexec/qemu-kvm and its data
# under /usr/share/qemu-kvm (not /usr/share/qemu); and EL9's XML::LibXML warns
# on setAttribute(attr => undef). Fix the qemu binary/datadir lookup and the
# svirt domain-XML attribute handling.
Patch: 0001-EL9-qemu-paths-and-svirt-xml-attr.patch
# on SUSE this is conditional, for us it doesn't have to be but we
# still use a macro just to keep build_requires similar for ease of
@ -119,6 +124,9 @@ Patch: 0001-Add-ppc64le-support-to-QEMU-backend.patch
BuildRequires: perl-devel
BuildRequires: perl-generators
BuildRequires: systemd
# AlmaLinux/EL9: the full-stack and isotovideo tests need the en_US.UTF-8
# locale; on a minimal buildroot it is only present via glibc-langpack-en.
BuildRequires: glibc-langpack-en
%if 0%{?no_fullstack}
%else
BuildRequires: perl(Mojo::File)