Permalink
Browse files

qemu: stub spice support

  • Loading branch information...
1 parent ed77594 commit 03aee8a38f727cd8a1ae900221030d1f5c366400 Guido De Rosa committed Mar 16, 2012
@@ -143,6 +143,9 @@ def format_cmdline
# capture/release.
cmdline << '-enable-kvm' << ' '
+
+ spice_port = opts['-vnc'].sub(/[^\d]/,'').to_i + 12300
+ cmdline << "-spice port=#{spice_port},disable-ticketing" << ' '
return cmdline
end
@@ -0,0 +1 @@
+require 'onboard/virtualization/qemu/spice/port'
@@ -0,0 +1,31 @@
+class OnBoard
+ module Virtualization
+ module QEMU
+ module Spice
+ class Port
+
+ MAX = 29
+
+ class << self
+
+ def available
+ busy = []
+ QEMU.get_all.map do |vm|
+ begin
+ busy << vm.config['-spice']['port'].to_i
+ rescue NoMethodError
+ end
+ end
+ return (1..MAX).to_a - busy
+ end
+
+ end
+
+ end
+ end
+ end
+ end
+end
+
+
+
@@ -4,7 +4,7 @@ module QEMU
module VNC
class Display
- MAX = 31
+ MAX = 29
class << self

0 comments on commit 03aee8a

Please sign in to comment.