]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
vz: cleanup
authorMaxim Nestratov <mnestratov@virtuozzo.com>
Wed, 7 Oct 2015 10:05:00 +0000 (13:05 +0300)
committerDmitry Guryanov <dguryanov@parallels.com>
Thu, 8 Oct 2015 13:44:48 +0000 (16:44 +0300)
Remove unused definitions, functions and structure fields.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
src/vz/vz_driver.c
src/vz/vz_utils.c
src/vz/vz_utils.h

index d0b4692493b868678fa15cdeb806ff34ecc147f0..15dc70f2408708344f6be8534e8c85e47e8d1b25 100644 (file)
@@ -262,7 +262,6 @@ vzOpenDefault(virConnectPtr conn)
  error:
     virObjectUnref(privconn->domains);
     virObjectUnref(privconn->caps);
-    virStoragePoolObjListFree(&privconn->pools);
     virObjectEventStateFree(privconn->domainEventState);
     prlsdkDisconnect(privconn);
     prlsdkDeinit();
index 08b7f5af86ade4f2f9a4a4111919850c0ce29687..894f7dd62db766e51f4dfd8b71397dc3bc13c036 100644 (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;
-}
index 77f49f0ce0e6bfd17ccaa4f6ffb059483beba834..84cf08f6ebec50273e114c94262dff858e6e8a1e 100644 (file)
 
 # 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__,    \
 # 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")        \