[Libguestfs] [PATCH 60/61] p2v: memory, cpu and debug options in nogui mode

Maros Zatko mzatko at redhat.com
Wed Feb 12 14:31:12 UTC 2014


---
 p2v/client/lib/virt-p2v/ui/gtk.rb  |  2 +-
 p2v/client/lib/virt-p2v/ui/main.rb | 14 +++++++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/p2v/client/lib/virt-p2v/ui/gtk.rb b/p2v/client/lib/virt-p2v/ui/gtk.rb
index daa9ad8..98adca8 100644
--- a/p2v/client/lib/virt-p2v/ui/gtk.rb
+++ b/p2v/client/lib/virt-p2v/ui/gtk.rb
@@ -212,7 +212,7 @@ on '#{@name}'. Available items are: #{@items.join(', ')}.")
               "convert_name", "convert_cpus", "convert_memory",
               "ip_manual", "ip_address", "ip_prefix", "ip_gateway",
               "ip_dns", "server_hostname", "server_username",
-              "server_password"].flat_map do |_l|
+              "server_password", "convert_debug"].flat_map do |_l|
                 [_l, SomeTextFieldW]
               end) ]
             ).merge({
diff --git a/p2v/client/lib/virt-p2v/ui/main.rb b/p2v/client/lib/virt-p2v/ui/main.rb
index bdfbd69..57c762f 100644
--- a/p2v/client/lib/virt-p2v/ui/main.rb
+++ b/p2v/client/lib/virt-p2v/ui/main.rb
@@ -187,12 +187,14 @@ class NewMain < Main
   def expected_param_keys
       ['ip_manual', 'ip_address', 'ip_prefix', 'ip_gateway', 'ip_dns',
             'server_hostname', 'server_username', 'server_password',
-            'convert_name', 'disks', 'nics', 'rems', 'profile']
+            'convert_name', 'disks', 'nics', 'rems', 'profile',
+            'convert_memory', 'convert_cpus', 'convert_debug']
   end
 
   def is_param_optional?(name)
       ['ip_address', 'ip_prefix', 'ip_gateway', 'ip_dns',
-       'disks', 'nics', 'rems', 'profile'].include?(name)
+       'disks', 'nics', 'rems', 'profile', 'convert_memory', 'convert_cpus',
+       'convert_debug'].include?(name)
   end
 
   def validate_params(params)
@@ -277,7 +279,13 @@ class NewMain < Main
   end
 
   def fill_and_click_convert
-    fill_widgets_from_params(['convert_name'])
+    fill_widgets_from_params(['convert_name', 'convert_cpus',
+                              'convert_memory', 'convert_debug'])
+
+    if get_object('convert_debug').text =~ /true|1/ then
+      call_actions_by_name(['convert_debug_toggled'])
+      puts "Conversion debug enabled."
+    end
 
     get_object('convert_profile_list').
       _set_selected_name(@cmd_params['profile']) if @cmd_params['profile']
-- 
1.8.3.1




More information about the Libguestfs mailing list