[Libguestfs] [PATCH 39/61] virt-p2v: fix nogui check

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


---
 p2v/client/bin/virt-p2v | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/p2v/client/bin/virt-p2v b/p2v/client/bin/virt-p2v
index 5373cfb..5b294a7 100755
--- a/p2v/client/bin/virt-p2v
+++ b/p2v/client/bin/virt-p2v
@@ -18,7 +18,8 @@
 
 # Let's check if we should run headless
 NOGUI = open('/proc/cmdline') do |f|
-  f.read =~ /p2v_nogui/
+  val = f.read.scan(/p2v_nogui=([a-zA-Z0-9_=-]*)/)
+  val.first && val.first.first =~ /true/i
 end || ARGV.include?('-nogui') ? true : false
 
 require 'virt-p2v/ui/main'
-- 
1.8.3.1




More information about the Libguestfs mailing list