2012-08-08 19:47:16 +02:00
|
|
|
Index: libvirt-0.9.13/configure.ac
|
2011-09-16 20:53:58 +02:00
|
|
|
===================================================================
|
2012-08-08 19:47:16 +02:00
|
|
|
--- libvirt-0.9.13.orig/configure.ac
|
|
|
|
+++ libvirt-0.9.13/configure.ac
|
2011-09-16 20:53:58 +02:00
|
|
|
@@ -63,6 +63,7 @@ AVAHI_REQUIRED="0.6.0"
|
|
|
|
POLKIT_REQUIRED="0.6"
|
|
|
|
PARTED_REQUIRED="1.8.0"
|
|
|
|
NETCF_REQUIRED="0.1.4"
|
|
|
|
+NETCONTROL_REQUIRED="0.2.0"
|
|
|
|
UDEV_REQUIRED=145
|
|
|
|
PCIACCESS_REQUIRED=0.10.0
|
|
|
|
XMLRPC_REQUIRED=1.14.0
|
2012-08-08 19:47:16 +02:00
|
|
|
@@ -1796,6 +1797,38 @@ AM_CONDITIONAL([WITH_NETCF], [test "$wit
|
2011-09-16 20:53:58 +02:00
|
|
|
AC_SUBST([NETCF_CFLAGS])
|
|
|
|
AC_SUBST([NETCF_LIBS])
|
|
|
|
|
|
|
|
+AC_ARG_WITH([netcontrol],
|
|
|
|
+ AC_HELP_STRING([--with-netcontrol], [SUSE netcontrol support to configure physical host network interfaces @<:@default=check@:>@]),
|
|
|
|
+ [],
|
|
|
|
+ [test "$with_netcontrol" = "yes" && with_netcontrol=no || with_netcontrol=check])
|
|
|
|
+
|
|
|
|
+NETCONTROL_CFLAGS=
|
|
|
|
+NETCONTROL_LIBS=
|
|
|
|
+if test "$with_netcf" = "yes"; then
|
|
|
|
+ if test "$with_netcontrol" = "yes" || test "$with_netcontrol" = "check"; then
|
|
|
|
+ AC_MSG_WARN([netcf and netcontrol cannot be used together, disabling netcontrol])
|
|
|
|
+ with_netcontrol=no
|
|
|
|
+ fi
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+if test "$with_netcontrol" = "yes" || test "$with_netcontrol" = "check"; then
|
|
|
|
+ PKG_CHECK_MODULES(NETCONTROL, netcontrol >= $NETCONTROL_REQUIRED,
|
|
|
|
+ [with_netcontrol=yes], [
|
|
|
|
+ if test "$with_netcontrol" = "check" ; then
|
|
|
|
+ with_netcontrol=no
|
|
|
|
+ else
|
|
|
|
+ AC_MSG_ERROR(
|
|
|
|
+ [You must install netcontrol >= $NETCONTROL_REQUIRED to compile libvirt])
|
|
|
|
+ fi
|
|
|
|
+ ])
|
|
|
|
+ if test "$with_netcontrol" = "yes" ; then
|
|
|
|
+ AC_DEFINE_UNQUOTED([WITH_NETCONTROL], 1,
|
|
|
|
+ [whether libnetcontrol is available to configure physical host network interfaces])
|
|
|
|
+ fi
|
|
|
|
+fi
|
|
|
|
+AM_CONDITIONAL([WITH_NETCONTROL], [test "$with_netcontrol" = "yes"])
|
|
|
|
+AC_SUBST([NETCONTROL_CFLAGS])
|
|
|
|
+AC_SUBST([NETCONTROL_LIBS])
|
|
|
|
|
|
|
|
AC_ARG_WITH([secrets],
|
|
|
|
AC_HELP_STRING([--with-secrets], [with local secrets management driver @<:@default=yes@:>@]),[],[with_secrets=yes])
|
2012-08-08 19:47:16 +02:00
|
|
|
@@ -2810,6 +2843,7 @@ AC_MSG_NOTICE([ Remote: $with_remote])
|
2011-09-16 20:53:58 +02:00
|
|
|
AC_MSG_NOTICE([ Network: $with_network])
|
|
|
|
AC_MSG_NOTICE([Libvirtd: $with_libvirtd])
|
|
|
|
AC_MSG_NOTICE([ netcf: $with_netcf])
|
|
|
|
+AC_MSG_NOTICE([ netctrl: $with_netcontrol])
|
|
|
|
AC_MSG_NOTICE([ macvtap: $with_macvtap])
|
|
|
|
AC_MSG_NOTICE([virtport: $with_virtualport])
|
|
|
|
AC_MSG_NOTICE([])
|
2012-08-08 19:47:16 +02:00
|
|
|
@@ -2942,6 +2976,11 @@ AC_MSG_NOTICE([ netcf: $NETCF_CFLAGS $
|
2011-09-16 20:53:58 +02:00
|
|
|
else
|
|
|
|
AC_MSG_NOTICE([ netcf: no])
|
|
|
|
fi
|
|
|
|
+if test "$with_netcontrol" = "yes" ; then
|
|
|
|
+AC_MSG_NOTICE([ netctrl: $NETCONTROL_CFLAGS $NETCONTROL_LIBS])
|
|
|
|
+else
|
|
|
|
+AC_MSG_NOTICE([ netctrl: no])
|
|
|
|
+fi
|
|
|
|
if test "$with_qemu" = "yes" && test "$LIBPCAP_FOUND" != "no"; then
|
|
|
|
AC_MSG_NOTICE([ pcap: $LIBPCAP_CFLAGS $LIBPCAP_LIBS])
|
|
|
|
else
|
2012-08-08 19:47:16 +02:00
|
|
|
Index: libvirt-0.9.13/daemon/Makefile.am
|
2011-09-16 20:53:58 +02:00
|
|
|
===================================================================
|
2012-08-08 19:47:16 +02:00
|
|
|
--- libvirt-0.9.13.orig/daemon/Makefile.am
|
|
|
|
+++ libvirt-0.9.13/daemon/Makefile.am
|
|
|
|
@@ -150,6 +150,10 @@ endif
|
2011-09-16 20:53:58 +02:00
|
|
|
|
|
|
|
if WITH_NETCF
|
|
|
|
libvirtd_LDADD += ../src/libvirt_driver_interface.la
|
|
|
|
+else
|
|
|
|
+if WITH_NETCONTROL
|
|
|
|
+ libvirtd_LDADD += ../src/libvirt_driver_interface.la
|
|
|
|
+endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
if WITH_NODE_DEVICES
|
2012-08-08 19:47:16 +02:00
|
|
|
Index: libvirt-0.9.13/daemon/libvirtd.c
|
2011-09-16 20:53:58 +02:00
|
|
|
===================================================================
|
2012-08-08 19:47:16 +02:00
|
|
|
--- libvirt-0.9.13.orig/daemon/libvirtd.c
|
|
|
|
+++ libvirt-0.9.13/daemon/libvirtd.c
|
2012-04-12 23:33:51 +02:00
|
|
|
@@ -76,6 +76,10 @@
|
2011-09-16 20:53:58 +02:00
|
|
|
# endif
|
|
|
|
# ifdef WITH_NETCF
|
|
|
|
# include "interface/netcf_driver.h"
|
|
|
|
+# else
|
|
|
|
+# ifdef WITH_NETCONTROL
|
|
|
|
+# include "interface/netcf_driver.h"
|
|
|
|
+# endif
|
|
|
|
# endif
|
2012-08-08 19:47:16 +02:00
|
|
|
# ifdef WITH_STORAGE
|
2011-09-16 20:53:58 +02:00
|
|
|
# include "storage/storage_driver.h"
|
2012-08-08 19:47:16 +02:00
|
|
|
@@ -402,6 +406,10 @@ static void daemonInitialize(void)
|
2011-09-16 20:53:58 +02:00
|
|
|
# endif
|
|
|
|
# ifdef WITH_NETCF
|
|
|
|
interfaceRegister();
|
|
|
|
+#else
|
|
|
|
+# ifdef WITH_NETCONTROL
|
|
|
|
+ interfaceRegister();
|
|
|
|
+# endif
|
|
|
|
# endif
|
2012-08-08 19:47:16 +02:00
|
|
|
# ifdef WITH_STORAGE
|
2011-09-16 20:53:58 +02:00
|
|
|
storageRegister();
|
2012-08-08 19:47:16 +02:00
|
|
|
Index: libvirt-0.9.13/src/Makefile.am
|
2011-09-16 20:53:58 +02:00
|
|
|
===================================================================
|
2012-08-08 19:47:16 +02:00
|
|
|
--- libvirt-0.9.13.orig/src/Makefile.am
|
|
|
|
+++ libvirt-0.9.13/src/Makefile.am
|
|
|
|
@@ -941,6 +941,24 @@ libvirt_driver_interface_la_LIBADD += ..
|
2011-09-16 20:53:58 +02:00
|
|
|
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
|
|
|
|
endif
|
|
|
|
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
|
|
|
|
+else
|
|
|
|
+if WITH_NETCONTROL
|
|
|
|
+if WITH_DRIVER_MODULES
|
|
|
|
+mod_LTLIBRARIES += libvirt_driver_interface.la
|
|
|
|
+else
|
|
|
|
+noinst_LTLIBRARIES += libvirt_driver_interface.la
|
|
|
|
+libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la
|
|
|
|
+endif
|
|
|
|
+libvirt_driver_interface_la_CFLAGS = $(NETCONTROL_CFLAGS) \
|
|
|
|
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
|
|
|
|
+libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS)
|
|
|
|
+libvirt_driver_interface_la_LIBADD = $(NETCONTROL_LIBS)
|
|
|
|
+if WITH_DRIVER_MODULES
|
|
|
|
+libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
|
|
|
|
+libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
|
|
|
|
+endif
|
|
|
|
+libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
|
|
|
|
+endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
if WITH_SECRETS
|
2012-08-08 19:47:16 +02:00
|
|
|
Index: libvirt-0.9.13/src/interface/netcf_driver.c
|
2011-09-16 20:53:58 +02:00
|
|
|
===================================================================
|
2012-08-08 19:47:16 +02:00
|
|
|
--- libvirt-0.9.13.orig/src/interface/netcf_driver.c
|
|
|
|
+++ libvirt-0.9.13/src/interface/netcf_driver.c
|
2011-09-16 20:53:58 +02:00
|
|
|
@@ -23,7 +23,13 @@
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
+#ifdef WITH_NETCONTROL
|
|
|
|
+#include <netcontrol/netcf.h>
|
|
|
|
+#include <netcontrol/logger.h>
|
|
|
|
+#include "logging.h"
|
|
|
|
+#else
|
|
|
|
#include <netcf.h>
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
#include "virterror_internal.h"
|
|
|
|
#include "datatypes.h"
|
|
|
|
@@ -55,6 +61,39 @@ static void interfaceDriverUnlock(struct
|
|
|
|
virMutexUnlock(&driver->lock);
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifdef WITH_NETCONTROL
|
|
|
|
+static void interface_nc_log_driver(const char *category,
|
|
|
|
+ int priority,
|
|
|
|
+ const char *func,
|
|
|
|
+ const char *file ATTRIBUTE_UNUSED,
|
|
|
|
+ long long line,
|
|
|
|
+ const char *msg,
|
|
|
|
+ size_t len ATTRIBUTE_UNUSED)
|
|
|
|
+{
|
|
|
|
+ int vp;
|
|
|
|
+ const char *vc;
|
|
|
|
+
|
|
|
|
+ switch(priority) {
|
|
|
|
+ case NC_LOG_FATAL:
|
|
|
|
+ case NC_LOG_ERROR:
|
|
|
|
+ vp = VIR_LOG_ERROR;
|
|
|
|
+ break;
|
|
|
|
+ case NC_LOG_WARN:
|
|
|
|
+ vp = VIR_LOG_WARN;
|
|
|
|
+ break;
|
|
|
|
+ case NC_LOG_INFO:
|
|
|
|
+ vp = VIR_LOG_INFO;
|
|
|
|
+ break;
|
|
|
|
+ case NC_LOG_DEBUG:
|
|
|
|
+ default:
|
|
|
|
+ vp = VIR_LOG_DEBUG;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ vc = category ? category : "netcontrol";
|
|
|
|
+ virLogMessage(vc, vp, func, line, 0, "%s", msg);
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
static int netcf_to_vir_err(int netcf_errcode)
|
|
|
|
{
|
|
|
|
switch (netcf_errcode)
|
|
|
|
@@ -140,6 +179,10 @@ static virDrvOpenStatus interfaceOpenInt
|
|
|
|
goto mutex_error;
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifdef WITH_NETCONTROL
|
|
|
|
+ nc_logger_redirect_to(interface_nc_log_driver);
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
/* open netcf */
|
|
|
|
if (ncf_init(&driverState->netcf, NULL) != 0)
|
|
|
|
{
|
2012-08-08 19:47:16 +02:00
|
|
|
Index: libvirt-0.9.13/tools/virsh.c
|
2011-09-16 20:53:58 +02:00
|
|
|
===================================================================
|
2012-08-08 19:47:16 +02:00
|
|
|
--- libvirt-0.9.13.orig/tools/virsh.c
|
|
|
|
+++ libvirt-0.9.13/tools/virsh.c
|
|
|
|
@@ -20837,6 +20837,10 @@ vshShowVersion(vshControl *ctl ATTRIBUTE
|
2011-09-16 20:53:58 +02:00
|
|
|
#endif
|
|
|
|
#ifdef WITH_NETCF
|
2012-08-08 19:47:16 +02:00
|
|
|
vshPrint(ctl, " Interface");
|
2011-09-16 20:53:58 +02:00
|
|
|
+#else
|
2012-08-08 19:47:16 +02:00
|
|
|
+# ifdef WITH_NETCONTROL
|
|
|
|
+ vshPrint(ctl, " Interface");
|
|
|
|
+# endif
|
2011-09-16 20:53:58 +02:00
|
|
|
#endif
|
|
|
|
#ifdef WITH_NWFILTER
|
|
|
|
vshPrint(ctl, " Nwfilter");
|