[libvirt] [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 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index 37fe248..dfa676e 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -7753,19 +7753,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) { -- 1.7.4.1

On 07/07/2011 01:24 AM, Matthias Bolte wrote:
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 files changed, 2 insertions(+), 5 deletions(-)
ACK. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

2011/7/7 Eric Blake <eblake@redhat.com>:
On 07/07/2011 01:24 AM, Matthias Bolte wrote:
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 files changed, 2 insertions(+), 5 deletions(-)
ACK.
Thanks, pushed. -- Matthias Bolte http://photron.blogspot.com
participants (2)
-
Eric Blake
-
Matthias Bolte