From 1428029738ff55b3e1e35bf7b3425ff0192d5560 Mon Sep 17 00:00:00 2001 From: Matthias Bolte Date: Thu, 7 Jul 2011 09:21:37 +0200 Subject: [PATCH] vbox: Fix logic in storage driver open function 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 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index 4a0858fe82..2c48950eed 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -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) {