[Libguestfs] [PATCH 1/4] p2v: use yast2 lan on SUSE distros rather than NM

Cédric Bosdonnat cbosdonnat at suse.com
Wed Jun 22 09:45:32 UTC 2016


NetworkManager isn't provided on SLES. As yast2 lan is available on all
openSUSE / SLE distro, use it instead.
---
 p2v/gui.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/p2v/gui.c b/p2v/gui.c
index e720002..b50cadf 100644
--- a/p2v/gui.c
+++ b/p2v/gui.c
@@ -51,6 +51,7 @@
 
 #include <config.h>
 
+#include <sys/stat.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
@@ -654,7 +655,11 @@ test_connection_ok (gpointer user_data)
 static void
 configure_network_button_clicked (GtkWidget *w, gpointer data)
 {
-  ignore_value (system ("nm-connection-editor &"));
+  struct stat statbuf;
+  if (stat ("/sbin/yast2", &statbuf) >= 0)
+    ignore_value (system ("yast2 lan &"));
+  else
+    ignore_value (system ("nm-connection-editor &"));
 }
 
 /**
-- 
2.6.6




More information about the Libguestfs mailing list