[PATCH] vbox: network: make sure driver not be NULL in virRegisterNetworkDriver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



libvirtd will report below error if does not make sure driver not be NULL
in virRegisterNetworkDriver

$ libvirtd
2014-10-24 09:24:36.443+0000: 28876: info : libvirt version: 1.2.10
2014-10-24 09:24:36.443+0000: 28876: error : virRegisterNetworkDriver:549 : driver in virRegisterNetworkDriver must not be NULL
2014-10-24 09:24:36.443+0000: 28876: error : virDriverLoadModule:99 : Failed module registration vboxNetworkRegister

Signed-off-by: Shanzhi Yu <shyu@xxxxxxxxxx>
---
 src/vbox/vbox_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vbox/vbox_driver.c b/src/vbox/vbox_driver.c
index 743a488..ff69069 100644
--- a/src/vbox/vbox_driver.c
+++ b/src/vbox/vbox_driver.c
@@ -152,7 +152,7 @@ int vboxNetworkRegister(void)
     if (VBoxCGlueInit(&uVersion) == 0)
         networkDriver = vboxGetNetworkDriver(uVersion);
 
-    if (virRegisterNetworkDriver(networkDriver) < 0)
+    if ((networkDriver != NULL) && (virRegisterNetworkDriver(networkDriver) < 0)) 
         return -1;
     return 0;
 }
-- 
1.9.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]