Accepting request 291345 from home:jfehlig:branches:Virtualization

- Fix crash in libnetcontrol-backed interface driver
  Modified libvirt-suse-netcontrol.patch
  boo#920551

OBS-URL: https://build.opensuse.org/request/show/291345
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=446
This commit is contained in:
James Fehlig 2015-03-18 18:17:20 +00:00 committed by Git OBS Bridge
parent 44a71b3a3e
commit e456a7adb9
2 changed files with 9 additions and 22 deletions

View File

@ -134,37 +134,17 @@ Index: libvirt-1.2.13/src/interface/interface_backend_netcf.c
static void
virNetcfDriverStateDispose(void *obj)
@@ -87,7 +123,22 @@ netcfStateInitialize(bool privileged ATT
@@ -87,6 +123,10 @@ netcfStateInitialize(bool privileged ATT
if (!(driver = virObjectLockableNew(virNetcfDriverStateClass)))
return -1;
+#ifdef WITH_NETCONTROL
+ nc_logger_redirect_to(interface_nc_log_driver);
+#endif
+
/* open netcf */
+ /* Note: On SUSE, ncf_init will fail if Network Manager is enabled. Ignore
+ * the failure so libvirtd will still start. Connections to the driver will
+ * fail in netcfInterfaceOpen. This restores the behavior before
+ * commit 822fe136.
+ */
+ if (ncf_init(&driver->netcf, NULL) != 0) {
+ VIR_WARN("Failed to initialize netcontrol. Continuing with network "
+ "interface management features disabled");
+ virObjectUnref(driver);
+ driver = NULL;
+ }
+#else
if (ncf_init(&driver->netcf, NULL) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("failed to initialize netcf"));
@@ -95,6 +146,7 @@ netcfStateInitialize(bool privileged ATT
driver = NULL;
return -1;
}
+#endif
return 0;
}
Index: libvirt-1.2.13/src/interface/interface_driver.c
===================================================================
--- libvirt-1.2.13.orig/src/interface/interface_driver.c

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Mar 16 17:17:49 MDT 2015 - jfehlig@suse.com
- Fix crash in libnetcontrol-backed interface driver
Modified libvirt-suse-netcontrol.patch
boo#920551
-------------------------------------------------------------------
Thu Mar 12 07:48:35 UTC 2015 - fcastelli@suse.com