Accepting request 149603 from Virtualization

- Unconditionally build sanlock support
  bnc#799262

- Fix interface management functions that were broken when
  rebasing libvirt-suse-netcontrol.patch
  bnc#799444 (SLES bug that affect Factory too)

OBS-URL: https://build.opensuse.org/request/show/149603
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libvirt?expand=0&rev=109
This commit is contained in:
Stephan Kulow 2013-01-24 09:24:09 +00:00 committed by Git OBS Bridge
commit 8157d33a71
3 changed files with 80 additions and 38 deletions

View File

@ -49,7 +49,23 @@ Index: libvirt-1.0.1/configure.ac
AC_ARG_WITH([secrets],
AC_HELP_STRING([--with-secrets], [with local secrets management driver @<:@default=yes@:>@]),[],[with_secrets=yes])
@@ -3253,6 +3286,11 @@ AC_MSG_NOTICE([ netcf: $NETCF_CFLAGS $
@@ -2863,11 +2896,12 @@ if test "$with_libvirtd" = "no" ; then
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
@@ -3253,6 +3287,11 @@ AC_MSG_NOTICE([ netcf: $NETCF_CFLAGS $
else
AC_MSG_NOTICE([ netcf: no])
fi
@ -65,31 +81,34 @@ Index: libvirt-1.0.1/src/Makefile.am
===================================================================
--- libvirt-1.0.1.orig/src/Makefile.am
+++ libvirt-1.0.1/src/Makefile.am
@@ -1115,6 +1115,24 @@ libvirt_driver_interface_la_LIBADD += ..
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
@@ -617,6 +617,10 @@ if WITH_NETCF
INTERFACE_DRIVER_SOURCES += \
interface/interface_backend_netcf.c
endif
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
+else
+if WITH_NETCONTROL
+if WITH_DRIVER_MODULES
+mod_LTLIBRARIES += libvirt_driver_interface.la
+INTERFACE_DRIVER_SOURCES += \
+ interface/interface_backend_netcf.c
+endif
if HAVE_UDEV
INTERFACE_DRIVER_SOURCES += \
interface/interface_backend_udev.c
@@ -1105,11 +1109,16 @@ if WITH_NETCF
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
+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
if HAVE_UDEV
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
endif
if WITH_SECRETS
endif
+endif
if WITH_DRIVER_MODULES
libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
Index: libvirt-1.0.1/tools/virsh.c
===================================================================
--- libvirt-1.0.1.orig/tools/virsh.c
@ -121,7 +140,7 @@ Index: libvirt-1.0.1/src/interface/interface_backend_netcf.c
#include "virterror_internal.h"
#include "datatypes.h"
@@ -52,6 +57,39 @@ static void interfaceDriverUnlock(struct
@@ -52,6 +57,37 @@ static void interfaceDriverUnlock(struct
virMutexUnlock(&driver->lock);
}
@ -129,13 +148,12 @@ Index: libvirt-1.0.1/src/interface/interface_backend_netcf.c
+static void interface_nc_log_driver(const char *category,
+ int priority,
+ const char *func,
+ const char *file ATTRIBUTE_UNUSED,
+ const char *file,
+ long long line,
+ const char *msg,
+ size_t len ATTRIBUTE_UNUSED)
+{
+ int vp;
+ const char *vc;
+
+ switch(priority) {
+ case NC_LOG_FATAL:
@ -153,15 +171,14 @@ Index: libvirt-1.0.1/src/interface/interface_backend_netcf.c
+ vp = VIR_LOG_DEBUG;
+ break;
+ }
+ vc = category ? category : "netcontrol";
+ virLogMessage(vc, vp, func, line, 0, "%s", msg);
+ virLogMessage(VIR_LOG_FROM_FILE, vp, file, line, func, 0, "%s", msg);
+}
+#endif
+
static int netcf_to_vir_err(int netcf_errcode)
{
switch (netcf_errcode)
@@ -137,6 +175,10 @@ static virDrvOpenStatus interfaceOpenInt
@@ -137,6 +173,10 @@ static virDrvOpenStatus interfaceOpenInt
goto mutex_error;
}
@ -172,3 +189,23 @@ Index: libvirt-1.0.1/src/interface/interface_backend_netcf.c
/* open netcf */
if (ncf_init(&driverState->netcf, NULL) != 0)
{
Index: libvirt-1.0.1/src/interface/interface_driver.c
===================================================================
--- libvirt-1.0.1.orig/src/interface/interface_driver.c
+++ libvirt-1.0.1/src/interface/interface_driver.c
@@ -28,8 +28,14 @@ interfaceRegister(void) {
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 */
#if HAVE_UDEV
- /* If there's no netcf or it failed to load, register the udev backend */
+ /* If there's no netcf or netcontrol, or it failed to load, register the udev backend */
if (udevIfaceRegister() == 0)
return 0;
#endif /* HAVE_UDEV */

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Mon Jan 21 20:59:16 MST 2013 - jfehlig@suse.com
- Unconditionally build sanlock support
bnc#799262
-------------------------------------------------------------------
Mon Jan 21 20:54:39 MST 2013 - jfehlig@suse.com
- Fix interface management functions that were broken when
rebasing libvirt-suse-netcontrol.patch
bnc#799444 (SLES bug that affect Factory too)
-------------------------------------------------------------------
Sat Jan 5 11:39:02 MST 2013 - jfehlig@suse.com

View File

@ -71,19 +71,19 @@
%define with_polkit 0%{!?_without_polkit:1}
%define with_udev 0%{!?_without_udev:1}
%define with_audit 0%{!?_without_audit:1}
%define with_yajl 0%{!?_without_yajl:1}
%define with_sanlock 0%{!?_without_sanlock:1}
# A few optional bits off by default, we enable later
%define with_capng 0%{!?_without_capng:0}
%define with_netcf 0%{!?_without_netcf:0}
%define with_netcontrol 0%{!?_without_netcontrol:0}
%define with_yajl 0%{!?_without_yajl:0}
%define with_nwfilter 0%{!?_without_nwfilter:0}
%define with_libpcap 0%{!?_without_libpcap:0}
%define with_macvtap 0%{!?_without_macvtap:0}
%define with_libnl 0%{!?_without_libnl:0}
%define with_dtrace 0%{!?_without_dtrace:0}
%define with_cgconfig 0%{!?_without_cgconfig:0}
%define with_sanlock 0%{!?_without_sanlock:0}
%define with_systemd 0%{!?_without_systemd:0}
%define with_numad 0%{!?_without_numad:0}
%define with_firewalld 0%{!?_without_firewalld:0}
@ -146,18 +146,10 @@
%define with_capng 0%{!?_without_capng:1}
%endif
# Enable yajl library for JSON mode with QEMU
%define with_yajl 0%{!?_without_yajl:%{server_drivers}}
%if 0%{?suse_version} >= 1210
%define with_systemd 0%{!?_without_systemd:1}
%endif
# Enable sanlock on openSUSE > 12.1
%if 0%{?suse_version} > 1210
%define with_sanlock 0%{!?_without_sanlock:%{server_drivers}}
%endif
# Disable some drivers when building without libvirt daemon.
# The logic is the same as in configure.ac
%if ! %{with_libvirtd}