susi-qemu 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/output.rb +1 -1
- data/lib/susi.rb +3 -2
- data/lib/version.rb +1 -1
- data/lib/vm.rb +9 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0fad5758256c0e74da6f5b06cc494653f4dace51cdaf0c358b658d7255f539c
|
4
|
+
data.tar.gz: 743619250706519bc7d4bd5d93953a8c2a08d1acaf9923d0100fc65c26e3630a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23502b5662ca90b84c15e42456689f80cb9b216b8f1e6d507fd99c19957ba47296ab38d3e910d399559ecb5f3f2a9b9e5b34f8e8d864d4560b4f4ccb8f0422fb
|
7
|
+
data.tar.gz: 719ca17aade8cc9bc3603041907aee96021030bea45401179b76f9e3f640041cd4bdba101b65fd98acf57a8ee67ffc4dd5b9723fbf1065beb8b2c78830cefacc
|
data/lib/output.rb
CHANGED
data/lib/susi.rb
CHANGED
@@ -50,6 +50,7 @@ YAML
|
|
50
50
|
config = YAML.load_file(CONFIG_FILE)
|
51
51
|
id = config['id']
|
52
52
|
name = config['name'] || Dir.pwd.split('/').last
|
53
|
+
usb = config['usb']
|
53
54
|
disk_template = "#{TEMPLATE_DIR}/#{config['template']}"
|
54
55
|
|
55
56
|
# check if vm is already running
|
@@ -63,12 +64,12 @@ YAML
|
|
63
64
|
Susi::debug "Disk not found, cloning..."
|
64
65
|
Disk.clone(disk_template, disk_name)
|
65
66
|
|
66
|
-
VM.start(name, disk_name)
|
67
|
+
VM.start(name, disk_name, usb: usb)
|
67
68
|
|
68
69
|
# SSH into VM and set hostname
|
69
70
|
SSH.set_hostname(name)
|
70
71
|
else
|
71
|
-
VM.start(name, disk_name)
|
72
|
+
VM.start(name, disk_name, usb: usb)
|
72
73
|
end
|
73
74
|
end
|
74
75
|
|
data/lib/version.rb
CHANGED
data/lib/vm.rb
CHANGED
@@ -122,7 +122,7 @@ module Susi
|
|
122
122
|
raise "No free port found in range #{start_port}..#{end_port}"
|
123
123
|
end
|
124
124
|
|
125
|
-
def self.start(name, disk, cdrom: nil)
|
125
|
+
def self.start(name, disk, cdrom: nil, usb: nil)
|
126
126
|
qmp_port = self.get_free_port(4000, 4099)
|
127
127
|
ssh_port = self.get_free_port(2000, 2099)
|
128
128
|
vnc_port = self.get_free_port(5900, 5999)
|
@@ -154,6 +154,14 @@ module Susi
|
|
154
154
|
cmd << "-cdrom #{cdrom}"
|
155
155
|
end
|
156
156
|
|
157
|
+
if usb
|
158
|
+
cmd << "-device qemu-xhci"
|
159
|
+
usb.each do |usbstr|
|
160
|
+
vendor, product = usbstr.split(':')
|
161
|
+
cmd << "-device usb-host,vendorid=0x#{vendor},productid=0x#{product}"
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
157
165
|
cmd = cmd.join(" ")
|
158
166
|
Susi::debug cmd
|
159
167
|
system(cmd)
|