diff --git a/sources b/sources index 28d90dc..cfb8385 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (vagrant-libvirt-0.11.2.gem) = f66be1c8301ad4a9e731cf65c2ea3181f3c5e4c1d252411465060ab8ddabc294beab40e214fa8c9c5a7aa1e116030f60cea2e337121d95123c724ec6e529bfbc -SHA512 (vagrant-spec-259c55e204674f2b006700c6d351d04250d13b04.tar.gz) = 7938a6f8091b7dd76266e63d2cb653820e55a262091be0aaae2f5515321fa4d50301f547ab925771208b8616c7fc819cb642b3b9d444cd7a722ba712538cf68f +SHA512 (vagrant-libvirt-0.7.0.gem) = d501ce2b65c6df3cc0ac6a831374fb64c7227a930269999592b8ca10f91e2c866aacd9c952c138c442d99d645f39d381f1cbfe21f6c039ad9cd04eb08d494446 +SHA512 (vagrant-spec-03d88fe2467716b072951c2b55d78223130851a6.tar.gz) = 3b062cbec04f98355f939c2bf27d35ddcd2bbe0a0734677832d4a656320b44c64b6284e0877dd55e496055e2b969755e1bdc78225010f75ddaafe8f8c8f78a66 diff --git a/vagrant-libvirt-0.0.45-enable-qemu-session-by-default.patch b/vagrant-libvirt-0.0.45-enable-qemu-session-by-default.patch new file mode 100644 index 0000000..9d33caf --- /dev/null +++ b/vagrant-libvirt-0.0.45-enable-qemu-session-by-default.patch @@ -0,0 +1,63 @@ +From aeeda2b48749eec6ca6158b57928cfc1e94767ca Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Wed, 21 Oct 2020 04:18:08 +0200 +Subject: [PATCH] Enable QEMU Session by default + +sets default for `@qemu_use_session` to true. +--- + +diff --git a/lib/vagrant-libvirt/config.rb b/lib/vagrant-libvirt/config.rb +index 4861a4d..71bb909 100644 +--- a/lib/vagrant-libvirt/config.rb ++++ b/lib/vagrant-libvirt/config.rb +@@ -814,9 +814,9 @@ module VagrantPlugins + @socket = nil if @socket == UNSET_VALUE + + # If uri isn't set then let's build one from various sources. +- # Default to passing false for qemu_use_session if it's not set. ++ # Default to passing true for qemu_use_session if it's not set. + if @uri == UNSET_VALUE +- @uri = _generate_uri(@qemu_use_session == UNSET_VALUE ? false : @qemu_use_session) ++ @uri = _generate_uri(@qemu_use_session == UNSET_VALUE ? true : @qemu_use_session) + end + + finalize_from_uri + +From b68bf05606da6449966a53a2ea6abe261a03a731 Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Mon, 13 Dec 2021 12:06:21 +0100 +Subject: [PATCH] Fix tests. + +--- + spec/unit/action/create_domain_spec.rb | 2 +- + spec/unit/config_spec.rb | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/spec/unit/action/create_domain_spec.rb b/spec/unit/action/create_domain_spec.rb +index 342debf..cb51cf5 100644 +--- a/spec/unit/action/create_domain_spec.rb ++++ b/spec/unit/action/create_domain_spec.rb +@@ -34,7 +34,7 @@ describe VagrantPlugins::ProviderLibvirt::Action::CreateDomain do + allow(connection).to receive(:volumes).and_return(volumes) + allow(volumes).to receive(:all).and_return([domain_volume]) + allow(domain_volume).to receive(:pool_name).and_return('default') +- allow(domain_volume).to receive(:[]).with('name').and_return('vagrant-test_default.img') ++ #allow(domain_volume).to receive(:[]).with('name').and_return('vagrant-test_default.img') + allow(domain_volume).to receive(:path).and_return('/var/lib/libvirt/images/vagrant-test_default.img') + allow(machine).to receive_message_chain("box.name") { 'vagrant-libvirt/test' } + +diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb +index 6f82da1..bd74999 100644 +--- a/spec/unit/config_spec.rb ++++ b/spec/unit/config_spec.rb +@@ -74,7 +74,7 @@ describe VagrantPlugins::ProviderLibvirt::Config do + # settings + [ # all default + {}, +- {:uri => "qemu:///system"}, ++ {:uri => "qemu:///session"}, + ], + + # explicit uri settings +-- +2.33.1 diff --git a/vagrant-libvirt-0.11.2-Allow-a-mock-object-to-receive-synced_folders.patch b/vagrant-libvirt-0.11.2-Allow-a-mock-object-to-receive-synced_folders.patch deleted file mode 100644 index 41976a2..0000000 --- a/vagrant-libvirt-0.11.2-Allow-a-mock-object-to-receive-synced_folders.patch +++ /dev/null @@ -1,28 +0,0 @@ -From f87d4330953effdea41355d2daedb6b9659f39d3 Mon Sep 17 00:00:00 2001 -From: Jarek Prokop -Date: Fri, 10 Feb 2023 16:24:07 +0100 -Subject: [PATCH] Allow a mock object to receive synced_folders when using qemu - session. - -When using qemu session, there is another code path -regarding 9p and virtiofs that wasn't considered. ---- - spec/unit/config_spec.rb | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb -index d205214..e606b89 100644 ---- a/spec/unit/config_spec.rb -+++ b/spec/unit/config_spec.rb -@@ -770,6 +770,8 @@ describe VagrantPlugins::ProviderLibvirt::Config do - let (:vm) { double('vm') } - before do - machine.config.instance_variable_get("@keys")[:vm] = vm -+ -+ allow(vm).to receive(:synced_folders).and_return({}) - end - - it 'is valid with valid mac' do --- -2.39.1 - diff --git a/vagrant-libvirt-0.11.2-enable-qemu-session-by-default.patch b/vagrant-libvirt-0.11.2-enable-qemu-session-by-default.patch deleted file mode 100644 index 19bd4fc..0000000 --- a/vagrant-libvirt-0.11.2-enable-qemu-session-by-default.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 799acbebe6a506c85c93f384610e646d801bea1a Mon Sep 17 00:00:00 2001 -From: Jarek Prokop -Date: Fri, 10 Feb 2023 17:43:18 +0100 -Subject: [PATCH 1/2] Enable QEMU Session by default - -Default `@qemu_use_session` to true. ---- - lib/vagrant-libvirt/config.rb | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/vagrant-libvirt/config.rb b/lib/vagrant-libvirt/config.rb -index d4763be..0bbdef0 100644 ---- a/lib/vagrant-libvirt/config.rb -+++ b/lib/vagrant-libvirt/config.rb -@@ -931,9 +931,9 @@ module VagrantPlugins - @socket = nil if @socket == UNSET_VALUE - - # If uri isn't set then let's build one from various sources. -- # Default to passing false for qemu_use_session if it's not set. -+ # Default to passing true for qemu_use_session if it's not set. - if @uri == UNSET_VALUE -- @uri = _generate_uri(@qemu_use_session == UNSET_VALUE ? false : @qemu_use_session) -+ @uri = _generate_uri(@qemu_use_session == UNSET_VALUE ? true : @qemu_use_session) - end - - finalize_from_uri - -From b695838c24e5669c58ef5984dc26f31277c7dd10 Mon Sep 17 00:00:00 2001 -From: Jarek Prokop -Date: Fri, 10 Feb 2023 17:43:55 +0100 -Subject: [PATCH 2/2] Use qemu:///session instead of qemu:///system in test - suite. - ---- - spec/unit/config_spec.rb | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb -index d205214..fce7521 100644 ---- a/spec/unit/config_spec.rb -+++ b/spec/unit/config_spec.rb -@@ -72,7 +72,7 @@ describe VagrantPlugins::ProviderLibvirt::Config do - # settings - [ # all default - {}, -- {:uri => "qemu:///system"}, -+ {:uri => "qemu:///session"}, - ], - - # explicit uri settings --- -2.39.1 - 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 deleted file mode 100644 index feed62b..0000000 --- a/vagrant-libvirt-0.12.2-Fix-REXML-3-4-2-compatibility.patch +++ /dev/null @@ -1,116 +0,0 @@ -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-0.12.2-Remove-config-unsupported-by-fog-libvirt.patch b/vagrant-libvirt-0.12.2-Remove-config-unsupported-by-fog-libvirt.patch deleted file mode 100644 index 2d40e76..0000000 --- a/vagrant-libvirt-0.12.2-Remove-config-unsupported-by-fog-libvirt.patch +++ /dev/null @@ -1,31 +0,0 @@ -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-0.12.2-Replace-CGI.parse-with-URI-equivalent.patch b/vagrant-libvirt-0.12.2-Replace-CGI.parse-with-URI-equivalent.patch deleted file mode 100644 index 1e041d2..0000000 --- a/vagrant-libvirt-0.12.2-Replace-CGI.parse-with-URI-equivalent.patch +++ /dev/null @@ -1,41 +0,0 @@ -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-0.7.0-Allow-the-connection.client.libversion-call.patch b/vagrant-libvirt-0.7.0-Allow-the-connection.client.libversion-call.patch new file mode 100644 index 0000000..3370ac4 --- /dev/null +++ b/vagrant-libvirt-0.7.0-Allow-the-connection.client.libversion-call.patch @@ -0,0 +1,31 @@ +From a3d8ecf5cf987e456d0a8398788f4c2b145ea7f4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= +Date: Fri, 3 Dec 2021 08:54:27 +0100 +Subject: [PATCH] Allow the connection.client.libversion call + +When the tests are executed and rsync is not installed on the machine executing +the tests, then vagrant-libvirt will automatically fallback to virtiofs or +9p. Both of these perform the following call to check the libvirt version: + +libvirt_version = machine.provider.driver.connection.client.libversion + +However, this mock was not setup and thus those tests would fail. + +This fixes https://github.com/vagrant-libvirt/vagrant-libvirt/issues/1415 +--- + spec/unit/action_spec.rb | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/spec/unit/action_spec.rb b/spec/unit/action_spec.rb +index 18e31fdf..0eac0636 100644 +--- a/spec/unit/action_spec.rb ++++ b/spec/unit/action_spec.rb +@@ -27,6 +27,8 @@ + allow(logger).to receive(:info) + allow(logger).to receive(:debug) + allow(logger).to receive(:error) ++ ++ allow(connection.client).to receive(:libversion).and_return(6_002_000) + end + + def allow_action_env_result(action, *responses) diff --git a/vagrant-libvirt-0.7.0-Fix-HandleBox-not-defined-error-on-parallel-operation.patch b/vagrant-libvirt-0.7.0-Fix-HandleBox-not-defined-error-on-parallel-operation.patch new file mode 100644 index 0000000..5cd7c43 --- /dev/null +++ b/vagrant-libvirt-0.7.0-Fix-HandleBox-not-defined-error-on-parallel-operation.patch @@ -0,0 +1,68 @@ +From 709745261a4401f3418378e08be615ff6d24c865 Mon Sep 17 00:00:00 2001 +From: Jarek Prokop +Date: Mon, 22 May 2023 17:40:13 +0200 +Subject: [PATCH] Use require for HandleBox, SyncedFolders, WaitForCommunicator + +Using `autoload` fairly consistently results in 'constant not defined' +errors for each of HandleBox, SyncedFolders, WaitForCommunicator +when using ruby 3.1. Presumably there's some sort of race condition. +Explicitly using `require` for these three makes the problem go away. +It might be a bit ugly to have those `require` lines right at the +point where those symbols are used, vs. the neat `autoload` section +at the top of the file, but I'm not sure how better to structure this. +Suggestions most welcome :-) + +=== + +This patch is originally from PR + + +Fedora user named Shawn K. O'Shea adapted the patch for version 0.7.0. +https://bugzilla.redhat.com/show_bug.cgi?id=2100543#c4 +--- + lib/vagrant-libvirt/action.rb | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/lib/vagrant-libvirt/action.rb b/lib/vagrant-libvirt/action.rb +index 17b3a60..1b79d92 100644 +--- a/lib/vagrant-libvirt/action.rb ++++ b/lib/vagrant-libvirt/action.rb +@@ -35,6 +35,7 @@ module VagrantPlugins + b2.use StartDomain + else + b2.use HandleStoragePool ++ require 'vagrant/action/builtin/handle_box' + b2.use HandleBox + b2.use HandleBoxImage + b2.use CreateDomainVolume +@@ -103,6 +104,7 @@ module VagrantPlugins + + b3.use PrepareNFSValidIds + b3.use SyncedFolderCleanup ++ require 'vagrant/action/builtin/synced_folders' + b3.use SyncedFolders + + # Start it.. +@@ -111,6 +113,7 @@ module VagrantPlugins + # Machine should gain IP address when comming up, + # so wait for dhcp lease and store IP into machines data_dir. + b3.use WaitTillUp ++ require 'vagrant/action/builtin/wait_for_communicator' + b3.use WaitForCommunicator, [:running] + + b3.use ForwardPorts +@@ -392,11 +395,8 @@ module VagrantPlugins + autoload :PackageSetupFiles, 'vagrant/action/general/package_setup_files' + autoload :PackageSetupFolders, 'vagrant/action/general/package_setup_folders' + autoload :SSHRun, 'vagrant/action/builtin/ssh_run' +- autoload :HandleBox, 'vagrant/action/builtin/handle_box' +- autoload :SyncedFolders, 'vagrant/action/builtin/synced_folders' + autoload :SyncedFolderCleanup, 'vagrant/action/builtin/synced_folder_cleanup' + autoload :ProvisionerCleanup, 'vagrant/action/builtin/provisioner_cleanup' +- autoload :WaitForCommunicator, 'vagrant/action/builtin/wait_for_communicator' + end + end + end +-- +2.41.0.rc1 + diff --git a/vagrant-libvirt-0.7.0-Reduce-patching-for-distro-default-session-use.patch b/vagrant-libvirt-0.7.0-Reduce-patching-for-distro-default-session-use.patch new file mode 100644 index 0000000..955c7a0 --- /dev/null +++ b/vagrant-libvirt-0.7.0-Reduce-patching-for-distro-default-session-use.patch @@ -0,0 +1,278 @@ +From 3a465ab12ae806788b0d94dff1eee8c67677ad1c Mon Sep 17 00:00:00 2001 +From: Darragh Bailey +Date: Sat, 11 Dec 2021 12:51:25 +0000 +Subject: [PATCH 1/2] Reduce patching for distro default session use + +Reduce the patching needed should a distro wish to switch the default +from using the system connection by default to using a session +connection by default. + +Should now only require patching the default value and a single test +checking the defaults. +--- + spec/unit/action/create_domain_spec.rb | 15 +++--- + spec/unit/action/create_domain_volume_spec.rb | 8 ++-- + spec/unit/action/wait_till_up_spec.rb | 2 + + spec/unit/config_spec.rb | 48 ++++++++++--------- + 4 files changed, 41 insertions(+), 32 deletions(-) + +diff --git a/spec/unit/action/create_domain_spec.rb b/spec/unit/action/create_domain_spec.rb +index 27a5b8b9..c1439665 100644 +--- a/spec/unit/action/create_domain_spec.rb ++++ b/spec/unit/action/create_domain_spec.rb +@@ -4,6 +4,8 @@ + require 'support/sharedcontext' + require 'support/libvirt_context' + ++require 'fog/libvirt/models/compute/volume' ++ + require 'vagrant-libvirt/errors' + require 'vagrant-libvirt/util/byte_number' + require 'vagrant-libvirt/action/create_domain' +@@ -14,10 +16,9 @@ + include_context 'unit' + include_context 'libvirt' + +- let(:libvirt_client) { double('libvirt_client') } + let(:servers) { double('servers') } + let(:volumes) { double('volumes') } +- let(:domain_volume) { double('domain_volume') } ++ let(:domain_volume) { instance_double(::Fog::Libvirt::Compute::Volume) } + + let(:domain_xml) { File.read(File.join(File.dirname(__FILE__), File.basename(__FILE__, '.rb'), domain_xml_file)) } + let(:storage_pool_xml) { File.read(File.join(File.dirname(__FILE__), File.basename(__FILE__, '.rb'), storage_pool_xml_file)) } +@@ -57,6 +58,10 @@ + context 'connection => qemu:///system' do + let(:domain_xml_file) { 'default_domain.xml' } + ++ before do ++ allow(machine.provider_config).to receive(:qemu_use_session).and_return(false) ++ end ++ + context 'default pool' do + it 'should execute correctly' do + expect(servers).to receive(:create).with(xml: domain_xml).and_return(machine) +@@ -137,10 +142,8 @@ + end + + context 'connection => qemu:///session' do +- let(:vagrantfile_providerconfig) do +- <<-EOF +- libvirt.qemu_use_session = true +- EOF ++ before do ++ allow(machine.provider_config).to receive(:qemu_use_session).and_return(true) + end + + context 'default pool' do +diff --git a/spec/unit/action/create_domain_volume_spec.rb b/spec/unit/action/create_domain_volume_spec.rb +index 03a07108..54766872 100644 +--- a/spec/unit/action/create_domain_volume_spec.rb ++++ b/spec/unit/action/create_domain_volume_spec.rb +@@ -4,6 +4,8 @@ + require 'support/sharedcontext' + require 'support/libvirt_context' + ++require 'fog/libvirt/models/compute/volume' ++ + require 'vagrant-libvirt/action/destroy_domain' + require 'vagrant-libvirt/util/byte_number' + +@@ -14,11 +16,9 @@ + include_context 'unit' + include_context 'libvirt' + +- let(:libvirt_domain) { double('libvirt_domain') } +- let(:libvirt_client) { double('libvirt_client') } + let(:volumes) { double('volumes') } + let(:all) { double('all') } +- let(:box_volume) { double('box_volume') } ++ let(:box_volume) { instance_double(::Fog::Libvirt::Compute::Volume) } + + def read_test_file(name) + File.read(File.join(File.dirname(__FILE__), File.basename(__FILE__, '.rb'), name)) +@@ -35,6 +35,8 @@ def read_test_file(name) + allow(box_volume).to receive(:id).and_return(nil) + env[:domain_name] = 'test' + ++ allow(machine.provider_config).to receive(:qemu_use_session).and_return(false) ++ + allow(logger).to receive(:debug) + end + +diff --git a/spec/unit/action/wait_till_up_spec.rb b/spec/unit/action/wait_till_up_spec.rb +index 7e697379..61783142 100644 +--- a/spec/unit/action/wait_till_up_spec.rb ++++ b/spec/unit/action/wait_till_up_spec.rb +@@ -24,6 +24,8 @@ + allow(driver).to receive(:state).and_return(:running) + # return some information for domain when needed + allow(domain).to receive(:mac).and_return('9C:D5:53:F1:5A:E7') ++ ++ allow(machine.provider_config).to receive(:qemu_use_session).and_return(false) + end + + context 'when machine does not exist' do +diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb +index bc5bd1bd..36ab7c09 100644 +--- a/spec/unit/config_spec.rb ++++ b/spec/unit/config_spec.rb +@@ -171,55 +171,55 @@ + # ignore LIBVIRT_DEFAULT_URI due to explicit settings + [ # when uri explicitly set + {:uri => 'qemu:///system'}, +- {:uri => 'qemu:///system'}, ++ {:uri => %r{qemu:///(system|session)}}, + { +- :env => {'LIBVIRT_DEFAULT_URI' => 'qemu://session'}, ++ :env => {'LIBVIRT_DEFAULT_URI' => 'qemu:///custom'}, + } + ], + [ # when host explicitly set + {:host => 'remote'}, +- {:uri => 'qemu://remote/system'}, ++ {:uri => %r{qemu://remote/(system|session)}}, + { +- :env => {'LIBVIRT_DEFAULT_URI' => 'qemu://session'}, ++ :env => {'LIBVIRT_DEFAULT_URI' => 'qemu:///custom'}, + } + ], + [ # when connect_via_ssh explicitly set + {:connect_via_ssh => true}, +- {:uri => 'qemu+ssh://localhost/system?no_verify=1'}, ++ {:uri => %r{qemu\+ssh://localhost/(system|session)\?no_verify=1}}, + { +- :env => {'LIBVIRT_DEFAULT_URI' => 'qemu://session'}, ++ :env => {'LIBVIRT_DEFAULT_URI' => 'qemu:///custom'}, + } + ], + [ # when username explicitly set without ssh + {:username => 'my_user' }, +- {:uri => 'qemu:///system', :username => 'my_user'}, ++ {:uri => %r{qemu:///(system|session)}, :username => 'my_user'}, + { +- :env => {'LIBVIRT_DEFAULT_URI' => 'qemu://session'}, ++ :env => {'LIBVIRT_DEFAULT_URI' => 'qemu:///custom'}, + } + ], + [ # when username explicitly set with host but without ssh + {:username => 'my_user', :host => 'remote'}, +- {:uri => 'qemu://remote/system', :username => 'my_user'}, ++ {:uri => %r{qemu://remote/(system|session)}, :username => 'my_user'}, + { +- :env => {'LIBVIRT_DEFAULT_URI' => 'qemu://session'}, ++ :env => {'LIBVIRT_DEFAULT_URI' => 'qemu:///custom'}, + } + ], + [ # when password explicitly set + {:password => 'some_password'}, +- {:uri => 'qemu:///system', :password => 'some_password'}, ++ {:uri => %r{qemu:///(system|session)}, :password => 'some_password'}, + { +- :env => {'LIBVIRT_DEFAULT_URI' => 'qemu://session'}, ++ :env => {'LIBVIRT_DEFAULT_URI' => 'qemu:///custom'}, + } + ], + + # driver settings + [ # set to kvm only + {:driver => 'kvm'}, +- {:uri => "qemu:///system"}, ++ {:uri => %r{qemu:///(system|session)}}, + ], + [ # set to qemu only + {:driver => 'qemu'}, +- {:uri => "qemu:///system"}, ++ {:uri => %r{qemu:///(system|session)}}, + ], + [ # set to qemu with session enabled + {:driver => 'qemu', :qemu_use_session => true}, +@@ -241,29 +241,29 @@ + # connect_via_ssh settings + [ # enabled + {:connect_via_ssh => true}, +- {:uri => "qemu+ssh://localhost/system?no_verify=1"}, ++ {:uri => %r{qemu\+ssh://localhost/(system|session)\?no_verify=1}}, + ], + [ # enabled with user + {:connect_via_ssh => true, :username => 'my_user'}, +- {:uri => "qemu+ssh://my_user@localhost/system?no_verify=1"}, ++ {:uri => %r{qemu\+ssh://my_user@localhost/(system|session)\?no_verify=1}}, + ], + [ # enabled with host + {:connect_via_ssh => true, :host => 'remote_server'}, +- {:uri => "qemu+ssh://remote_server/system?no_verify=1"}, ++ {:uri => %r{qemu\+ssh://remote_server/(system|session)\?no_verify=1}}, + ], + + # id_ssh_key_file behaviour + [ # set should take given value + {:connect_via_ssh => true, :id_ssh_key_file => '/path/to/keyfile'}, +- {:uri => 'qemu+ssh://localhost/system?no_verify=1&keyfile=/path/to/keyfile', :connect_via_ssh => true}, ++ {:uri => %r{qemu\+ssh://localhost/(system|session)\?no_verify=1&keyfile=/path/to/keyfile}, :connect_via_ssh => true}, + ], + [ # set should infer use of ssh + {:id_ssh_key_file => '/path/to/keyfile'}, +- {:uri => 'qemu+ssh://localhost/system?no_verify=1&keyfile=/path/to/keyfile', :connect_via_ssh => true}, ++ {:uri => %r{qemu\+ssh://localhost/(system|session)\?no_verify=1&keyfile=/path/to/keyfile}, :connect_via_ssh => true}, + ], + [ # connect_via_ssh should enable default but ignore due to not existing + {:connect_via_ssh => true}, +- {:uri => 'qemu+ssh://localhost/system?no_verify=1', :id_ssh_key_file => nil}, ++ {:uri => %r{qemu\+ssh://localhost/(system|session)\?no_verify=1}, :id_ssh_key_file => nil}, + { + :setup => ProcWithBinding.new { + expect(File).to receive(:file?).with("/home/tests/.ssh/id_rsa").and_return(false) +@@ -272,7 +272,7 @@ + ], + [ # connect_via_ssh should enable default and include due to existing + {:connect_via_ssh => true}, +- {:uri => 'qemu+ssh://localhost/system?no_verify=1&keyfile=/home/tests/.ssh/id_rsa', :id_ssh_key_file => '/home/tests/.ssh/id_rsa'}, ++ {:uri => %r{qemu\+ssh://localhost/(system|session)\?no_verify=1&keyfile=/home/tests/\.ssh/id_rsa}, :id_ssh_key_file => '/home/tests/.ssh/id_rsa'}, + { + :setup => ProcWithBinding.new { + expect(File).to receive(:file?).with("/home/tests/.ssh/id_rsa").and_return(true) +@@ -283,7 +283,7 @@ + # socket behaviour + [ # set + {:socket => '/var/run/libvirt/libvirt-sock'}, +- {:uri => "qemu:///system?socket=/var/run/libvirt/libvirt-sock"}, ++ {:uri => %r{qemu:///(system|session)\?socket=/var/run/libvirt/libvirt-sock}}, + ], + ].each do |inputs, outputs, options| + opts = {} +@@ -317,7 +317,9 @@ + hash["#{name.to_s[1..-1]}".to_sym] =subject.instance_variable_get(name) + end + end +- expect(got).to eq(outputs) ++ ++ outputs.transform_values! { |v| v.is_a?(Regexp) ? a_string_matching(v) : v } ++ expect(got).to match(outputs) + end + end + + +From d3bcbe0837e9fd9a77ced1bc51009df4b84ca62e Mon Sep 17 00:00:00 2001 +From: Darragh Bailey +Date: Sat, 11 Dec 2021 14:42:00 +0000 +Subject: [PATCH 2/2] remain compatible with older vagrant/rubies + +--- + spec/unit/config_spec.rb | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb +index 36ab7c09..4be26a4b 100644 +--- a/spec/unit/config_spec.rb ++++ b/spec/unit/config_spec.rb +@@ -318,8 +318,7 @@ + end + end + +- outputs.transform_values! { |v| v.is_a?(Regexp) ? a_string_matching(v) : v } +- expect(got).to match(outputs) ++ expect(got).to match(outputs.inject({}) { |h, (k, v)| h[k] = v.is_a?(Regexp) ? a_string_matching(v) : v; h }) + end + end + diff --git a/vagrant-libvirt-pr1709-ruby32-File_exists-URL-parse.patch b/vagrant-libvirt-pr1709-ruby32-File_exists-URL-parse.patch index cbaad23..79e2c38 100644 --- a/vagrant-libvirt-pr1709-ruby32-File_exists-URL-parse.patch +++ b/vagrant-libvirt-pr1709-ruby32-File_exists-URL-parse.patch @@ -76,7 +76,7 @@ diff --git a/lib/vagrant-libvirt/config.rb b/lib/vagrant-libvirt/config.rb index 471d40dce..dfaef6167 100644 --- a/lib/vagrant-libvirt/config.rb +++ b/lib/vagrant-libvirt/config.rb -@@ -1320,8 +1320,8 @@ def finalize_from_uri +@@ -1304,8 +1304,8 @@ def finalize_from_uri end end diff --git a/vagrant-libvirt-pr1837-testsuite-support-rexml-332.patch b/vagrant-libvirt-pr1837-testsuite-support-rexml-332.patch deleted file mode 100644 index dbffb41..0000000 --- a/vagrant-libvirt-pr1837-testsuite-support-rexml-332.patch +++ /dev/null @@ -1,81 +0,0 @@ -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 -@@ -364,7 +364,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) -@@ -385,7 +385,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) -@@ -399,7 +399,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) -@@ -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') -- 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) -@@ -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') -- 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) -@@ -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') -- 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 ad18051..c296ee0 100644 --- a/vagrant-libvirt.spec +++ b/vagrant-libvirt.spec @@ -1,10 +1,10 @@ %global vagrant_plugin_name vagrant-libvirt -%global vagrant_spec_commit 259c55e204674f2b006700c6d351d04250d13b04 +%global vagrant_spec_commit 03d88fe2467716b072951c2b55d78223130851a6 Name: %{vagrant_plugin_name} -Version: 0.11.2 -Release: 11%{?dist} +Version: 0.7.0 +Release: 5%{?dist} Summary: libvirt provider for Vagrant License: MIT URL: https://github.com/vagrant-libvirt/vagrant-libvirt @@ -12,56 +12,48 @@ Source0: https://rubygems.org/gems/%{vagrant_plugin_name}-%{version}.gem # The library has no official release yet. But since it is just test # dependency, it should be fine to include the source right here. # wget https://github.com/mitchellh/vagrant-spec/archive/03d88fe2467716b072951c2b55d78223130851a6/vagrant-spec-03d88fe2467716b072951c2b55d78223130851a6.tar.gz -Source1: https://github.com/mitchellh/vagrant-spec/archive/%{vagrant_spec_commit}/vagrant-spec-%{vagrant_spec_commit}.tar.gz +Source2: https://github.com/mitchellh/vagrant-spec/archive/%{vagrant_spec_commit}/vagrant-spec-%{vagrant_spec_commit}.tar.gz +# Allow the connection.client.libversion call +# https://github.com/vagrant-libvirt/vagrant-libvirt/pull/1416 +Patch0: vagrant-libvirt-0.7.0-Allow-the-connection.client.libversion-call.patch +# Reduce patching for distro default session use +# https://github.com/vagrant-libvirt/vagrant-libvirt/pull/1424 +Patch1: vagrant-libvirt-0.7.0-Reduce-patching-for-distro-default-session-use.patch # https://github.com/vagrant-libvirt/vagrant-libvirt/pull/1709 # ruby3.2 fix wrt File.exits? removal and URI.split host result change # A bit modified: spec/support/libvirt_acceptance_context.rb does not exist # with 0.7.0 yet -Patch0: vagrant-libvirt-pr1709-ruby32-File_exists-URL-parse.patch -# Allow a mock object to receive synced_folders in config validation spec. -# 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 -# 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 -# 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 +Patch2: vagrant-libvirt-pr1709-ruby32-File_exists-URL-parse.patch +# Vagrant-libvirt uses autoload feature. This is not necessarily thread safe +# https://github.com/vagrant-libvirt/vagrant-libvirt/issues/1445#issuecomment-1044276044 +# This patch is taken from reported bug's attachment "Proposed patch": +# https://bugzilla.redhat.com/show_bug.cgi?id=2100543 +# Which is functionally this commit adapted for 0.7.0: +# https://github.com/vagrant-libvirt/vagrant-libvirt/commit/3bdb1c93e63886a95d472091ff8381f53338f632 +Patch3: vagrant-libvirt-0.7.0-Fix-HandleBox-not-defined-error-on-parallel-operation.patch # Enable QEMU Session by default # https://github.com/vagrant-libvirt/vagrant-libvirt/pull/969 -Patch100: vagrant-libvirt-0.11.2-enable-qemu-session-by-default.patch +Patch100: vagrant-libvirt-0.0.45-enable-qemu-session-by-default.patch Requires: ruby(release) Requires: ruby(rubygems) -Requires: rubygem(diffy) -Requires: rubygem(fog-libvirt) >= 0.6.0 +Requires: rubygem(fog-libvirt) >= 0.3.0 Requires: rubygem(nokogiri) >= 1.6 Requires: rubygem(rexml) -Requires: rubygem(xml-simple) # Vagrant changed packaging scriptlets in version 1.9.1. Requires: vagrant >= 1.9.1 # Required by "vagrant package" command (rhbz#1292217). Recommends: %{_bindir}/virt-sysprep BuildRequires: vagrant >= 1.9.1 BuildRequires: rubygem(bundler) -BuildRequires: rubygem(diffy) -BuildRequires: rubygem(fog-libvirt) -BuildRequires: rubygem(rake) BuildRequires: rubygem(rdoc) -BuildRequires: rubygem(rexml) BuildRequires: rubygem(rspec) +BuildRequires: rubygem(fog-libvirt) BuildRequires: rubygem(thor) -BuildRequires: rubygem(xml-simple) +BuildRequires: rubygem(rexml) +BuildRequires: rubygem(rake) BuildRequires: rubygems-devel BuildRequires: %{_bindir}/ps BuildArch: noarch @@ -80,15 +72,13 @@ BuildArch: noarch Documentation for %{name}. %prep -%setup -q -n %{vagrant_plugin_name}-%{version} -b 1 +%setup -q -n %{vagrant_plugin_name}-%{version} -b 2 -%patch 0 -p1 -%patch 1 -p1 -%patch 2 -p1 -%patch 3 -p1 -%patch 4 -p1 -%patch 5 -p1 -%patch 100 -p1 +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch100 -p1 %build gem build ../%{vagrant_plugin_name}-%{version}.gemspec @@ -103,7 +93,7 @@ cp -a .%{vagrant_plugin_dir}/* \ # Edit gemspec of vagrant-spec pushd ../vagrant-spec-%{vagrant_spec_commit} # Remove the git reference, which is useless in our case. -sed -i '/git / s/^/#/' vagrant-spec.gemspec +sed -i '/git/ s/^/#/' vagrant-spec.gemspec # Relax the dependencies, since Fedora ships with newer versions. sed -i '/thor/ s/~>/>=/' vagrant-spec.gemspec @@ -117,27 +107,27 @@ pushd .%{vagrant_plugin_instdir} # Create dummy Gemfile and load dependencies via gemspec file cat > Gemfile < '%{_builddir}/vagrant-spec-%{vagrant_spec_commit}' gemspec EOG +# We don't care about code coverage. +sed -i '/require .simplecov./ s/^/#/' spec/spec_helper.rb +sed -i '/SimpleCov/,/^end/ s/^/#/' spec/spec_helper.rb +sed -i '/simplecov/ s/^/#/' %{vagrant_plugin_name}.gemspec -# Unless rsync binary is present, vagrant-libvirt -# decides to use other methods of folder sync in tests, -# breaking set expectations for the test environment. -# https://github.com/vagrant-libvirt/vagrant-libvirt/issues/1415#issuecomment-985272836 -# Luckily, it just needs `rsync` in $PATH for tests to pass. -tmpdir=$(mktemp -d) -touch "${tmpdir}/rsync" -chmod +x "${tmpdir}/rsync" +# Relax developement rspec dependency +sed -i '/rspec/ s/~>/>=/' %{vagrant_plugin_name}.gemspec + +# Disable test that needs libvirt socket: +# > Failed to connect socket to '/var/run/libvirt/libvirt-sock-ro': +# https://github.com/vagrant-libvirt/vagrant-libvirt/issues/1255 +#sed -i "/^\s*it 'should abort after hitting limit' do$/,/^\s*end$/ s/^/#/g" \ +# ./spec/unit/action/wait_till_up_spec.rb # Suppress deprecation warnings GEM_PATH=%{vagrant_plugin_dir}:`ruby -e "print Gem.path.join(':')"` \ -PATH="$PATH:${tmpdir}" \ bundle exec rspec spec popd @@ -157,42 +147,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 - -* 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+ - -* 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 - -* 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 - -* 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 - -* Sat Jul 22 2023 Fedora Release Engineering - 0.11.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Sun Jan 29 2023 Bart Kus - 0.11.2-1 -- Update to vagrant-libvirt 0.11.2. +* Mon May 22 2023 Jarek Prokop - 0.7.0-5 +- Fix parallel vagrant up with libvirt provider. + Resolves: rhbz#2100543 * Fri Jan 20 2023 Mamoru TASAKA - 0.7.0-5 - Backport upstream fix for ruby3.2 compatibility