From bf304e3ff9099e897b6e421cfb2cb058c357d9a7 Mon Sep 17 00:00:00 2001 From: Jarek Prokop Date: Fri, 10 Feb 2023 17:56:19 +0100 Subject: [PATCH] Update enable-qemu-session-by-default patch for vagrant-libvirt 0.11.2 --- ....0.45-enable-qemu-session-by-default.patch | 63 ------------------- ....11.2-enable-qemu-session-by-default.patch | 53 ++++++++++++++++ vagrant-libvirt.spec | 2 +- 3 files changed, 54 insertions(+), 64 deletions(-) delete mode 100644 vagrant-libvirt-0.0.45-enable-qemu-session-by-default.patch create mode 100644 vagrant-libvirt-0.11.2-enable-qemu-session-by-default.patch 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 deleted file mode 100644 index 64ef8bd..0000000 --- a/vagrant-libvirt-0.0.45-enable-qemu-session-by-default.patch +++ /dev/null @@ -1,63 +0,0 @@ -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-enable-qemu-session-by-default.patch b/vagrant-libvirt-0.11.2-enable-qemu-session-by-default.patch new file mode 100644 index 0000000..19bd4fc --- /dev/null +++ b/vagrant-libvirt-0.11.2-enable-qemu-session-by-default.patch @@ -0,0 +1,53 @@ +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.spec b/vagrant-libvirt.spec index bce5657..d82a064 100644 --- a/vagrant-libvirt.spec +++ b/vagrant-libvirt.spec @@ -26,7 +26,7 @@ Patch1: vagrant-libvirt-0.11.2-Allow-a-mock-object-to-receive-synced_folders.pat # Enable QEMU Session by default # https://github.com/vagrant-libvirt/vagrant-libvirt/pull/969 -Patch100: vagrant-libvirt-0.0.45-enable-qemu-session-by-default.patch +Patch100: vagrant-libvirt-0.11.2-enable-qemu-session-by-default.patch Requires: ruby(release) Requires: ruby(rubygems)