vagrant-libvirt 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c040a1d251767da60c78665550646f187542bbf7b9997cc79fad57912496026
4
- data.tar.gz: da241c3927605330f056e1b235910f35c9387b130fe645ba42418b388b34f08d
3
+ metadata.gz: 8ea176b68227366ddb6ac763a2e66c55cffaa58e9d4cc188f3f8b6c62bb3cd06
4
+ data.tar.gz: a8cfb80de7f57fbcd2e4bec2fdf7f7043a81f410da00606a5f88897374535baf
5
5
  SHA512:
6
- metadata.gz: '0478c2e07037e6ca618f17d4965bed901227d48cc7eed448afb099d079e807450263b7ded71cd7a26dfaa83676e25cea890623b7b678c2c5b798df10895366a8'
7
- data.tar.gz: bd18eb62fd9e0cd134511cdf642697272a16ae85fa882e9bcdfb9fea157878b2fa918e71fd0c9fa418a104e846211892450ad097965f588f4590495fdec00d3f
6
+ metadata.gz: 9b005c6323cee5bfe5facbe14d5b3f7acddd9076b428d126acd220080b5946107795eee6726893bdfc7e9e67b08534a8c475b9f1d6c8de79f79dcf8c125564e8
7
+ data.tar.gz: 257c7b4bf7c7390c0013101eb6541d43e2d60d871309053201376b5cfff5439610f5aacb05775b24b37ddc374b2d8dff4deab0a8163c4821a5f34c7c5d76ed35
@@ -81,7 +81,7 @@ module VagrantPlugins
81
81
  @driver_name = iface_configuration.fetch(:driver_name, false)
82
82
  @driver_iommu = iface_configuration.fetch(:driver_iommu, false )
83
83
  @driver_queues = iface_configuration.fetch(:driver_queues, false)
84
- @device_name = iface_configuration.fetch(:iface_name, false)
84
+ @device_name = iface_configuration.fetch(:iface_name, nil)
85
85
  @mtu = iface_configuration.fetch(:mtu, nil)
86
86
  @pci_bus = iface_configuration.fetch(:bus, nil)
87
87
  @pci_slot = iface_configuration.fetch(:slot, nil)
@@ -70,6 +70,7 @@ module VagrantPlugins
70
70
  attr_accessor :management_network_mtu
71
71
  attr_accessor :management_network_keep
72
72
  attr_accessor :management_network_driver_iommu
73
+ attr_accessor :management_network_iface_name
73
74
  attr_accessor :management_network_model_type
74
75
 
75
76
  # System connection information
@@ -258,6 +259,7 @@ module VagrantPlugins
258
259
  @management_network_mtu = UNSET_VALUE
259
260
  @management_network_keep = UNSET_VALUE
260
261
  @management_network_driver_iommu = UNSET_VALUE
262
+ @management_network_iface_name = UNSET_VALUE
261
263
  @management_network_model_type = UNSET_VALUE
262
264
 
263
265
  # System connection information
@@ -973,6 +975,7 @@ module VagrantPlugins
973
975
  @management_network_mtu = nil if @management_network_mtu == UNSET_VALUE
974
976
  @management_network_keep = false if @management_network_keep == UNSET_VALUE
975
977
  @management_network_driver_iommu = false if @management_network_driver_iommu == UNSET_VALUE
978
+ @management_network_iface_name = nil if @management_network_iface_name == UNSET_VALUE
976
979
  @management_network_model_type = 'virtio' if @management_network_model_type == UNSET_VALUE
977
980
 
978
981
  # Domain specific settings.
@@ -34,6 +34,7 @@ module VagrantPlugins
34
34
  management_network_mtu = machine.provider_config.management_network_mtu
35
35
  management_network_keep = machine.provider_config.management_network_keep
36
36
  management_network_driver_iommu = machine.provider_config.management_network_driver_iommu
37
+ management_network_iface_name = machine.provider_config.management_network_iface_name
37
38
  management_network_model_type = machine.provider_config.management_network_model_type
38
39
  logger.info "Using #{management_network_name} at #{management_network_address} as the management network #{management_network_mode} is the mode"
39
40
 
@@ -79,6 +80,7 @@ module VagrantPlugins
79
80
  end
80
81
 
81
82
  management_network_options[:driver_iommu] = management_network_driver_iommu
83
+ management_network_options[:iface_name] = management_network_iface_name
82
84
 
83
85
  unless management_network_mac.nil?
84
86
  management_network_options[:mac] = management_network_mac
@@ -1 +1 @@
1
- 0.12.0
1
+ 0.12.1
@@ -92,6 +92,56 @@ describe VagrantPlugins::ProviderLibvirt::Action::CreateNetworkInterfaces do
92
92
  expect(subject.call(env)).to be_nil
93
93
  end
94
94
 
95
+ context 'management network' do
96
+ let(:domain_xml) {
97
+ # don't need full domain here, just enough for the network element to work
98
+ <<-EOF.unindent
99
+ <domain type='qemu'>
100
+ <devices>
101
+ <interface type='network'>
102
+ <alias name='ua-net-0'/>
103
+ <mac address='52:54:00:7d:14:0e'/>
104
+ <source network='vagrant-libvirt'/>
105
+ <target dev="myvnet0"></target>
106
+ <model type='virtio'/>
107
+ <driver iommu='off'/>
108
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
109
+ </interface>
110
+ </devices>
111
+ </domain>
112
+ EOF
113
+ }
114
+
115
+ before do
116
+ allow(libvirt_domain).to receive(:xml_desc).and_return(domain_xml)
117
+ end
118
+
119
+ context 'when iface name is set' do
120
+ let(:vagrantfile_providerconfig) {
121
+ <<-EOF
122
+ libvirt.management_network_iface_name = 'myvnet0'
123
+ EOF
124
+ }
125
+ let(:management_nic_xml) {
126
+ <<-EOF.unindent
127
+ <interface type="network">
128
+ <alias name="ua-net-0"></alias>
129
+ <source network="vagrant-libvirt"></source>
130
+ <target dev="myvnet0"></target>
131
+ <model type="virtio"></model>
132
+ <driver iommu="off"></driver>
133
+ </interface>
134
+ EOF
135
+ }
136
+
137
+ it 'should set target appropriately' do
138
+ expect(driver).to receive(:attach_device).with(management_nic_xml)
139
+
140
+ expect(subject.call(env)).to be_nil
141
+ end
142
+ end
143
+ end
144
+
95
145
  context 'private network' do
96
146
  let(:vagrantfile) do
97
147
  <<-EOF
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-libvirt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas Stanek
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2023-04-22 00:00:00.000000000 Z
14
+ date: 2023-05-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: fog-libvirt