vagrant-qemu 0.3.9 → 0.3.11
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +7 -0
- data/lib/vagrant-qemu/action/start_instance.rb +1 -0
- data/lib/vagrant-qemu/config.rb +3 -0
- data/lib/vagrant-qemu/driver.rb +9 -1
- data/lib/vagrant-qemu/version.rb +1 -1
- metadata +2 -3
- data/x +0 -76
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65b2cb386bb53bca93a879047e5b6a61ac690fd63a55e785b719b2b5379fb678
|
4
|
+
data.tar.gz: b3b4b879c90d4b7df411019f6fe8c80ea572f4751887444fc8e9e041e634ea38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e825fc1bee4029c89a1a0acc9af2b4a2ee1f646976ac64234ef19b57078a43dd32a7330aee2c1da7b63582a3f1358fbe17e0e632e1a5337d9387be5d810ab551
|
7
|
+
data.tar.gz: c989f426b5232f93ca87a5f4564e36c32f42b906ff8dbe3e11f671312535993b85ac888f3a1d823f7cbb4e2c1308c733e66d33e08032a0fe2c16819bd218e5fd
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -90,6 +90,7 @@ This provider exposes a few provider-specific configuration options:
|
|
90
90
|
* `net_device` - The network device, default: `virtio-net-device`
|
91
91
|
* `drive_interface` - The interface type for the main drive, default `virtio`
|
92
92
|
* `image_path` - The path (or array of paths) to qcow2 image for box-less VM, default is nil value
|
93
|
+
* `qemu_bin` - Path to an alternative QEMU binary, default: autodetected
|
93
94
|
* `qemu_dir` - The path to QEMU's install dir, default: `/opt/homebrew/share/qemu`
|
94
95
|
* `extra_qemu_args` - The raw list of additional arguments to pass to QEMU. Use with extreme caution. (see "Force Multicore" below as example)
|
95
96
|
* `extra_netdev_args` - extra, comma-separated arguments to pass to the -netdev parameter. Use with caution. (see "Force Local IP" below as example)
|
@@ -266,6 +267,12 @@ Vagrant.configure("2") do |config|
|
|
266
267
|
end
|
267
268
|
```
|
268
269
|
|
270
|
+
10. Use socket_vmnet to communicate between machines
|
271
|
+
|
272
|
+
Thanks example from @Leandros.
|
273
|
+
|
274
|
+
See [pr#73](https://github.com/ppggff/vagrant-qemu/pull/73) for details.
|
275
|
+
|
269
276
|
## Debug
|
270
277
|
|
271
278
|
Serial port is exported to unix socket: `<user_home>/.vagrant.d/tmp/vagrant-qemu/<id>/qemu_socket_serial`, or `debug_port`.
|
@@ -22,6 +22,7 @@ module VagrantPlugins
|
|
22
22
|
:memory => env[:machine].provider_config.memory,
|
23
23
|
:net_device => env[:machine].provider_config.net_device,
|
24
24
|
:drive_interface => env[:machine].provider_config.drive_interface,
|
25
|
+
:qemu_bin => env[:machine].provider_config.qemu_bin,
|
25
26
|
:extra_qemu_args => env[:machine].provider_config.extra_qemu_args,
|
26
27
|
:extra_netdev_args => env[:machine].provider_config.extra_netdev_args,
|
27
28
|
:ports => fwPorts,
|
data/lib/vagrant-qemu/config.rb
CHANGED
@@ -14,6 +14,7 @@ module VagrantPlugins
|
|
14
14
|
attr_accessor :net_device
|
15
15
|
attr_accessor :drive_interface
|
16
16
|
attr_accessor :image_path
|
17
|
+
attr_accessor :qemu_bin
|
17
18
|
attr_accessor :qemu_dir
|
18
19
|
attr_accessor :extra_qemu_args
|
19
20
|
attr_accessor :extra_netdev_args
|
@@ -35,6 +36,7 @@ module VagrantPlugins
|
|
35
36
|
@net_device = UNSET_VALUE
|
36
37
|
@drive_interface = UNSET_VALUE
|
37
38
|
@image_path = UNSET_VALUE
|
39
|
+
@qemu_bin = UNSET_VALUE
|
38
40
|
@qemu_dir = UNSET_VALUE
|
39
41
|
@extra_qemu_args = UNSET_VALUE
|
40
42
|
@extra_netdev_args = UNSET_VALUE
|
@@ -66,6 +68,7 @@ module VagrantPlugins
|
|
66
68
|
@net_device = "virtio-net-device" if @net_device == UNSET_VALUE
|
67
69
|
@drive_interface = "virtio" if @drive_interface == UNSET_VALUE
|
68
70
|
@image_path = nil if @image_path == UNSET_VALUE
|
71
|
+
@qemu_bin = nil if @qemu_bin == UNSET_VALUE
|
69
72
|
@qemu_dir = "/opt/homebrew/share/qemu" if @qemu_dir == UNSET_VALUE
|
70
73
|
@extra_qemu_args = [] if @extra_qemu_args == UNSET_VALUE
|
71
74
|
@extra_netdev_args = nil if @extra_netdev_args == UNSET_VALUE
|
data/lib/vagrant-qemu/driver.rb
CHANGED
@@ -78,7 +78,15 @@ module VagrantPlugins
|
|
78
78
|
end
|
79
79
|
|
80
80
|
cmd = []
|
81
|
-
|
81
|
+
if options[:qemu_bin].nil?
|
82
|
+
cmd += %W(qemu-system-#{options[:arch]})
|
83
|
+
else
|
84
|
+
if options[:qemu_bin].kind_of?(Array)
|
85
|
+
cmd += options[:qemu_bin]
|
86
|
+
else
|
87
|
+
cmd += %W(#{options[:qemu_bin]})
|
88
|
+
end
|
89
|
+
end
|
82
90
|
|
83
91
|
# basic
|
84
92
|
cmd += %W(-machine #{options[:machine]}) if !options[:machine].nil?
|
data/lib/vagrant-qemu/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-qemu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ppggff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Enables Vagrant to manage machines with QEMU.
|
14
14
|
email: pgf00a@gmail.com
|
@@ -43,7 +43,6 @@ files:
|
|
43
43
|
- lib/vagrant-qemu/version.rb
|
44
44
|
- locales/en.yml
|
45
45
|
- vagrant-qemu.gemspec
|
46
|
-
- x
|
47
46
|
homepage: https://github.com/ppggff/vagrant-qemu
|
48
47
|
licenses:
|
49
48
|
- MIT
|
data/x
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
diff --git a/lib/vagrant-qemu/action.rb b/lib/vagrant-qemu/action.rb
|
2
|
-
index bb87e38..8818aa9 100644
|
3
|
-
--- a/lib/vagrant-qemu/action.rb
|
4
|
-
+++ b/lib/vagrant-qemu/action.rb
|
5
|
-
@@ -116,7 +116,7 @@ module VagrantPlugins
|
6
|
-
end
|
7
|
-
|
8
|
-
b1.use Provision
|
9
|
-
- b1.use EnvSet, port_collision_repair: false
|
10
|
-
+ b1.use EnvSet, port_collision_repair: true
|
11
|
-
b1.use PrepareForwardedPortCollisionParams
|
12
|
-
b1.use HandleForwardedPortCollisions
|
13
|
-
b1.use SyncedFolderCleanup
|
14
|
-
diff --git a/lib/vagrant-qemu/action/prepare_forwarded_port_collision_params.rb b/lib/vagrant-qemu/action/prepare_forwarded_port_collision_params.rb
|
15
|
-
index 159a785..b7c93a3 100644
|
16
|
-
--- a/lib/vagrant-qemu/action/prepare_forwarded_port_collision_params.rb
|
17
|
-
+++ b/lib/vagrant-qemu/action/prepare_forwarded_port_collision_params.rb
|
18
|
-
@@ -16,16 +16,23 @@ module VagrantPlugins
|
19
|
-
# Build the remap for any existing collision detections
|
20
|
-
remap = {}
|
21
|
-
env[:port_collision_remap] = remap
|
22
|
-
+
|
23
|
-
+ has_ssh_forward = false
|
24
|
-
machine.config.vm.networks.each do |type, options|
|
25
|
-
next if type != :forwarded_port
|
26
|
-
|
27
|
-
# remap ssh.host to ssh_port
|
28
|
-
if options[:id] == "ssh"
|
29
|
-
remap[options[:host]] = machine.provider_config.ssh_port
|
30
|
-
+ has_ssh_forward = true
|
31
|
-
break
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
+ if !has_ssh_forward
|
36
|
-
+ machine.config.vm.networks.forward_port(22, machine.provider_config.ssh_port, [id: "ssh", auto_correct: true])
|
37
|
-
+ end
|
38
|
-
+
|
39
|
-
@app.call(env)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
diff --git a/lib/vagrant-qemu/action/start_instance.rb b/lib/vagrant-qemu/action/start_instance.rb
|
43
|
-
index 13c1d9d..b434bb3 100644
|
44
|
-
--- a/lib/vagrant-qemu/action/start_instance.rb
|
45
|
-
+++ b/lib/vagrant-qemu/action/start_instance.rb
|
46
|
-
@@ -11,6 +11,7 @@ module VagrantPlugins
|
47
|
-
end
|
48
|
-
|
49
|
-
def call(env)
|
50
|
-
+ fwPorts = forwarded_ports(env)
|
51
|
-
options = {
|
52
|
-
:ssh_host => env[:machine].provider_config.ssh_host,
|
53
|
-
:ssh_port => env[:machine].provider_config.ssh_port,
|
54
|
-
@@ -23,7 +24,7 @@ module VagrantPlugins
|
55
|
-
:drive_interface => env[:machine].provider_config.drive_interface,
|
56
|
-
:extra_qemu_args => env[:machine].provider_config.extra_qemu_args,
|
57
|
-
:extra_netdev_args => env[:machine].provider_config.extra_netdev_args,
|
58
|
-
- :ports => forwarded_ports(env),
|
59
|
-
+ :ports => fwPorts,
|
60
|
-
:control_port => env[:machine].provider_config.control_port,
|
61
|
-
:debug_port => env[:machine].provider_config.debug_port,
|
62
|
-
:no_daemonize => env[:machine].provider_config.no_daemonize,
|
63
|
-
@@ -43,7 +44,12 @@ module VagrantPlugins
|
64
|
-
next if type != :forwarded_port
|
65
|
-
|
66
|
-
# Don't include SSH
|
67
|
-
- next if options[:id] == "ssh"
|
68
|
-
+ if options[:id] == "ssh"
|
69
|
-
+ if options[:host] != env[:machine].provider_config.ssh_port
|
70
|
-
+ env[:machine].provider_config.ssh_port = options[:host]
|
71
|
-
+ end
|
72
|
-
+ next
|
73
|
-
+ end
|
74
|
-
|
75
|
-
# Skip port if it is disabled
|
76
|
-
next if options[:disabled]
|