7183N/AUse libv12n to find virtualization environment instead of asking systemd
7183N/A
7183N/ANeed to submit upstream
7183N/A
7183N/A--- gnome-control-center-3.18.2/configure.ac
7183N/A+++ gnome-control-center-3.18.2/configure.ac
7183N/A@@ -64,6 +64,7 @@ AC_CHECK_HEADERS(X11/extensions/XKB.h)
7183N/A CPPFLAGS=$savecppflags
7183N/A
7183N/A AC_CHECK_LIB(m, floor)
7183N/A+AC_CHECK_LIB(v12n, v12n_get_current_env)
7183N/A
7183N/A # IBus support
7183N/A IBUS_REQUIRED_VERSION=1.5.2
7183N/A--- gnome-control-center-3.18.2/panels/info/cc-info-panel.c
7183N/A+++ gnome-control-center-3.18.2/panels/info/cc-info-panel.c
7183N/A@@ -43,6 +43,10 @@
7183N/A #include <GL/glx.h>
7183N/A #endif
7183N/A
7183N/A+#ifdef HAVE_LIBV12N
7183N/A+#include <libv12n.h>
7183N/A+#endif
7183N/A+
7183N/A #include "gsd-disk-space-helper.h"
7183N/A
7183N/A /* Autorun options */
7183N/A@@ -740,6 +744,10 @@ static struct {
7183N/A const char *id;
7183N/A const char *display;
7183N/A } const virt_tech[] = {
7183N/A+ { "kernel-zone", "Kernel Zone" },
7183N/A+ { "logical-domain", "Logical Domain" },
7183N/A+ { "non-global-zone", "Non-Global Zone" },
7183N/A+ { "virtualbox", "VirtualBox" },
7183N/A { "kvm", "KVM" },
7183N/A { "qemu", "QEmu" },
7183N/A { "vmware", "VMware" },
7183N/A@@ -788,13 +796,31 @@ set_virtualization_label (CcInfoPanel *
7183N/A static void
7183N/A info_panel_setup_virt (CcInfoPanel *self)
7183N/A {
7183N/A+ char *str = NULL;
7183N/A+
7183N/A+#ifdef HAVE_LIBV12N
7183N/A+ v12n_env_t *env;
7183N/A+ char *name;
7183N/A+
7183N/A+ env = v12n_get_current_env ();
7183N/A+ if (env == NULL)
7183N/A+ {
7183N/A+ g_debug (" v12n_get_current_env failed, bailing: %s", strerror(errno));
7183N/A+ goto bail;
7183N/A+ }
7183N/A+
7183N/A+ name = v12n_get_env_prop (env, V12N_PROP_NAME);
7183N/A+ if (name != NULL)
7183N/A+ {
7183N/A+ str = g_strdup (name);
7183N/A+ free (name);
7183N/A+ }
7183N/A+ v12n_free_env(env);
7183N/A+#else /* systemd */
7183N/A GError *error = NULL;
7183N/A GDBusProxy *systemd_proxy;
7183N/A GVariant *variant;
7183N/A GVariant *inner;
7183N/A- char *str;
7183N/A-
7183N/A- str = NULL;
7183N/A
7183N/A systemd_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
7183N/A G_DBUS_PROXY_FLAGS_NONE,
7183N/A@@ -832,6 +858,7 @@ info_panel_setup_virt (CcInfoPanel *sel
7183N/A g_variant_unref (variant);
7183N/A
7183N/A g_object_unref (systemd_proxy);
7183N/A+#endif
7183N/A
7183N/A bail:
7183N/A set_virtualization_label (self, str);