Accepting request 293120 from home:jfehlig:branches:Virtualization

This change fixes boo#920551 in libvirt.  IMO the bug should be
fixed in libnetcontrol since all apps using libnetcontrol would
be affected, but alas libvirt is probably the only libnetcontrol
app in existence.

- Disable interface driver if libnetcontrol cannot be initialized
  Modified libvirt-suse-netcontrol.patch
  boo#920551

OBS-URL: https://build.opensuse.org/request/show/293120
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=448
This commit is contained in:
James Fehlig 2015-03-25 16:02:37 +00:00 committed by Git OBS Bridge
parent e456a7adb9
commit 140ccf2159
2 changed files with 27 additions and 0 deletions

View File

@ -145,6 +145,26 @@ Index: libvirt-1.2.13/src/interface/interface_backend_netcf.c
/* open netcf */
if (ncf_init(&driver->netcf, NULL) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@@ -1146,6 +1186,19 @@ static virStateDriver interfaceStateDriv
int netcfIfaceRegister(void)
{
+ struct netcf *netcf;
+
+ /* Initialization of libnetcontrol will fail if NetworkManager is enabled.
+ * Skip registration if ncf_init fails.
+ * TODO: finer-grained check? E.g. is_nm_enabled()
+ */
+ if (ncf_init(&netcf, NULL) != 0) {
+ VIR_WARN("Failed to intialize libnetcontrol. Management of interface devices is disabled");
+ return 0;
+ }
+
+ ncf_close(netcf);
+
if (virSetSharedInterfaceDriver(&interfaceDriver) < 0)
return -1;
if (virRegisterStateDriver(&interfaceStateDriver) < 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 @@
-------------------------------------------------------------------
Wed Mar 25 09:10:46 MDT 2015 - jfehlig@suse.com
- Disable interface driver if libnetcontrol cannot be initialized
Modified libvirt-suse-netcontrol.patch
boo#920551
-------------------------------------------------------------------
Mon Mar 16 17:17:49 MDT 2015 - jfehlig@suse.com