[libvirt] [PATCH] vz: cleanup
Dmitry Guryanov
dguryanov at virtuozzo.com
Thu Oct 8 13:54:18 UTC 2015
On 10/07/2015 01:05 PM, Maxim Nestratov wrote:
> From: Maxim Nestratov <mnestratov at virtuozzo.com>
>
> Remove unused definitions, functions and structure fields.
ACKed and pushed, thanks!
>
> Signed-off-by: Maxim Nestratov <mnestratov at virtuozzo.com>
> ---
> src/vz/vz_driver.c | 1 -
> src/vz/vz_utils.c | 67 ----------------------------------------------------
> src/vz/vz_utils.h | 20 ---------------
> 3 files changed, 0 insertions(+), 88 deletions(-)
>
> diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
> index d0b4692..15dc70f 100644
> --- a/src/vz/vz_driver.c
> +++ b/src/vz/vz_driver.c
> @@ -262,7 +262,6 @@ vzOpenDefault(virConnectPtr conn)
> error:
> virObjectUnref(privconn->domains);
> virObjectUnref(privconn->caps);
> - virStoragePoolObjListFree(&privconn->pools);
> virObjectEventStateFree(privconn->domainEventState);
> prlsdkDisconnect(privconn);
> prlsdkDeinit();
> diff --git a/src/vz/vz_utils.c b/src/vz/vz_utils.c
> index 08b7f5a..894f7dd 100644
> --- a/src/vz/vz_utils.c
> +++ b/src/vz/vz_utils.c
> @@ -115,33 +115,6 @@ vzDoCmdRun(char **outbuf, const char *binary, va_list list)
> }
>
> /*
> - * 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
> * for freeing the buffer.
> @@ -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;
> -}
> diff --git a/src/vz/vz_utils.h b/src/vz/vz_utils.h
> index 77f49f0..84cf08f 100644
> --- a/src/vz/vz_utils.h
> +++ b/src/vz/vz_utils.h
> @@ -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") \
More information about the libvir-list
mailing list