1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

vz: cleanup

Remove unused definitions, functions and structure fields.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
This commit is contained in:
Maxim Nestratov 2015-10-07 13:05:00 +03:00 committed by Dmitry Guryanov
parent 4ee3d4c285
commit 04a39574a8
3 changed files with 0 additions and 88 deletions

View File

@ -262,7 +262,6 @@ vzOpenDefault(virConnectPtr conn)
error:
virObjectUnref(privconn->domains);
virObjectUnref(privconn->caps);
virStoragePoolObjListFree(&privconn->pools);
virObjectEventStateFree(privconn->domainEventState);
prlsdkDisconnect(privconn);
prlsdkDeinit();

View File

@ -114,33 +114,6 @@ vzDoCmdRun(char **outbuf, const char *binary, va_list list)
return ret;
}
/*
* Run command and parse its JSON output, return
* pointer to virJSONValue or NULL in case of error.
*/
virJSONValuePtr
vzParseOutput(const char *binary, ...)
{
char *outbuf;
virJSONValuePtr jobj = NULL;
va_list list;
int ret;
va_start(list, binary);
ret = vzDoCmdRun(&outbuf, binary, list);
va_end(list);
if (ret)
return NULL;
jobj = virJSONValueFromString(outbuf);
if (!jobj)
virReportError(VIR_ERR_INTERNAL_ERROR,
_("invalid output from prlctl: %s"), outbuf);
VIR_FREE(outbuf);
return jobj;
}
/*
* Run command and return its output, pointer to
* buffer or NULL in case of error. Caller os responsible
@ -161,43 +134,3 @@ vzGetOutput(const char *binary, ...)
return outbuf;
}
/*
* Run prlctl command and check for errors
*
* Return value is 0 in case of success, else - -1
*/
int
vzCmdRun(const char *binary, ...)
{
int ret;
va_list list;
va_start(list, binary);
ret = vzDoCmdRun(NULL, binary, list);
va_end(list);
return ret;
}
/*
* Return new file path in malloced string created by
* concatenating first and second function arguments.
*/
char *
vzAddFileExt(const char *path, const char *ext)
{
char *new_path = NULL;
size_t len = strlen(path) + strlen(ext) + 1;
if (VIR_ALLOC_N(new_path, len) < 0)
return NULL;
if (!virStrcpy(new_path, path, len)) {
VIR_FREE(new_path);
return NULL;
}
strcat(new_path, ext);
return new_path;
}

View File

@ -27,11 +27,8 @@
# include "driver.h"
# include "conf/domain_conf.h"
# include "conf/storage_conf.h"
# include "conf/domain_event.h"
# include "conf/network_conf.h"
# include "virthread.h"
# include "virjson.h"
# define vzParseError() \
virReportErrorHelper(VIR_FROM_TEST, VIR_ERR_OPERATION_FAILED, __FILE__, \
@ -50,11 +47,6 @@
# define PARALLELS_DOMAIN_ROUTED_NETWORK_NAME "Routed"
# define PARALLELS_DOMAIN_BRIDGED_NETWORK_NAME "Bridged"
# define PARALLELS_REQUIRED_HOSTONLY_NETWORK "Host-Only"
# define PARALLELS_HOSTONLY_NETWORK_TYPE "host-only"
# define PARALLELS_REQUIRED_BRIDGED_NETWORK "Bridged"
# define PARALLELS_BRIDGED_NETWORK_TYPE "bridged"
struct _vzConn {
virMutex lock;
@ -62,12 +54,9 @@ struct _vzConn {
virDomainObjListPtr domains;
PRL_HANDLE server;
virStoragePoolObjList pools;
virNetworkObjListPtr networks;
virCapsPtr caps;
virDomainXMLOptionPtr xmlopt;
virObjectEventStatePtr domainEventState;
virStorageDriverStatePtr storageState;
const char *drivername;
};
@ -97,19 +86,10 @@ typedef struct vzDomObj *vzDomObjPtr;
virDomainObjPtr vzDomObjFromDomain(virDomainPtr domain);
virDomainObjPtr vzDomObjFromDomainRef(virDomainPtr domain);
virJSONValuePtr vzParseOutput(const char *binary, ...)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
char * vzGetOutput(const char *binary, ...)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
int vzCmdRun(const char *binary, ...)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
char * vzAddFileExt(const char *path, const char *ext);
void vzDriverLock(vzConnPtr driver);
void vzDriverUnlock(vzConnPtr driver);
virStorageVolPtr vzStorageVolLookupByPathLocked(virConnectPtr conn,
const char *path);
int vzStorageVolDefRemove(virStoragePoolObjPtr privpool,
virStorageVolDefPtr privvol);
# define PARALLELS_BLOCK_STATS_FOREACH(OP) \
OP(rd_req, VIR_DOMAIN_BLOCK_STATS_READ_REQ, "read_requests") \