2013-09-03 19:08:54 +02:00
|
|
|
Index: libvirt-1.1.2/configure.ac
|
2011-09-16 20:53:58 +02:00
|
|
|
===================================================================
|
2013-09-03 19:08:54 +02:00
|
|
|
--- libvirt-1.1.2.orig/configure.ac
|
|
|
|
+++ libvirt-1.1.2/configure.ac
|
2013-10-21 23:49:57 +02:00
|
|
|
@@ -174,6 +174,7 @@ LIBVIRT_CHECK_DBUS
|
2013-01-30 19:45:29 +01:00
|
|
|
LIBVIRT_CHECK_FUSE
|
|
|
|
LIBVIRT_CHECK_HAL
|
|
|
|
LIBVIRT_CHECK_NETCF
|
|
|
|
+LIBVIRT_CHECK_NETCONTROL
|
|
|
|
LIBVIRT_CHECK_NUMACTL
|
|
|
|
LIBVIRT_CHECK_OPENWSMAN
|
|
|
|
LIBVIRT_CHECK_PCIACCESS
|
2013-10-21 23:49:57 +02:00
|
|
|
@@ -2297,11 +2298,12 @@ if test "$with_libvirtd" = "no" ; then
|
2013-01-22 05:02:42 +01:00
|
|
|
with_interface=no
|
|
|
|
fi
|
|
|
|
|
|
|
|
-dnl The interface driver depends on the netcf library or udev library
|
|
|
|
-case $with_interface:$with_netcf:$with_udev in
|
|
|
|
+dnl The interface driver depends on the netcf library, netcontrol library, or
|
|
|
|
+dnl udev library
|
|
|
|
+case $with_interface:$with_netcf:$with_netcontrol:$with_udev in
|
|
|
|
check:*yes*) with_interface=yes ;;
|
|
|
|
check:no:no) with_interface=no ;;
|
|
|
|
- yes:no:no) AC_MSG_ERROR([Requested the Interface driver without netcf or udev support]) ;;
|
|
|
|
+ yes:no:no) AC_MSG_ERROR([Requested the Interface driver without netcf, netcontrol, or udev support]) ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if test "$with_interface" = "yes" ; then
|
2013-10-21 23:49:57 +02:00
|
|
|
@@ -2609,6 +2611,7 @@ LIBVIRT_RESULT_DBUS
|
2013-01-30 19:45:29 +01:00
|
|
|
LIBVIRT_RESULT_FUSE
|
|
|
|
LIBVIRT_RESULT_HAL
|
|
|
|
LIBVIRT_RESULT_NETCF
|
|
|
|
+LIBVIRT_RESULT_NETCONTROL
|
|
|
|
LIBVIRT_RESULT_NUMACTL
|
|
|
|
LIBVIRT_RESULT_OPENWSMAN
|
|
|
|
LIBVIRT_RESULT_PCIACCESS
|
2013-09-03 19:08:54 +02:00
|
|
|
Index: libvirt-1.1.2/src/Makefile.am
|
2011-09-16 20:53:58 +02:00
|
|
|
===================================================================
|
2013-09-03 19:08:54 +02:00
|
|
|
--- libvirt-1.1.2.orig/src/Makefile.am
|
|
|
|
+++ libvirt-1.1.2/src/Makefile.am
|
2013-10-22 19:07:40 +02:00
|
|
|
@@ -754,6 +754,10 @@ if WITH_NETCF
|
2013-01-22 05:02:42 +01:00
|
|
|
INTERFACE_DRIVER_SOURCES += \
|
|
|
|
interface/interface_backend_netcf.c
|
2011-09-16 20:53:58 +02:00
|
|
|
endif
|
|
|
|
+if WITH_NETCONTROL
|
2013-01-22 05:02:42 +01:00
|
|
|
+INTERFACE_DRIVER_SOURCES += \
|
|
|
|
+ interface/interface_backend_netcf.c
|
2011-09-16 20:53:58 +02:00
|
|
|
+endif
|
2013-01-30 19:45:29 +01:00
|
|
|
if WITH_UDEV
|
2013-01-22 05:02:42 +01:00
|
|
|
INTERFACE_DRIVER_SOURCES += \
|
|
|
|
interface/interface_backend_udev.c
|
2013-10-22 19:07:40 +02:00
|
|
|
@@ -1314,11 +1318,16 @@ if WITH_NETCF
|
2013-01-22 05:02:42 +01:00
|
|
|
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
|
|
|
|
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
|
|
|
|
else
|
|
|
|
+if WITH_NETCONTROL
|
|
|
|
+libvirt_driver_interface_la_CFLAGS += $(NETCONTROL_CFLAGS)
|
|
|
|
+libvirt_driver_interface_la_LIBADD += $(NETCONTROL_LIBS)
|
|
|
|
+else
|
2013-01-30 19:45:29 +01:00
|
|
|
if WITH_UDEV
|
2013-01-22 05:02:42 +01:00
|
|
|
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
|
|
|
|
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
|
2011-09-16 20:53:58 +02:00
|
|
|
endif
|
2013-01-22 05:02:42 +01:00
|
|
|
endif
|
|
|
|
+endif
|
|
|
|
if WITH_DRIVER_MODULES
|
|
|
|
libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
|
|
|
|
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
|
2013-09-03 19:08:54 +02:00
|
|
|
Index: libvirt-1.1.2/tools/virsh.c
|
2011-09-16 20:53:58 +02:00
|
|
|
===================================================================
|
2013-09-03 19:08:54 +02:00
|
|
|
--- libvirt-1.1.2.orig/tools/virsh.c
|
|
|
|
+++ libvirt-1.1.2/tools/virsh.c
|
|
|
|
@@ -2864,6 +2864,8 @@ vshShowVersion(vshControl *ctl ATTRIBUTE
|
2013-01-30 19:45:29 +01:00
|
|
|
vshPrint(ctl, " Interface");
|
|
|
|
# if defined(WITH_NETCF)
|
2012-09-26 00:22:08 +02:00
|
|
|
vshPrint(ctl, " netcf");
|
2012-11-02 18:55:26 +01:00
|
|
|
+# elif defined(WITH_NETCONTROL)
|
|
|
|
+ vshPrint(ctl, " netcontrol");
|
2013-01-30 19:45:29 +01:00
|
|
|
# elif defined(WITH_UDEV)
|
|
|
|
vshPrint(ctl, " udev");
|
2012-09-26 00:22:08 +02:00
|
|
|
# endif
|
2013-09-03 19:08:54 +02:00
|
|
|
Index: libvirt-1.1.2/src/interface/interface_backend_netcf.c
|
2012-09-26 00:22:08 +02:00
|
|
|
===================================================================
|
2013-09-03 19:08:54 +02:00
|
|
|
--- libvirt-1.1.2.orig/src/interface/interface_backend_netcf.c
|
|
|
|
+++ libvirt-1.1.2/src/interface/interface_backend_netcf.c
|
2012-09-26 00:22:08 +02:00
|
|
|
@@ -23,7 +23,12 @@
|
2011-09-16 20:53:58 +02:00
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2012-09-26 00:22:08 +02:00
|
|
|
-#include <netcf.h>
|
2011-09-16 20:53:58 +02:00
|
|
|
+#ifdef WITH_NETCONTROL
|
2012-09-26 00:22:08 +02:00
|
|
|
+# include <netcontrol/netcf.h>
|
|
|
|
+# include <netcontrol/logger.h>
|
2011-09-16 20:53:58 +02:00
|
|
|
+#else
|
2012-09-26 00:22:08 +02:00
|
|
|
+# include <netcf.h>
|
2011-09-16 20:53:58 +02:00
|
|
|
+#endif
|
|
|
|
|
2013-01-30 19:45:29 +01:00
|
|
|
#include "virerror.h"
|
2011-09-16 20:53:58 +02:00
|
|
|
#include "datatypes.h"
|
2013-07-11 00:06:19 +02:00
|
|
|
@@ -54,6 +59,38 @@ static void interfaceDriverUnlock(struct
|
2011-09-16 20:53:58 +02:00
|
|
|
virMutexUnlock(&driver->lock);
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifdef WITH_NETCONTROL
|
2013-07-11 00:06:19 +02:00
|
|
|
+static void
|
|
|
|
+interface_nc_log_driver(const char *category,
|
|
|
|
+ int priority,
|
|
|
|
+ const char *func,
|
|
|
|
+ const char *file,
|
|
|
|
+ long long line,
|
|
|
|
+ const char *msg,
|
|
|
|
+ size_t len ATTRIBUTE_UNUSED)
|
2011-09-16 20:53:58 +02:00
|
|
|
+{
|
2013-07-11 00:06:19 +02:00
|
|
|
+ int vp;
|
2011-09-16 20:53:58 +02:00
|
|
|
+
|
|
|
|
+ switch(priority) {
|
|
|
|
+ case NC_LOG_FATAL:
|
|
|
|
+ case NC_LOG_ERROR:
|
|
|
|
+ vp = VIR_LOG_ERROR;
|
2013-07-11 00:06:19 +02:00
|
|
|
+ break;
|
2011-09-16 20:53:58 +02:00
|
|
|
+ case NC_LOG_WARN:
|
|
|
|
+ vp = VIR_LOG_WARN;
|
2013-07-11 00:06:19 +02:00
|
|
|
+ break;
|
2011-09-16 20:53:58 +02:00
|
|
|
+ case NC_LOG_INFO:
|
|
|
|
+ vp = VIR_LOG_INFO;
|
2013-07-11 00:06:19 +02:00
|
|
|
+ break;
|
2011-09-16 20:53:58 +02:00
|
|
|
+ case NC_LOG_DEBUG:
|
|
|
|
+ default:
|
|
|
|
+ vp = VIR_LOG_DEBUG;
|
2013-07-11 00:06:19 +02:00
|
|
|
+ break;
|
2011-09-16 20:53:58 +02:00
|
|
|
+ }
|
2013-01-22 05:02:42 +01:00
|
|
|
+ virLogMessage(VIR_LOG_FROM_FILE, vp, file, line, func, 0, "%s", msg);
|
2011-09-16 20:53:58 +02:00
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
2013-07-11 00:06:19 +02:00
|
|
|
/*
|
|
|
|
* Get a minimal virInterfaceDef containing enough metadata
|
|
|
|
* for access control checks to be performed. Currently
|
2013-07-30 22:33:47 +02:00
|
|
|
@@ -164,6 +201,10 @@ static virDrvOpenStatus netcfInterfaceOp
|
2011-09-16 20:53:58 +02:00
|
|
|
goto mutex_error;
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifdef WITH_NETCONTROL
|
|
|
|
+ nc_logger_redirect_to(interface_nc_log_driver);
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
/* open netcf */
|
|
|
|
if (ncf_init(&driverState->netcf, NULL) != 0)
|
|
|
|
{
|
2013-09-03 19:08:54 +02:00
|
|
|
Index: libvirt-1.1.2/src/interface/interface_driver.c
|
2013-01-22 05:02:42 +01:00
|
|
|
===================================================================
|
2013-09-03 19:08:54 +02:00
|
|
|
--- libvirt-1.1.2.orig/src/interface/interface_driver.c
|
|
|
|
+++ libvirt-1.1.2/src/interface/interface_driver.c
|
2013-01-30 19:45:29 +01:00
|
|
|
@@ -28,8 +28,15 @@ interfaceRegister(void) {
|
2013-01-22 05:02:42 +01:00
|
|
|
if (netcfIfaceRegister() == 0)
|
|
|
|
return 0;
|
|
|
|
#endif /* WITH_NETCF */
|
|
|
|
+#ifdef WITH_NETCONTROL
|
|
|
|
+ /* Attempt to load the netcontrol based backend, which is a slightly
|
|
|
|
+ patched netcf backend */
|
|
|
|
+ if (netcfIfaceRegister() == 0)
|
|
|
|
+ return 0;
|
|
|
|
+#endif /* WITH_NETCONTROL */
|
2013-01-30 19:45:29 +01:00
|
|
|
#if WITH_UDEV
|
2013-01-22 05:02:42 +01:00
|
|
|
- /* If there's no netcf or it failed to load, register the udev backend */
|
2013-01-30 19:45:29 +01:00
|
|
|
+ /* If there's no netcf or netcontrol, or it failed to load, register the
|
|
|
|
+ udev backend */
|
2013-01-22 05:02:42 +01:00
|
|
|
if (udevIfaceRegister() == 0)
|
|
|
|
return 0;
|
2013-01-30 19:45:29 +01:00
|
|
|
#endif /* WITH_UDEV */
|
2013-09-03 19:08:54 +02:00
|
|
|
Index: libvirt-1.1.2/m4/virt-netcontrol.m4
|
2013-01-30 19:45:29 +01:00
|
|
|
===================================================================
|
|
|
|
--- /dev/null
|
2013-09-03 19:08:54 +02:00
|
|
|
+++ libvirt-1.1.2/m4/virt-netcontrol.m4
|
2013-01-30 19:45:29 +01:00
|
|
|
@@ -0,0 +1,35 @@
|
|
|
|
+dnl The libnetcontrol library
|
|
|
|
+dnl
|
|
|
|
+dnl Copyright (C) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
|
|
|
+dnl
|
|
|
|
+dnl This library is free software; you can redistribute it and/or
|
|
|
|
+dnl modify it under the terms of the GNU Lesser General Public
|
|
|
|
+dnl License as published by the Free Software Foundation; either
|
|
|
|
+dnl version 2.1 of the License, or (at your option) any later version.
|
|
|
|
+dnl
|
|
|
|
+dnl This library is distributed in the hope that it will be useful,
|
|
|
|
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
+dnl Lesser General Public License for more details.
|
|
|
|
+dnl
|
|
|
|
+dnl You should have received a copy of the GNU Lesser General Public
|
|
|
|
+dnl License along with this library. If not, see
|
|
|
|
+dnl <http://www.gnu.org/licenses/>.
|
|
|
|
+dnl
|
|
|
|
+
|
|
|
|
+AC_DEFUN([LIBVIRT_CHECK_NETCONTROL],[
|
|
|
|
+ LIBVIRT_CHECK_PKG([NETCONTROL], [netcontrol], [0.2.0])
|
|
|
|
+
|
|
|
|
+ if test "$with_netcontrol" = "yes" ; then
|
|
|
|
+ old_CFLAGS="$CFLAGS"
|
|
|
|
+ old_LIBS="$CFLAGS"
|
|
|
|
+ CFLAGS="$CFLAGS $NETCONTROL_CFLAGS"
|
|
|
|
+ LIBS="$LIBS $NETCONTROL_LIBS"
|
|
|
|
+ CFLAGS="$old_CFLAGS"
|
|
|
|
+ LIBS="$old_LIBS"
|
|
|
|
+ fi
|
|
|
|
+])
|
|
|
|
+
|
|
|
|
+AC_DEFUN([LIBVIRT_RESULT_NETCONTROL],[
|
|
|
|
+ LIBVIRT_RESULT_LIB([NETCONTROL])
|
|
|
|
+])
|