]> xenbits.xensource.com Git - libvirt.git/commitdiff
vbox: Fix logic in storage driver open function
authorMatthias Bolte <matthias.bolte@googlemail.com>
Thu, 7 Jul 2011 07:21:37 +0000 (09:21 +0200)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Sat, 9 Jul 2011 13:52:14 +0000 (15:52 +0200)
If the main driver is the vbox driver, then the open function
has to return an error if the private data is invalid.

src/vbox/vbox_tmpl.c

index 4a0858fe825f80b5764ea32673f8ce1f59afe019..2c48950eede730b81745945882b4b32e71a6b967 100644 (file)
@@ -7754,19 +7754,16 @@ static virDrvOpenStatus vboxStorageOpen (virConnectPtr conn,
     vboxGlobalData *data = conn->privateData;
 
     if (STRNEQ(conn->driver->name, "VBOX"))
-        goto cleanup;
+        return VIR_DRV_OPEN_DECLINED;
 
     if ((data->pFuncs      == NULL) ||
         (data->vboxObj     == NULL) ||
         (data->vboxSession == NULL))
-        goto cleanup;
+        return VIR_DRV_OPEN_ERROR;
 
     VIR_DEBUG("vbox storage initialized");
     /* conn->storagePrivateData = some storage specific data */
     return VIR_DRV_OPEN_SUCCESS;
-
-cleanup:
-    return VIR_DRV_OPEN_DECLINED;
 }
 
 static int vboxStorageClose (virConnectPtr conn) {