qemu-toolkit 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/qemu-toolkit/vm.rb +11 -2
- metadata +3 -4
data/lib/qemu-toolkit/vm.rb
CHANGED
@@ -214,7 +214,7 @@ module QemuToolkit
|
|
214
214
|
if model == 'virtio'
|
215
215
|
cmd << '-device virtio-net-pci,'+
|
216
216
|
parameter_list(
|
217
|
-
mac: macaddr,
|
217
|
+
mac: vnic.macaddr,
|
218
218
|
tx: 'timer', x_txtimer: 200000, x_txburst: 128,
|
219
219
|
vlan: vlan)
|
220
220
|
else
|
@@ -222,7 +222,7 @@ module QemuToolkit
|
|
222
222
|
parameter_list(
|
223
223
|
vlan: vlan, name: nic_name,
|
224
224
|
model: model,
|
225
|
-
macaddr: macaddr)
|
225
|
+
macaddr: vnic.macaddr)
|
226
226
|
end
|
227
227
|
|
228
228
|
vlan += 1
|
@@ -230,6 +230,8 @@ module QemuToolkit
|
|
230
230
|
|
231
231
|
# networking: net
|
232
232
|
nets.each do |type, parameters|
|
233
|
+
map(parameters, :macaddr) { |a| Network::MacAddress.new(a) }
|
234
|
+
|
233
235
|
cmd << "-net #{type},"+
|
234
236
|
parameter_list(parameters)
|
235
237
|
end
|
@@ -338,6 +340,13 @@ module QemuToolkit
|
|
338
340
|
socket.close
|
339
341
|
end
|
340
342
|
|
343
|
+
# Maps a key from a hash to a new value returned by the block.
|
344
|
+
#
|
345
|
+
def map hash, key, &block
|
346
|
+
return unless hash.has_key? key
|
347
|
+
hash[key] = block.call(hash[key])
|
348
|
+
end
|
349
|
+
|
341
350
|
def socket_chardev(name, path)
|
342
351
|
"-chardev socket,id=#{name},path=#{path},server,nowait"
|
343
352
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qemu-toolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: clamp
|
@@ -92,9 +92,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project:
|
95
|
-
rubygems_version: 1.8.
|
95
|
+
rubygems_version: 1.8.25
|
96
96
|
signing_key:
|
97
97
|
specification_version: 3
|
98
98
|
summary: Manages QEMU kvm virtual machines on Illumos hosts.
|
99
99
|
test_files: []
|
100
|
-
has_rdoc:
|