]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
vbox: don't register NULL driver
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 30 Oct 2014 08:56:26 +0000 (09:56 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 3 Nov 2014 15:43:22 +0000 (16:43 +0100)
We were missing check for the fact that the storage driver was found and
in case there is no vbox storage driver available, daemon raised the
following error each start:

  error : virRegisterStorageDriver:592 : driver in
  virRegisterStorageDriver must not be NULL

Fixing this makes the condition unified with networkDriver registration
in vbox as well.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/vbox/vbox_driver.c

index c64d2d610a8be90daf3b5f0e57ed81dc041099b4..b2e35e954425b90ea8231b5af3b72c03e9eb4012 100644 (file)
@@ -74,7 +74,7 @@ int vboxStorageRegister(void)
     if (VBoxCGlueInit(&uVersion) == 0)
         storageDriver = vboxGetStorageDriver(uVersion);
 
-    if (virRegisterStorageDriver(storageDriver) < 0)
+    if (storageDriver && virRegisterStorageDriver(storageDriver) < 0)
         return -1;
     return 0;
 }