[libvirt] FYI, [PATCH] build: update gnulib submodule to latest
by Jim Meyering
FYI, I've just pushed this:
>From 26bd7bef58296300cd81756297de514b9c2073df Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Fri, 5 Feb 2010 17:57:39 +0100
Subject: [PATCH] build: update gnulib submodule to latest
* .gnulib: This fixes a warning in test-gettimeofday.c,
seen via "make check". Reported by Daniel Veillard.
---
.gnulib | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/.gnulib b/.gnulib
index 9d0ad65..11fbc57 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 9d0ad652de159d08e5f679842f8a2a5658196361
+Subproject commit 11fbc57405a118e6ec9a3ebc19bbf5ececdae4d6
--
1.7.0.rc1.204.gb96e
14 years, 9 months
[libvirt] FW: Regarding lxc driver for libvirt.
by Kumar L Srikanth-B22348
Can anyone help in the below issue?
Regards,
Srikanth.
-----Original Message-----
From: Kumar L Srikanth-B22348
Sent: Friday, February 05, 2010 4:02 PM
To: 'libvir-list(a)redhat.com'
Subject: Regarding lxc driver for libvirt.
Hi,
I am new to libvirt.
I want to create a Domain using libvirt XML. In order to mount the
host's '/home/srikanth' directory to the new container's '/' directory,
my XML format is shown below:
<domain type='lxc' id='1'>
<name>container1_vm</name>
<memory>500000</memory>
<os>
<type>exe</type>
<init>/bin/sh</init>
</os>
<vcpu>1</vcpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/libexec/libvirt_lxc</emulator>
<filesystem type='mount'>
<source dir='/home/srikanth'/>
<target dir='/'/>
</filesystem>
<console type='pty' />
</devices>
</domain>
With the above libvirt XML, Domain is defining, but not starting. When I
issue the start command it's saying "Domain started", but showing "shut
off" status. If I changed the target directory(<traget dir='/'/>) from
'/' to '/home/container1'(<traget dir='/home/container1'/>), the domain
is starting normally and I am able to see the contents in the target
directory.
Can you please let me know, how can I set the target directory to '/'?
By the way, I am using libvirt version o.7.6.
Regards,
Srikanth.
14 years, 9 months
[libvirt] [PATCH] absolutePathFromBaseFile: don't leak when first arg contains no "/"
by Jim Meyering
Not only did this function leak(p), but it would also over-allocate
(by the length of basename(base_file)), and then later, re-alloc
to compensate, so I rewrote it:
>From 1dc52930daa000b407d8a8f18588a19cf4e8b7f5 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Thu, 4 Feb 2010 16:55:57 +0100
Subject: [PATCH] absolutePathFromBaseFile: don't leak when first arg contains no "/"
* src/util/storage_file.c: Include "dirname.h".
(absolutePathFromBaseFile): Rewrite not to leak, and to require
fewer allocations.
* bootstrap (modules): Add dirname-lgpl and stpncpy.
* .gnulib: Update submodule to the latest.
---
.gnulib | 2 +-
bootstrap | 2 ++
src/util/storage_file.c | 27 ++++++++++-----------------
3 files changed, 13 insertions(+), 18 deletions(-)
diff --git a/.gnulib b/.gnulib
index 146d914..9d0ad65 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 146d9145073e62a2096a2d6b33f75e93908fedf3
+Subproject commit 9d0ad652de159d08e5f679842f8a2a5658196361
diff --git a/bootstrap b/bootstrap
index cc3c6ef..5cc43c5 100755
--- a/bootstrap
+++ b/bootstrap
@@ -71,6 +71,7 @@ c-ctype
canonicalize-lgpl
close
connect
+dirname-lgpl
getaddrinfo
gethostname
getpass
@@ -93,6 +94,7 @@ send
setsockopt
socket
stpcpy
+stpncpy
strchrnul
strndup
strerror
diff --git a/src/util/storage_file.c b/src/util/storage_file.c
index 44057d2..8c53fba 100644
--- a/src/util/storage_file.c
+++ b/src/util/storage_file.c
@@ -1,7 +1,7 @@
/*
* storage_file.c: file utility functions for FS storage backend
*
- * Copyright (C) 2007-2009 Red Hat, Inc.
+ * Copyright (C) 2007-2010 Red Hat, Inc.
* Copyright (C) 2007-2008 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -26,6 +26,7 @@
#include <unistd.h>
#include <fcntl.h>
+#include "dirname.h"
#include "memory.h"
#include "virterror_internal.h"
@@ -246,26 +247,18 @@ vmdk4GetBackingStore(virConnectPtr conn,
static char *
absolutePathFromBaseFile(const char *base_file, const char *path)
{
- size_t base_size, path_size;
- char *res, *p;
+ char *res;
+ size_t d_len = dir_len (base_file);
- if (*path == '/')
+ /* If path is already absolute, or if dirname(base_file) is ".",
+ just return a copy of path. */
+ if (*path == '/' || d_len == 0)
return strdup(path);
- base_size = strlen(base_file) + 1;
- path_size = strlen(path) + 1;
- if (VIR_ALLOC_N(res, base_size - 1 + path_size) < 0)
+ if (VIR_ALLOC_N(res, d_len + 1 + strlen(path) + 1) < 0)
return NULL;
- memcpy(res, base_file, base_size);
- p = strrchr(res, '/');
- if (p != NULL)
- p++;
- else
- p = res;
- memcpy(p, path, path_size);
- if (VIR_REALLOC_N(res, (p + path_size) - res) < 0) {
- /* Ignore failure */
- }
+
+ stpcpy(stpcpy(stpncpy(res, base_file, d_len), "/"), path);
return res;
}
--
1.7.0.rc1.199.g9253a
14 years, 9 months
[libvirt] [PATCH 0/12] Improve security driver handling & QEMU DAC management
by Daniel P. Berrange
This patch series does some work on te security drivers, and the QEMU code
for managing DAC permissions on files.
The core goal is to turn the QEMU driver DAC file management code into a
security driver. Instead of QEMU calling into the SELinux/AppArmour drivers
directly, a stacked driver module is introduced. This delegates all operations
to first the QEMU DAC driver, and then the main SELinux/AppArmour driver.
The end result is that all the permissions management code is removed from
the QEMU driver, and we're left with just simple security driver calls.
In the process of this a number of flaws in the current hotplug code were
found, and code was generally tidied up with a view to making it easier to
manage.
Finally, we add the ability to turn off the QEMU DAC file managment code,
and also deal gracefully with failures to change ownership (eg on NFS with
root squash, or readonly FS).
14 years, 9 months
[libvirt] [PATCH] storage: Replace storageLog with VIR_ERROR
by Matthias Bolte
---
src/storage/storage_driver.c | 23 ++++++++++-------------
1 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 50fcbe2..37be77d 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -40,11 +40,10 @@
#include "storage_conf.h"
#include "memory.h"
#include "storage_backend.h"
+#include "logging.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
-#define storageLog(msg...) fprintf(stderr, msg)
-
static virStorageDriverStatePtr driverState;
static int storageDriverShutdown(void);
@@ -70,8 +69,7 @@ storageDriverAutostart(virStorageDriverStatePtr driver) {
!virStoragePoolObjIsActive(pool)) {
virStorageBackendPtr backend;
if ((backend = virStorageBackendForType(pool->def->type)) == NULL) {
- storageLog("Missing backend %d",
- pool->def->type);
+ VIR_ERROR("Missing backend %d", pool->def->type);
virStoragePoolObjUnlock(pool);
continue;
}
@@ -79,9 +77,9 @@ storageDriverAutostart(virStorageDriverStatePtr driver) {
if (backend->startPool &&
backend->startPool(NULL, pool) < 0) {
virErrorPtr err = virGetLastError();
- storageLog("Failed to autostart storage pool '%s': %s",
- pool->def->name, err ? err->message :
- "no error message found");
+ VIR_ERROR("Failed to autostart storage pool '%s': %s",
+ pool->def->name, err ? err->message :
+ "no error message found");
virStoragePoolObjUnlock(pool);
continue;
}
@@ -90,9 +88,9 @@ storageDriverAutostart(virStorageDriverStatePtr driver) {
virErrorPtr err = virGetLastError();
if (backend->stopPool)
backend->stopPool(NULL, pool);
- storageLog("Failed to autostart storage pool '%s': %s",
- pool->def->name, err ? err->message :
- "no error message found");
+ VIR_ERROR("Failed to autostart storage pool '%s': %s",
+ pool->def->name, err ? err->message :
+ "no error message found");
virStoragePoolObjUnlock(pool);
continue;
}
@@ -132,7 +130,6 @@ storageDriverStartup(int privileged) {
goto error;
if (virAsprintf(&base, "%s/.libvirt", userdir) == -1) {
- storageLog("out of memory in virAsprintf");
VIR_FREE(userdir);
goto out_of_memory;
}
@@ -175,7 +172,7 @@ storageDriverStartup(int privileged) {
return 0;
out_of_memory:
- storageLog("virStorageStartup: out of memory");
+ virReportOOMError(NULL);
error:
VIR_FREE(base);
storageDriverUnlock(driverState);
@@ -635,7 +632,7 @@ storagePoolUndefine(virStoragePoolPtr obj) {
if (unlink(pool->autostartLink) < 0 && errno != ENOENT && errno != ENOTDIR) {
char ebuf[1024];
- storageLog("Failed to delete autostart link '%s': %s",
+ VIR_ERROR("Failed to delete autostart link '%s': %s",
pool->autostartLink, virStrerror(errno, ebuf, sizeof ebuf));
}
--
1.6.3.3
14 years, 9 months
[libvirt] [PATCH] website: Add a 1em right margin
by Matthias Bolte
This stops the text and pre-boxes from touching the right border.
---
docs/libvirt.css | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/docs/libvirt.css b/docs/libvirt.css
index a4d1ddd..dfc93c6 100644
--- a/docs/libvirt.css
+++ b/docs/libvirt.css
@@ -30,6 +30,7 @@ h2, h3, h4, h5, h6 {
#content {
margin-left: 230px;
+ margin-right: 1em;
padding: 0px;
padding-bottom: 1em;
}
--
1.6.3.3
14 years, 9 months
[libvirt] [PATCH] opennebula: Remove unnecessary casts
by Matthias Bolte
---
src/opennebula/one_driver.c | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/src/opennebula/one_driver.c b/src/opennebula/one_driver.c
index ad7faca..c96d24d 100644
--- a/src/opennebula/one_driver.c
+++ b/src/opennebula/one_driver.c
@@ -108,7 +108,7 @@ static int oneIsSecure(virConnectPtr conn ATTRIBUTE_UNUSED)
static virDomainPtr oneDomainLookupByID(virConnectPtr conn,
int id)
{
- one_driver_t *driver = (one_driver_t *)conn->privateData;
+ one_driver_t *driver = conn->privateData;
virDomainPtr dom = NULL;
virDomainObjPtr vm = NULL;
@@ -137,7 +137,7 @@ return_point:
static virDomainPtr oneDomainLookupByUUID(virConnectPtr conn,
const unsigned char *uuid)
{
- one_driver_t *driver = (one_driver_t *)conn->privateData;
+ one_driver_t *driver = conn->privateData;
virDomainPtr dom = NULL;
virDomainObjPtr vm = NULL;
@@ -165,7 +165,7 @@ return_point:
static virDomainPtr oneDomainLookupByName(virConnectPtr conn,
const char *name)
{
- one_driver_t *driver = (one_driver_t *)conn->privateData;
+ one_driver_t *driver = conn->privateData;
virDomainObjPtr vm = NULL;
virDomainPtr dom=NULL;
@@ -192,7 +192,7 @@ return_point:
static int oneListDomains(virConnectPtr conn, int *ids, int nids)
{
- one_driver_t *driver = (one_driver_t *)conn->privateData;
+ one_driver_t *driver = conn->privateData;
int n;
oneDriverLock(driver);
@@ -204,7 +204,7 @@ static int oneListDomains(virConnectPtr conn, int *ids, int nids)
static int oneNumDomains(virConnectPtr conn)
{
- one_driver_t *driver = (one_driver_t *)conn->privateData;
+ one_driver_t *driver = conn->privateData;
int n;
oneDriverLock(driver);
@@ -216,7 +216,7 @@ static int oneNumDomains(virConnectPtr conn)
static int oneListDefinedDomains(virConnectPtr conn,
char **const names, int nnames) {
- one_driver_t *driver = (one_driver_t *)conn->privateData;
+ one_driver_t *driver = conn->privateData;
int n;
oneDriverLock(driver);
@@ -228,7 +228,7 @@ static int oneListDefinedDomains(virConnectPtr conn,
static int oneNumDefinedDomains(virConnectPtr conn)
{
- one_driver_t *driver = (one_driver_t *)conn->privateData;
+ one_driver_t *driver = conn->privateData;
int n;
oneDriverLock(driver);
@@ -240,7 +240,7 @@ static int oneNumDefinedDomains(virConnectPtr conn)
static virDomainPtr oneDomainDefine(virConnectPtr conn, const char *xml)
{
- one_driver_t *driver = (one_driver_t *)conn->privateData;
+ one_driver_t *driver = conn->privateData;
virDomainDefPtr def;
virDomainObjPtr vm;
virDomainPtr dom=NULL;
@@ -272,7 +272,7 @@ return_point:
static int oneDomainUndefine(virDomainPtr dom)
{
- one_driver_t *driver = (one_driver_t *)dom->conn->privateData;
+ one_driver_t *driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
int ret=-1;
@@ -302,7 +302,7 @@ return_point:
static int oneDomainGetInfo(virDomainPtr dom,
virDomainInfoPtr info)
{
- one_driver_t *driver = (one_driver_t *)dom->conn->privateData;
+ one_driver_t *driver = dom->conn->privateData;
struct timeval tv;
virDomainObjPtr vm;
oneDriverLock(driver);
@@ -377,7 +377,7 @@ static int oneDomainGetInfo(virDomainPtr dom,
static char *oneGetOSType(virDomainPtr dom)
{
- one_driver_t *driver = (one_driver_t *)dom->conn->privateData;
+ one_driver_t *driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
char *ret = NULL;
@@ -403,7 +403,7 @@ cleanup:
static int oneDomainStart(virDomainPtr dom)
{
virConnectPtr conn = dom->conn;
- one_driver_t *driver = (one_driver_t *)(conn->privateData);
+ one_driver_t *driver = conn->privateData;
virDomainObjPtr vm;
int ret = -1;
int oneid;
@@ -436,7 +436,7 @@ static virDomainPtr
oneDomainCreateAndStart(virConnectPtr conn,
const char *xml,
unsigned int flags ATTRIBUTE_UNUSED) {
- one_driver_t *driver = (one_driver_t *)conn->privateData;
+ one_driver_t *driver = conn->privateData;
virDomainObjPtr vm = NULL;
virDomainDefPtr def;
virDomainPtr dom = NULL;
@@ -486,7 +486,7 @@ return_point:
static int oneDomainShutdown(virDomainPtr dom)
{
- one_driver_t *driver = (one_driver_t*)dom->conn->privateData;
+ one_driver_t *driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret=-1;
@@ -520,7 +520,7 @@ return_point:
static int oneDomainDestroy(virDomainPtr dom)
{
- one_driver_t *driver = (one_driver_t*)dom->conn->privateData;
+ one_driver_t *driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret=-1;
@@ -556,7 +556,7 @@ return_point:
static int oneDomainSuspend(virDomainPtr dom)
{
- one_driver_t* driver=dom->conn->privateData;
+ one_driver_t* driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret=-1;
@@ -590,7 +590,7 @@ return_point:
static int oneDomainResume(virDomainPtr dom)
{
- one_driver_t* driver=dom->conn->privateData;
+ one_driver_t* driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret=-1;
@@ -698,7 +698,7 @@ static int oneGetAutostart(virDomainPtr domain ATTRIBUTE_UNUSED, int *autostart)
}
static char* oneGetCapabilities(virConnectPtr conn){
- one_driver_t* privconn=conn->privateData;
+ one_driver_t* privconn = conn->privateData;
char *xml;
oneDriverLock(privconn);
if ((xml = virCapabilitiesFormatXML(privconn->caps)) == NULL)
--
1.6.3.3
14 years, 9 months
[libvirt] [PATCH] cpu conf: Use virBufferFreeAndReset instead of virBufferContentAndReset and VIR_FREE
by Matthias Bolte
---
src/conf/cpu_conf.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index e7924c1..244d670 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -249,7 +249,6 @@ virCPUDefFormat(virConnectPtr conn,
int flags)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
- char *tmp;
if (virCPUDefFormatBuf(conn, &buf, def, indent, flags) < 0)
goto cleanup;
@@ -262,8 +261,7 @@ virCPUDefFormat(virConnectPtr conn,
no_memory:
virReportOOMError(conn);
cleanup:
- tmp = virBufferContentAndReset(&buf);
- VIR_FREE(tmp);
+ virBufferFreeAndReset(&buf);
return NULL;
}
--
1.6.3.3
14 years, 9 months
[libvirt] [PATCH] docs: Refer to virReportOOMError in the HACKING file
by Matthias Bolte
Instead of refering to __virRaiseError(VIR_ERROR_NO_MEMORY).
---
HACKING | 22 +++++++++++-----------
docs/hacking.html.in | 20 ++++++++++----------
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/HACKING b/HACKING
index 3844e50..4bf216c 100644
--- a/HACKING
+++ b/HACKING
@@ -166,13 +166,13 @@ codebase, because they encourage a number of serious coding bugs and do
not enable compile time verification of checks for NULL. Instead of these
routines, use the macros from memory.h
- - eg to allocate a single object:
+ - eg to allocate a single object:
virDomainPtr domain;
if (VIR_ALLOC(domain) < 0) {
- __virRaiseError(VIR_ERROR_NO_MEMORY)
- return NULL;
+ virReportOOMError(NULL);
+ return NULL;
}
@@ -182,8 +182,8 @@ routines, use the macros from memory.h
int ndomains = 10;
if (VIR_ALLOC_N(domains, ndomains) < 0) {
- __virRaiseError(VIR_ERROR_NO_MEMORY)
- return NULL;
+ virReportOOMError(NULL);
+ return NULL;
}
- eg to allocate an array of object pointers
@@ -192,8 +192,8 @@ routines, use the macros from memory.h
int ndomains = 10;
if (VIR_ALLOC_N(domains, ndomains) < 0) {
- __virRaiseError(VIR_ERROR_NO_MEMORY)
- return NULL;
+ virReportOOMError(NULL);
+ return NULL;
}
- eg to re-allocate the array of domains to be longer
@@ -201,8 +201,8 @@ routines, use the macros from memory.h
ndomains = 20
if (VIR_REALLOC_N(domains, ndomains) < 0) {
- __virRaiseError(VIR_ERROR_NO_MEMORY)
- return NULL;
+ virReportOOMError(NULL);
+ return NULL;
}
- eg to free the domain
@@ -297,7 +297,7 @@ eg typical usage is as follows:
if (virBufferError(&buf)) {
virBufferFreeAndReset(&buf);
- virReportOOMError(...);
+ virReportOOMError(NULL);
return NULL;
}
@@ -385,7 +385,7 @@ to build:
- if a recently commited patch breaks compilation on a platform
or for a given driver then it's fine to commit a minimal fix
directly without getting the review feedback first
- - similary if make check or make syntax-chek breaks, if there is
+ - similary if make check or make syntax-check breaks, if there is
an obvious fix, it's fine to commit immediately
The patch should still be sent to the list (or tell what the fix was if
trivial) and 'make check syntax-check' should pass too before commiting
diff --git a/docs/hacking.html.in b/docs/hacking.html.in
index 96f6657..71b4f47 100644
--- a/docs/hacking.html.in
+++ b/docs/hacking.html.in
@@ -192,8 +192,8 @@
virDomainPtr domain;
if (VIR_ALLOC(domain) < 0) {
- __virRaiseError(VIR_ERROR_NO_MEMORY)
- return NULL;
+ virReportOOMError(NULL);
+ return NULL;
}
</pre></li>
@@ -204,8 +204,8 @@
int ndomains = 10;
if (VIR_ALLOC_N(domains, ndomains) < 0) {
- __virRaiseError(VIR_ERROR_NO_MEMORY)
- return NULL;
+ virReportOOMError(NULL);
+ return NULL;
}
</pre></li>
@@ -216,8 +216,8 @@
int ndomains = 10;
if (VIR_ALLOC_N(domains, ndomains) < 0) {
- __virRaiseError(VIR_ERROR_NO_MEMORY)
- return NULL;
+ virReportOOMError(NULL);
+ return NULL;
}
</pre></li>
@@ -227,8 +227,8 @@
ndomains = 20
if (VIR_REALLOC_N(domains, ndomains) < 0) {
- __virRaiseError(VIR_ERROR_NO_MEMORY)
- return NULL;
+ virReportOOMError(NULL);
+ return NULL;
}
</pre></li>
@@ -314,7 +314,7 @@
if (virBufferError(&buf)) {
virBufferFreeAndReset(&buf);
- virReportOOMError(...);
+ virReportOOMError(NULL);
return NULL;
}
@@ -419,7 +419,7 @@
<li>if a recently commited patch breaks compilation on a platform
or for a given driver then it's fine to commit a minimal fix
directly without getting the review feedback first</li>
- <li>if make check or make syntax-chek breaks, if there is
+ <li>if make check or make syntax-check breaks, if there is
an obvious fix, it's fine to commit immediately.
The patch should still be sent to the list (or tell what the fix was if
trivial) and 'make check syntax-check' should pass too before commiting
--
1.6.3.3
14 years, 9 months
[libvirt] [PATCH] esx: Cleanup preprocessing structure in esxVI_EnsureSession
by Matthias Bolte
---
src/esx/esx_vi.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index bc94326..19c85c5 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -1317,16 +1317,18 @@ esxVI_BuildFullTraversalSpecList(esxVI_SelectionSpec **fullTraversalSpecList)
* you try to call it. Query the session manager for the current session of
* this connection instead and re-login if there is no current session for this
* connection.
+ *
+ * Update: 'ESX 4.0.0 build-171294' doesn't implement this method.
*/
#define ESX_VI_USE_SESSION_IS_ACTIVE 0
int
esxVI_EnsureSession(esxVI_Context *ctx)
{
- int result = 0;
#if ESX_VI_USE_SESSION_IS_ACTIVE
esxVI_Boolean active = esxVI_Boolean_Undefined;
#else
+ int result = 0;
esxVI_String *propertyNameList = NULL;
esxVI_ObjectContent *sessionManager = NULL;
esxVI_DynamicProperty *dynamicProperty = NULL;
@@ -1352,6 +1354,8 @@ esxVI_EnsureSession(esxVI_Context *ctx)
return -1;
}
}
+
+ return 0;
#else
if (esxVI_String_AppendValueToList(&propertyNameList,
"currentSession") < 0 ||
@@ -1388,16 +1392,11 @@ esxVI_EnsureSession(esxVI_Context *ctx)
"last login");
goto failure;
}
-#endif
cleanup:
-#if ESX_VI_USE_SESSION_IS_ACTIVE
- /* nothing */
-#else
esxVI_String_Free(&propertyNameList);
esxVI_ObjectContent_Free(&sessionManager);
esxVI_UserSession_Free(¤tSession);
-#endif
return result;
@@ -1405,8 +1404,7 @@ esxVI_EnsureSession(esxVI_Context *ctx)
result = -1;
goto cleanup;
-
- return 0;
+#endif
}
--
1.6.3.3
14 years, 9 months