--- p2v/client/lib/virt-p2v/ui/gtk.rb | 20 +++++++++++++++++++- p2v/client/lib/virt-p2v/ui/main.rb | 8 +++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/p2v/client/lib/virt-p2v/ui/gtk.rb b/p2v/client/lib/virt-p2v/ui/gtk.rb index c52eb11..38b9184 100644 --- a/p2v/client/lib/virt-p2v/ui/gtk.rb +++ b/p2v/client/lib/virt-p2v/ui/gtk.rb @@ -99,6 +99,20 @@ if Kernel.const_defined?(:NOGUI) && NOGUI == true @items.clear end + def _set_checked(dev_name, check) + @items.each do |item| + if item[VirtP2V::UI::Convert::CONVERT_FIXED_DEVICE] == dev_name then + item[VirtP2V::UI::Convert::CONVERT_FIXED_CONVERT] = check + end + end + end + + def _uncheck_all + @items.each do |item| + item[VirtP2V::UI::Convert::CONVERT_FIXED_CONVERT] = false + end + end + def each(&block) @items.each do |item| # block accepts three params: @@ -108,6 +122,10 @@ if Kernel.const_defined?(:NOGUI) && NOGUI == true block.call(nil, nil, item) end end + + def get_iter(path) + self + end end class ConvertProfileW < NeverMind @@ -155,7 +173,7 @@ if Kernel.const_defined?(:NOGUI) && NOGUI == true @text = str puts "conversion status changed to: '#{str}'" STDOUT.flush - if str =~ /failure|error/i + if str =~ /failure|error|no\ root/i puts "Giving up." exit(4) end diff --git a/p2v/client/lib/virt-p2v/ui/main.rb b/p2v/client/lib/virt-p2v/ui/main.rb index b445c9e..42716d2 100644 --- a/p2v/client/lib/virt-p2v/ui/main.rb +++ b/p2v/client/lib/virt-p2v/ui/main.rb @@ -187,7 +187,7 @@ 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'] + 'convert_name', 'disks'] end def is_param_optional?(name) @@ -258,6 +258,12 @@ class NewMain < Main def fill_and_click_convert fill_widgets_from_params(['convert_name']) + + get_object('convert_fixed_list')._uncheck_all + @cmd_params['disks'].split(',').each do |_dev| + get_object('convert_fixed_list')._set_checked(_dev, true) + end + call_actions_by_name(['convert_name_changed', 'convert_cpus_changed', 'convert_memory_changed', 'convert_profile_changed', 'convert_button_clicked']) -- 1.8.3.1