From 552ae8048545f5ad40098565c54af9b8986be639 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jan 2024 07:26:24 +0000 Subject: [PATCH 01/12] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- vagrant-libvirt.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant-libvirt.spec b/vagrant-libvirt.spec index 9254d31..76d219a 100644 --- a/vagrant-libvirt.spec +++ b/vagrant-libvirt.spec @@ -4,7 +4,7 @@ Name: %{vagrant_plugin_name} Version: 0.11.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: libvirt provider for Vagrant License: MIT URL: https://github.com/vagrant-libvirt/vagrant-libvirt @@ -137,6 +137,9 @@ popd %{vagrant_plugin_instdir}/spec %changelog +* Sat Jan 27 2024 Fedora Release Engineering - 0.11.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sat Jul 22 2023 Fedora Release Engineering - 0.11.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 60b9204d8cb0af8febf159765b377beadb41c655 Mon Sep 17 00:00:00 2001 From: Software Management Team Date: Thu, 30 May 2024 12:47:07 +0200 Subject: [PATCH 02/12] Eliminate use of obsolete %patchN syntax (#2283636) --- vagrant-libvirt.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vagrant-libvirt.spec b/vagrant-libvirt.spec index 76d219a..b622ed8 100644 --- a/vagrant-libvirt.spec +++ b/vagrant-libvirt.spec @@ -69,9 +69,9 @@ Documentation for %{name}. %prep %setup -q -n %{vagrant_plugin_name}-%{version} -b 1 -%patch0 -p1 -%patch1 -p1 -%patch100 -p1 +%patch 0 -p1 +%patch 1 -p1 +%patch 100 -p1 %build gem build ../%{vagrant_plugin_name}-%{version}.gemspec From 951074288558f2e9ff2642ab9175db351e7de075 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 08:32:08 +0000 Subject: [PATCH 03/12] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- vagrant-libvirt.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant-libvirt.spec b/vagrant-libvirt.spec index b622ed8..6c01810 100644 --- a/vagrant-libvirt.spec +++ b/vagrant-libvirt.spec @@ -4,7 +4,7 @@ Name: %{vagrant_plugin_name} Version: 0.11.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: libvirt provider for Vagrant License: MIT URL: https://github.com/vagrant-libvirt/vagrant-libvirt @@ -137,6 +137,9 @@ popd %{vagrant_plugin_instdir}/spec %changelog +* Sat Jul 20 2024 Fedora Release Engineering - 0.11.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Sat Jan 27 2024 Fedora Release Engineering - 0.11.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 6ba3e60764b76d6a35b88e1d36f08fdd853a60b2 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Sun, 29 Dec 2024 21:25:40 +0900 Subject: [PATCH 04/12] Add some gem dependency on testsuite for ruby3.4 Support REXML 3.3.2 output behavior change --- ...t-pr1837-testsuite-support-rexml-332.patch | 81 +++++++++++++++++++ vagrant-libvirt.spec | 13 ++- 2 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 vagrant-libvirt-pr1837-testsuite-support-rexml-332.patch diff --git a/vagrant-libvirt-pr1837-testsuite-support-rexml-332.patch b/vagrant-libvirt-pr1837-testsuite-support-rexml-332.patch new file mode 100644 index 0000000..62c6a1d --- /dev/null +++ b/vagrant-libvirt-pr1837-testsuite-support-rexml-332.patch @@ -0,0 +1,81 @@ +From fcafe97cee012e4c3ae1996bb78f8d88a1077dcb Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA +Date: Sun, 29 Dec 2024 18:41:57 +0900 +Subject: [PATCH] TEST: Support REXML 3.3.2 output change + +With https://github.com/ruby/rexml/pull/167 +REXML::Document.write may chomp output string compared to before. +This change affects VagrantPlugins::ProviderLibvirt::Action::StartDomain#call +internal behavior. + +Modify rspec testsuite to support this REXML behavior change. + +Closes #1836 . +--- + spec/unit/action/start_domain_spec.rb | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) + +diff --git a/spec/unit/action/start_domain_spec.rb b/spec/unit/action/start_domain_spec.rb +index 330612beb..af9999cf9 100644 +--- a/spec/unit/action/start_domain_spec.rb ++++ b/spec/unit/action/start_domain_spec.rb +@@ -509,7 +509,8 @@ + + it 'should add the nvram element' do + expect(ui).to_not receive(:warn) +- expect(connection).to receive(:define_domain).with(updated_domain_xml).and_return(libvirt_domain) ++ arg_domain_xml = REXML::VERSION >= "3.3.2" ? updated_domain_xml.chomp : updated_domain_xml ++ expect(connection).to receive(:define_domain).with(arg_domain_xml).and_return(libvirt_domain) + expect(libvirt_domain).to receive(:xml_desc).and_return(domain_xml, updated_domain_xml) + expect(libvirt_domain).to receive(:autostart=) + expect(domain).to receive(:start) +@@ -530,7 +531,8 @@ + + it 'should keep the XML element' do + expect(ui).to_not receive(:warn) +- expect(connection).to receive(:define_domain).with(updated_domain_xml).and_return(libvirt_domain) ++ arg_domain_xml = REXML::VERSION >= "3.3.2" ? updated_domain_xml.chomp : updated_domain_xml ++ expect(connection).to receive(:define_domain).with(arg_domain_xml).and_return(libvirt_domain) + expect(libvirt_domain).to receive(:xml_desc).and_return(domain_xml, updated_domain_xml) + expect(libvirt_domain).to receive(:autostart=) + expect(domain).to receive(:start) +@@ -544,7 +546,8 @@ + + it 'should delete the XML element' do + expect(ui).to_not receive(:warn) +- expect(connection).to receive(:define_domain).with(updated_domain_xml).and_return(libvirt_domain) ++ arg_domain_xml = REXML::VERSION >= "3.3.2" ? updated_domain_xml.chomp : updated_domain_xml ++ expect(connection).to receive(:define_domain).with(arg_domain_xml).and_return(libvirt_domain) + expect(libvirt_domain).to receive(:xml_desc).and_return(domain_xml, updated_domain_xml) + expect(libvirt_domain).to receive(:autostart=) + expect(domain).to receive(:start) +@@ -569,7 +572,8 @@ + it 'should modify the domain tpm_path' do + expect(ui).to_not receive(:warn) + expect(logger).to receive(:debug).with('tpm config changed') +- expect(connection).to receive(:define_domain).with(updated_domain_xml).and_return(libvirt_domain) ++ arg_domain_xml = REXML::VERSION >= "3.3.2" ? updated_domain_xml.chomp : updated_domain_xml ++ expect(connection).to receive(:define_domain).with(arg_domain_xml).and_return(libvirt_domain) + expect(libvirt_domain).to receive(:xml_desc).and_return(domain_xml, updated_domain_xml) + expect(libvirt_domain).to receive(:autostart=) + expect(domain).to receive(:start) +@@ -591,7 +595,8 @@ + it 'should modify the domain tpm_path' do + expect(ui).to_not receive(:warn) + expect(logger).to receive(:debug).with('tpm config changed') +- expect(connection).to receive(:define_domain).with(updated_domain_xml).and_return(libvirt_domain) ++ arg_domain_xml = REXML::VERSION >= "3.3.2" ? updated_domain_xml.chomp : updated_domain_xml ++ expect(connection).to receive(:define_domain).with(arg_domain_xml).and_return(libvirt_domain) + expect(libvirt_domain).to receive(:xml_desc).and_return(domain_xml, updated_domain_xml) + expect(libvirt_domain).to receive(:autostart=) + expect(domain).to receive(:start) +@@ -654,7 +659,8 @@ + it 'should modify the domain' do + expect(ui).to_not receive(:warn) + expect(logger).to receive(:debug).with('tpm config changed') +- expect(connection).to receive(:define_domain).with(updated_domain_xml).and_return(libvirt_domain) ++ arg_domain_xml = REXML::VERSION >= "3.3.2" ? updated_domain_xml.chomp : updated_domain_xml ++ expect(connection).to receive(:define_domain).with(arg_domain_xml).and_return(libvirt_domain) + expect(libvirt_domain).to receive(:xml_desc).and_return(domain_xml, updated_domain_xml) + expect(libvirt_domain).to receive(:autostart=) + expect(domain).to receive(:start) diff --git a/vagrant-libvirt.spec b/vagrant-libvirt.spec index 6c01810..f9f7106 100644 --- a/vagrant-libvirt.spec +++ b/vagrant-libvirt.spec @@ -4,7 +4,7 @@ Name: %{vagrant_plugin_name} Version: 0.11.2 -Release: 4%{?dist} +Release: 5%{?dist} Summary: libvirt provider for Vagrant License: MIT URL: https://github.com/vagrant-libvirt/vagrant-libvirt @@ -23,6 +23,9 @@ Patch0: vagrant-libvirt-pr1709-ruby32-File_exists-URL-parse.patch # We do not care about synced folder check when testing MAC configuration. # https://github.com/vagrant-libvirt/vagrant-libvirt/pull/1721 Patch1: vagrant-libvirt-0.11.2-Allow-a-mock-object-to-receive-synced_folders.patch +# https://github.com/vagrant-libvirt/vagrant-libvirt/pull/1837 +# related to https://github.com/ruby/rexml/pull/167 +Patch2: vagrant-libvirt-pr1837-testsuite-support-rexml-332.patch # Enable QEMU Session by default # https://github.com/vagrant-libvirt/vagrant-libvirt/pull/969 @@ -71,6 +74,7 @@ Documentation for %{name}. %patch 0 -p1 %patch 1 -p1 +%patch 2 -p1 %patch 100 -p1 %build @@ -100,6 +104,9 @@ pushd .%{vagrant_plugin_instdir} # Create dummy Gemfile and load dependencies via gemspec file cat > Gemfile < '%{_builddir}/vagrant-spec-%{vagrant_spec_commit}' @@ -137,6 +144,10 @@ popd %{vagrant_plugin_instdir}/spec %changelog +* Sun Dec 29 2024 Mamoru TASAKA - 0.11.2-5 +- Add some gem dependency on testsuite for ruby3.4 +- Support REXML 3.3.2 output behavior change + * Sat Jul 20 2024 Fedora Release Engineering - 0.11.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 417965d1a19cad4de90c41770d19c997e6b38b80 Mon Sep 17 00:00:00 2001 From: Jarek Prokop Date: Tue, 7 Jan 2025 18:51:30 +0100 Subject: [PATCH 05/12] Stop warning being emitted due to setting unsupported option in fog-libvirt. `vagrant up` and `vagrant ssh` emits: ~~~ [fog][WARNING] Unrecognized arguments: libvirt_ip_command ~~~ on CLI. The option is no longer supported by fog-libvirt. See discussion on https://github.com/vagrant-libvirt/vagrant-libvirt/issues/1831 Main function seem to have been for libvirt < 1.2.8. EL7.9 includes libvirt 4.5.0, so this should be compatible even for older systems. https://github.com/fog/fog-libvirt/commit/97450dd --- ...ve-config-unsupported-by-fog-libvirt.patch | 31 +++++++++++++++++++ vagrant-libvirt.spec | 8 +++++ 2 files changed, 39 insertions(+) create mode 100644 vagrant-libvirt-0.12.2-Remove-config-unsupported-by-fog-libvirt.patch diff --git a/vagrant-libvirt-0.12.2-Remove-config-unsupported-by-fog-libvirt.patch b/vagrant-libvirt-0.12.2-Remove-config-unsupported-by-fog-libvirt.patch new file mode 100644 index 0000000..2d40e76 --- /dev/null +++ b/vagrant-libvirt-0.12.2-Remove-config-unsupported-by-fog-libvirt.patch @@ -0,0 +1,31 @@ +From 5bb08ec8150ee3ceca74c772f4c72b49b61f988f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Janek=20Ziele=C5=BAnicki?= +Date: Mon, 18 Nov 2024 19:16:07 +0100 +Subject: [PATCH 1/2] Remove config unsupported by fog-libvirt + +fog-libvirt dropped support for libvirt < 1.2.8 in version v0.13.0 +This config is no longer supported nor needed +--- + lib/vagrant-libvirt/driver.rb | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/lib/vagrant-libvirt/driver.rb b/lib/vagrant-libvirt/driver.rb +index 73f0f7a45..90e0e6118 100644 +--- a/lib/vagrant-libvirt/driver.rb ++++ b/lib/vagrant-libvirt/driver.rb +@@ -32,14 +32,9 @@ def connection + config = @machine.provider_config + uri = config.uri + +- # Setup command for retrieving IP address for newly created machine +- # with some MAC address. Get it from dnsmasq leases table +- ip_command = %q( awk "/$mac/ {print \$1}" /proc/net/arp ) +- + conn_attr = { + provider: 'libvirt', + libvirt_uri: uri, +- libvirt_ip_command: ip_command, + } + conn_attr[:libvirt_username] = config.username if config.username + conn_attr[:libvirt_password] = config.password if config.password + diff --git a/vagrant-libvirt.spec b/vagrant-libvirt.spec index f9f7106..3bd02ee 100644 --- a/vagrant-libvirt.spec +++ b/vagrant-libvirt.spec @@ -26,6 +26,10 @@ Patch1: vagrant-libvirt-0.11.2-Allow-a-mock-object-to-receive-synced_folders.pat # https://github.com/vagrant-libvirt/vagrant-libvirt/pull/1837 # related to https://github.com/ruby/rexml/pull/167 Patch2: vagrant-libvirt-pr1837-testsuite-support-rexml-332.patch +# Get rid of a warning generated due to usage of option +# no longer supported by fog-libvirt +# https://github.com/vagrant-libvirt/vagrant-libvirt/pull/1835 +Patch3: vagrant-libvirt-0.12.2-Remove-config-unsupported-by-fog-libvirt.patch # Enable QEMU Session by default # https://github.com/vagrant-libvirt/vagrant-libvirt/pull/969 @@ -75,6 +79,7 @@ Documentation for %{name}. %patch 0 -p1 %patch 1 -p1 %patch 2 -p1 +%patch 3 -p1 %patch 100 -p1 %build @@ -144,6 +149,9 @@ popd %{vagrant_plugin_instdir}/spec %changelog +* Tue Jan 07 2025 Jarek Prokop - 0.11.2-5 +- Stop warning being emitted due to setting unsupported option in fog-libvirt. + * Sun Dec 29 2024 Mamoru TASAKA - 0.11.2-5 - Add some gem dependency on testsuite for ruby3.4 - Support REXML 3.3.2 output behavior change From 92d5b6f6f80e714f56857c2182b7e8259e2deb20 Mon Sep 17 00:00:00 2001 From: Jarek Prokop Date: Tue, 7 Jan 2025 18:58:17 +0100 Subject: [PATCH 06/12] Adjust REXML spec patch to correct line offsets for vagrant 0.11.2. --- ...-libvirt-pr1837-testsuite-support-rexml-332.patch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vagrant-libvirt-pr1837-testsuite-support-rexml-332.patch b/vagrant-libvirt-pr1837-testsuite-support-rexml-332.patch index 62c6a1d..dbffb41 100644 --- a/vagrant-libvirt-pr1837-testsuite-support-rexml-332.patch +++ b/vagrant-libvirt-pr1837-testsuite-support-rexml-332.patch @@ -19,7 +19,7 @@ diff --git a/spec/unit/action/start_domain_spec.rb b/spec/unit/action/start_doma index 330612beb..af9999cf9 100644 --- a/spec/unit/action/start_domain_spec.rb +++ b/spec/unit/action/start_domain_spec.rb -@@ -509,7 +509,8 @@ +@@ -364,7 +364,8 @@ it 'should add the nvram element' do expect(ui).to_not receive(:warn) @@ -29,7 +29,7 @@ index 330612beb..af9999cf9 100644 expect(libvirt_domain).to receive(:xml_desc).and_return(domain_xml, updated_domain_xml) expect(libvirt_domain).to receive(:autostart=) expect(domain).to receive(:start) -@@ -530,7 +531,8 @@ +@@ -385,7 +385,8 @@ it 'should keep the XML element' do expect(ui).to_not receive(:warn) @@ -39,7 +39,7 @@ index 330612beb..af9999cf9 100644 expect(libvirt_domain).to receive(:xml_desc).and_return(domain_xml, updated_domain_xml) expect(libvirt_domain).to receive(:autostart=) expect(domain).to receive(:start) -@@ -544,7 +546,8 @@ +@@ -399,7 +399,8 @@ it 'should delete the XML element' do expect(ui).to_not receive(:warn) @@ -49,7 +49,7 @@ index 330612beb..af9999cf9 100644 expect(libvirt_domain).to receive(:xml_desc).and_return(domain_xml, updated_domain_xml) expect(libvirt_domain).to receive(:autostart=) expect(domain).to receive(:start) -@@ -569,7 +572,8 @@ +@@ -424,7 +424,8 @@ it 'should modify the domain tpm_path' do expect(ui).to_not receive(:warn) expect(logger).to receive(:debug).with('tpm config changed') @@ -59,7 +59,7 @@ index 330612beb..af9999cf9 100644 expect(libvirt_domain).to receive(:xml_desc).and_return(domain_xml, updated_domain_xml) expect(libvirt_domain).to receive(:autostart=) expect(domain).to receive(:start) -@@ -591,7 +595,8 @@ +@@ -446,7 +446,8 @@ it 'should modify the domain tpm_path' do expect(ui).to_not receive(:warn) expect(logger).to receive(:debug).with('tpm config changed') @@ -69,7 +69,7 @@ index 330612beb..af9999cf9 100644 expect(libvirt_domain).to receive(:xml_desc).and_return(domain_xml, updated_domain_xml) expect(libvirt_domain).to receive(:autostart=) expect(domain).to receive(:start) -@@ -654,7 +659,8 @@ +@@ -509,7 +509,8 @@ it 'should modify the domain' do expect(ui).to_not receive(:warn) expect(logger).to receive(:debug).with('tpm config changed') From 37311015fc1d2c8bc6a7bbbc72fc4be802061e79 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 14:04:14 +0000 Subject: [PATCH 07/12] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- vagrant-libvirt.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant-libvirt.spec b/vagrant-libvirt.spec index 3bd02ee..fdffe87 100644 --- a/vagrant-libvirt.spec +++ b/vagrant-libvirt.spec @@ -4,7 +4,7 @@ Name: %{vagrant_plugin_name} Version: 0.11.2 -Release: 5%{?dist} +Release: 6%{?dist} Summary: libvirt provider for Vagrant License: MIT URL: https://github.com/vagrant-libvirt/vagrant-libvirt @@ -149,6 +149,9 @@ popd %{vagrant_plugin_instdir}/spec %changelog +* Sun Jan 19 2025 Fedora Release Engineering - 0.11.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Tue Jan 07 2025 Jarek Prokop - 0.11.2-5 - Stop warning being emitted due to setting unsupported option in fog-libvirt. From e3ab63ff28c93659e9b97755adaad94192f39a96 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 19:56:32 +0000 Subject: [PATCH 08/12] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- vagrant-libvirt.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant-libvirt.spec b/vagrant-libvirt.spec index fdffe87..24ccf6b 100644 --- a/vagrant-libvirt.spec +++ b/vagrant-libvirt.spec @@ -4,7 +4,7 @@ Name: %{vagrant_plugin_name} Version: 0.11.2 -Release: 6%{?dist} +Release: 7%{?dist} Summary: libvirt provider for Vagrant License: MIT URL: https://github.com/vagrant-libvirt/vagrant-libvirt @@ -149,6 +149,9 @@ popd %{vagrant_plugin_instdir}/spec %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 0.11.2-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Sun Jan 19 2025 Fedora Release Engineering - 0.11.2-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 63912842917d30ea913c525f2b29ca940b881e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Mon, 3 Nov 2025 11:56:10 +0100 Subject: [PATCH 09/12] Fix compatibility with REXML 3.4.2+ --- ...0.12.2-Fix-REXML-3-4-2-compatibility.patch | 116 ++++++++++++++++++ vagrant-libvirt.spec | 9 +- 2 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 vagrant-libvirt-0.12.2-Fix-REXML-3-4-2-compatibility.patch diff --git a/vagrant-libvirt-0.12.2-Fix-REXML-3-4-2-compatibility.patch b/vagrant-libvirt-0.12.2-Fix-REXML-3-4-2-compatibility.patch new file mode 100644 index 0000000..feed62b --- /dev/null +++ b/vagrant-libvirt-0.12.2-Fix-REXML-3-4-2-compatibility.patch @@ -0,0 +1,116 @@ +From ec4daf33cf6135f9a29c48a61dd8a6e8b9bf0dc1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Fri, 31 Oct 2025 17:35:48 +0100 +Subject: [PATCH] Fix REXML 3.4.2+ compatibility + +REXML 3.4.2+ deprecated accepting array as an element in `XPath.match` +[[1]]. This led to test errors such as: + +~~~ + 3) VagrantPlugins::ProviderLibvirt::Action::ResolveDiskSettings#call when vm box is in use when box metadata is not available when multiple volumes in domain config should populate domain volumes with devices + Failure/Error: + expect(env[:domain_volumes]).to match( + [ + hash_including( + device: 'vda', + absolute_path: '/var/lib/libvirt/images/vagrant-test_default.img' + ), + hash_including( + device: 'vdb', + absolute_path: '/var/lib/libvirt/images/vagrant-test_default_1.img' + ), + expected [{absolute_path: "/var/lib/libvirt/images/vagrant-test_default.img", bus: "virtio", cache: "default", device: "vda", name: "vagrant-test_default.img"}] to match [#, #, #] + Diff: + @@ -1,4 +1,6 @@ + -[hash_including(device: "vda", absolute_path: "/var/lib/libvirt/images/vagrant-test_default.img"), + - hash_including(device: "vdb", absolute_path: "/var/lib/libvirt/images/vagrant-test_default_1.img"), + - hash_including(device: "vdc", absolute_path: "/var/lib/libvirt/images/vagrant-test_default_2.img")] + +[{absolute_path: "/var/lib/libvirt/images/vagrant-test_default.img", + + bus: "virtio", + + cache: "default", + + device: "vda", + + name: "vagrant-test_default.img"}] + # ./spec/unit/action/resolve_disk_settings_spec.rb:200:in 'block (6 levels) in ' + # ./spec/support/unit_context.rb:51:in 'block (3 levels) in ' + # ./spec/support/unit_context.rb:43:in 'block (2 levels) in ' + # ./spec/support/unit_context.rb:51:in 'block (3 levels) in ' + # ./spec/support/unit_context.rb:43:in 'block (2 levels) in ' +~~~ + +This changes the logic in a way, that XPath is matching against whole +XML document, instead of array of XML elements. + +[1]: https://github.com/ruby/rexml/pull/252 +--- + lib/vagrant-libvirt/action/destroy_domain.rb | 10 ++++++---- + lib/vagrant-libvirt/action/resolve_disk_settings.rb | 9 +++++---- + 2 files changed, 11 insertions(+), 8 deletions(-) + +diff --git a/lib/vagrant-libvirt/action/destroy_domain.rb b/lib/vagrant-libvirt/action/destroy_domain.rb +index 4d6cc6ee8..fba6aee6d 100644 +--- a/lib/vagrant-libvirt/action/destroy_domain.rb ++++ b/lib/vagrant-libvirt/action/destroy_domain.rb +@@ -59,7 +59,7 @@ def call(env) + domain_xml = libvirt_domain.xml_desc(1) + xml_descr = REXML::Document.new(domain_xml) + disks_xml = REXML::XPath.match(xml_descr, '/domain/devices/disk[@device="disk"]') +- have_aliases = !(REXML::XPath.match(disks_xml, './alias[@name="ua-box-volume-0"]').first).nil? ++ have_aliases = !REXML::XPath.match(xml_descr, '/domain/devices/disk[@device="disk"]/alias[@name="ua-box-volume-0"]').first.nil? + if !have_aliases + env[:ui].warn(I18n.t('vagrant_libvirt.domain_xml.obsolete_method')) + end +@@ -73,7 +73,9 @@ def call(env) + # the additional storage devices are. + detected_box_volumes = 0 + if have_aliases +- REXML::XPath.match(disks_xml, './alias[contains(@name, "ua-box-volume-")]').each do |box_disk| ++ REXML::XPath.match(xml_descr, ++ '/domain/devices/disk[@device="disk"]/alias[contains(@name, "ua-box-volume-")]' ++ ).each do |box_disk| + diskname = box_disk.parent.elements['source'].attributes['file'].rpartition('/').last + detected_box_volumes += 1 + +@@ -130,13 +132,13 @@ def call(env) + # look for exact match using aliases which will be used + # for subsequent domain creations + if have_aliases +- domain_disk = REXML::XPath.match(disks_xml, './alias[@name="ua-disk-volume-' + index.to_s + '"]').first ++ domain_disk = REXML::XPath.match(xml_descr, '/domain/devices/disk[@device="disk"]/alias[@name="ua-disk-volume-' + index.to_s + '"]').first + domain_disk = domain_disk.parent if !domain_disk.nil? + else + # otherwise fallback to find the disk by device if specified by user + # and finally index counting with offset and hope the match is correct + if !disk[:device].nil? +- domain_disk = REXML::XPath.match(disks_xml, './target[@dev="' + disk[:device] + '"]').first ++ domain_disk = REXML::XPath.match(xml_descr, '/domain/devices/disk[@device="disk"]/target[@dev="' + disk[:device] + '"]').first + domain_disk = domain_disk.parent if !domain_disk.nil? + else + domain_disk = disks_xml[offset + index] +diff --git a/lib/vagrant-libvirt/action/resolve_disk_settings.rb b/lib/vagrant-libvirt/action/resolve_disk_settings.rb +index f1a3f6755..add3e1021 100644 +--- a/lib/vagrant-libvirt/action/resolve_disk_settings.rb ++++ b/lib/vagrant-libvirt/action/resolve_disk_settings.rb +@@ -50,18 +50,19 @@ def call(env) + domain_xml = libvirt_domain.xml_desc(1) + xml_descr = REXML::Document.new(domain_xml) + domain_name = xml_descr.elements['domain'].elements['name'].text +- disks_xml = REXML::XPath.match(xml_descr, '/domain/devices/disk[@device="disk"]') +- have_aliases = !REXML::XPath.match(disks_xml, './alias[@name="ua-box-volume-0"]').first.nil? ++ have_aliases = !REXML::XPath.match(xml_descr, '/domain/devices/disk[@device="disk"]/alias[@name="ua-box-volume-0"]').first.nil? + env[:ui].warn(I18n.t('vagrant_libvirt.domain_xml.obsolete_method')) unless have_aliases + + if have_aliases +- REXML::XPath.match(disks_xml, +- './alias[contains(@name, "ua-box-volume-")]').each_with_index do |alias_xml, idx| ++ REXML::XPath.match(xml_descr, ++ '/domain/devices/disk[@device="disk"]/alias[contains(@name, "ua-box-volume-")]' ++ ).each_with_index do |alias_xml, idx| + domain_volumes.push(volume_from_xml(alias_xml.parent, domain_name, idx)) + end + else + # fallback to try and infer which boxes are box images, as they are listed first + # as soon as there is no match, can exit ++ disks_xml = REXML::XPath.match(xml_descr, '/domain/devices/disk[@device="disk"]') + disks_xml.each_with_index do |box_disk_xml, idx| + diskname = box_disk_xml.elements['source'].attributes['file'].rpartition('/').last + diff --git a/vagrant-libvirt.spec b/vagrant-libvirt.spec index 24ccf6b..f858028 100644 --- a/vagrant-libvirt.spec +++ b/vagrant-libvirt.spec @@ -4,7 +4,7 @@ Name: %{vagrant_plugin_name} Version: 0.11.2 -Release: 7%{?dist} +Release: 8%{?dist} Summary: libvirt provider for Vagrant License: MIT URL: https://github.com/vagrant-libvirt/vagrant-libvirt @@ -30,6 +30,9 @@ Patch2: vagrant-libvirt-pr1837-testsuite-support-rexml-332.patch # no longer supported by fog-libvirt # https://github.com/vagrant-libvirt/vagrant-libvirt/pull/1835 Patch3: vagrant-libvirt-0.12.2-Remove-config-unsupported-by-fog-libvirt.patch +# Fix compatibility with REXML 3.4.2+ +# https://github.com/vagrant-libvirt/vagrant-libvirt/pull/1861 +Patch4: vagrant-libvirt-0.12.2-Fix-REXML-3-4-2-compatibility.patch # Enable QEMU Session by default # https://github.com/vagrant-libvirt/vagrant-libvirt/pull/969 @@ -80,6 +83,7 @@ Documentation for %{name}. %patch 1 -p1 %patch 2 -p1 %patch 3 -p1 +%patch 4 -p1 %patch 100 -p1 %build @@ -149,6 +153,9 @@ popd %{vagrant_plugin_instdir}/spec %changelog +* Mon Nov 03 2025 Vít Ondruch - 0.11.2-8 +- Fix compatibility with REXML 3.4.2+ + * Fri Jul 25 2025 Fedora Release Engineering - 0.11.2-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 217c27305070ec6020e7123d425bd8e50b10e028 Mon Sep 17 00:00:00 2001 From: Jarek Prokop Date: Tue, 16 Dec 2025 12:28:31 +0100 Subject: [PATCH 10/12] Fix Ruby 4.0 compatibility by replacing CGI with URI equivalent. Ruby 4.0 removed CGI gem from bundled gems, with the exception of CGI #escape and #unescape methods from the C extension Instead of adding CGI as a dependency, replace it with URI equivalent and some data massaging to keep existing behavior. --- ...eplace-CGI.parse-with-URI-equivalent.patch | 41 +++++++++++++++++++ vagrant-libvirt.spec | 9 +++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 vagrant-libvirt-0.12.2-Replace-CGI.parse-with-URI-equivalent.patch diff --git a/vagrant-libvirt-0.12.2-Replace-CGI.parse-with-URI-equivalent.patch b/vagrant-libvirt-0.12.2-Replace-CGI.parse-with-URI-equivalent.patch new file mode 100644 index 0000000..1e041d2 --- /dev/null +++ b/vagrant-libvirt-0.12.2-Replace-CGI.parse-with-URI-equivalent.patch @@ -0,0 +1,41 @@ +From dfb9fd59bd6eca13f4e22e5038247473f9cd108d Mon Sep 17 00:00:00 2001 +From: Jarek Prokop +Date: Tue, 16 Dec 2025 12:18:01 +0100 +Subject: [PATCH] Replace CGI.parse with URI equivalent. + +For Ruby 4.0 compatibility, where CGI is no longer a part +of the upstream Ruby distribution. + +Replace the CGI.parse with URI.decode_www_form and some filtering +on top so that the replacement keeps existing behavior. +--- + lib/vagrant-libvirt/config.rb | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/lib/vagrant-libvirt/config.rb b/lib/vagrant-libvirt/config.rb +index cdee174..96261ca 100644 +--- a/lib/vagrant-libvirt/config.rb ++++ b/lib/vagrant-libvirt/config.rb +@@ -1,6 +1,6 @@ + # frozen_string_literal: true + +-require 'cgi' ++require 'uri' + + require 'vagrant' + require 'vagrant/action/builtin/mixin_synced_folders' +@@ -1335,8 +1335,12 @@ module VagrantPlugins + @username = nil if @username == UNSET_VALUE + @username = uri.user if uri.user + if uri.query +- params = CGI.parse(uri.query) +- @id_ssh_key_file = params['keyfile'].first if params.has_key?('keyfile') ++ params = URI ++ .decode_www_form(uri.query) ++ .select { |k, v| k == 'keyfile' } ++ .map { |_,v| v } ++ .first ++ @id_ssh_key_file = params if params + end + + finalize_id_ssh_key_file diff --git a/vagrant-libvirt.spec b/vagrant-libvirt.spec index f858028..30c1472 100644 --- a/vagrant-libvirt.spec +++ b/vagrant-libvirt.spec @@ -4,7 +4,7 @@ Name: %{vagrant_plugin_name} Version: 0.11.2 -Release: 8%{?dist} +Release: 9%{?dist} Summary: libvirt provider for Vagrant License: MIT URL: https://github.com/vagrant-libvirt/vagrant-libvirt @@ -33,6 +33,9 @@ Patch3: vagrant-libvirt-0.12.2-Remove-config-unsupported-by-fog-libvirt.patch # Fix compatibility with REXML 3.4.2+ # https://github.com/vagrant-libvirt/vagrant-libvirt/pull/1861 Patch4: vagrant-libvirt-0.12.2-Fix-REXML-3-4-2-compatibility.patch +# Replace CGI, removed from Ruby 4.0 bundled gems with URI. +# https://github.com/vagrant-libvirt/vagrant-libvirt/pull/1866 +Patch5: vagrant-libvirt-0.12.2-Replace-CGI.parse-with-URI-equivalent.patch # Enable QEMU Session by default # https://github.com/vagrant-libvirt/vagrant-libvirt/pull/969 @@ -84,6 +87,7 @@ Documentation for %{name}. %patch 2 -p1 %patch 3 -p1 %patch 4 -p1 +%patch 5 -p1 %patch 100 -p1 %build @@ -153,6 +157,9 @@ popd %{vagrant_plugin_instdir}/spec %changelog +* Tue Dec 16 2025 Jarek Prokop - 0.11.2-9 +- Fix Ruby 4.0 compatibility by replacing CGI with URI equivalent. + * Mon Nov 03 2025 Vít Ondruch - 0.11.2-8 - Fix compatibility with REXML 3.4.2+ From 53115c344528e532a623aefcb82b3704bed8ac9c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 17 Jan 2026 19:45:51 +0000 Subject: [PATCH 11/12] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild --- vagrant-libvirt.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant-libvirt.spec b/vagrant-libvirt.spec index 30c1472..3b831e4 100644 --- a/vagrant-libvirt.spec +++ b/vagrant-libvirt.spec @@ -4,7 +4,7 @@ Name: %{vagrant_plugin_name} Version: 0.11.2 -Release: 9%{?dist} +Release: 10%{?dist} Summary: libvirt provider for Vagrant License: MIT URL: https://github.com/vagrant-libvirt/vagrant-libvirt @@ -157,6 +157,9 @@ popd %{vagrant_plugin_instdir}/spec %changelog +* Sat Jan 17 2026 Fedora Release Engineering - 0.11.2-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + * Tue Dec 16 2025 Jarek Prokop - 0.11.2-9 - Fix Ruby 4.0 compatibility by replacing CGI with URI equivalent. From 139e99ed196aa16f8095bd6a70cb555e1eea093d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jul 2026 08:20:36 +0000 Subject: [PATCH 12/12] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild --- vagrant-libvirt.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant-libvirt.spec b/vagrant-libvirt.spec index 3b831e4..ad18051 100644 --- a/vagrant-libvirt.spec +++ b/vagrant-libvirt.spec @@ -4,7 +4,7 @@ Name: %{vagrant_plugin_name} Version: 0.11.2 -Release: 10%{?dist} +Release: 11%{?dist} Summary: libvirt provider for Vagrant License: MIT URL: https://github.com/vagrant-libvirt/vagrant-libvirt @@ -157,6 +157,9 @@ popd %{vagrant_plugin_instdir}/spec %changelog +* Fri Jul 17 2026 Fedora Release Engineering - 0.11.2-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + * Sat Jan 17 2026 Fedora Release Engineering - 0.11.2-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild