[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 13/16] Rename lxc_driver_t to virLXCDriver



From: "Daniel P. Berrange" <berrange redhat com>

Rename the lxc_driver_t struct typedef to virLXCDriver to more
closely follow normal libvirt naming conventions

Signed-off-by: Daniel P. Berrange <berrange redhat com>
---
 src/lxc/lxc_conf.c    |    4 +-
 src/lxc/lxc_conf.h    |   14 ++++---
 src/lxc/lxc_driver.c  |  101 ++++++++++++++++++++++++-------------------------
 src/lxc/lxc_process.c |   37 +++++++++---------
 src/lxc/lxc_process.h |   18 ++++-----
 5 files changed, 88 insertions(+), 86 deletions(-)

diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c
index 72547c4..49a6958 100644
--- a/src/lxc/lxc_conf.c
+++ b/src/lxc/lxc_conf.c
@@ -49,7 +49,7 @@ static int lxcDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
 
 
 /* Functions */
-virCapsPtr lxcCapsInit(lxc_driver_t *driver)
+virCapsPtr lxcCapsInit(virLXCDriverPtr driver)
 {
     struct utsname utsname;
     virCapsPtr caps;
@@ -156,7 +156,7 @@ error:
     return NULL;
 }
 
-int lxcLoadDriverConfig(lxc_driver_t *driver)
+int lxcLoadDriverConfig(virLXCDriverPtr driver)
 {
     char *filename;
     virConfPtr conf;
diff --git a/src/lxc/lxc_conf.h b/src/lxc/lxc_conf.h
index 937da16..a771cb5 100644
--- a/src/lxc/lxc_conf.h
+++ b/src/lxc/lxc_conf.h
@@ -43,8 +43,10 @@
 # define LXC_LOG_DIR LOCALSTATEDIR "/log/libvirt/lxc"
 # define LXC_AUTOSTART_DIR LXC_CONFIG_DIR "/autostart"
 
-typedef struct __lxc_driver lxc_driver_t;
-struct __lxc_driver {
+typedef struct _virLXCDriver virLXCDriver;
+typedef virLXCDriver *virLXCDriverPtr;
+
+struct _virLXCDriver {
     virMutex lock;
 
     virCapsPtr caps;
@@ -71,18 +73,18 @@ struct __lxc_driver {
     virHashTablePtr autodestroy;
 };
 
-int lxcLoadDriverConfig(lxc_driver_t *driver);
-virCapsPtr lxcCapsInit(lxc_driver_t *driver);
+int lxcLoadDriverConfig(virLXCDriverPtr driver);
+virCapsPtr lxcCapsInit(virLXCDriverPtr driver);
 
 # define lxcError(code, ...)                                             \
     virReportErrorHelper(VIR_FROM_LXC, code, __FILE__,                   \
                          __FUNCTION__, __LINE__, __VA_ARGS__)
 
-static inline void lxcDriverLock(lxc_driver_t *driver)
+static inline void lxcDriverLock(virLXCDriverPtr driver)
 {
     virMutexLock(&driver->lock);
 }
-static inline void lxcDriverUnlock(lxc_driver_t *driver)
+static inline void lxcDriverUnlock(virLXCDriverPtr driver)
 {
     virMutexUnlock(&driver->lock);
 }
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 3807cee..80933f4 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -72,11 +72,10 @@
 
 static int lxcStartup(int privileged);
 static int lxcShutdown(void);
-static lxc_driver_t *lxc_driver = NULL;
+static virLXCDriverPtr lxc_driver = NULL;
 
 /* Functions */
 
-
 static virDrvOpenStatus lxcOpen(virConnectPtr conn,
                                 virConnectAuthPtr auth ATTRIBUTE_UNUSED,
                                 unsigned int flags)
@@ -123,7 +122,7 @@ static virDrvOpenStatus lxcOpen(virConnectPtr conn,
 
 static int lxcClose(virConnectPtr conn)
 {
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
 
     lxcDriverLock(driver);
     virLXCProcessAutoDestroyRun(driver, conn);
@@ -155,7 +154,7 @@ static int lxcIsAlive(virConnectPtr conn ATTRIBUTE_UNUSED)
 
 
 static char *lxcGetCapabilities(virConnectPtr conn) {
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
     char *xml;
 
     lxcDriverLock(driver);
@@ -170,7 +169,7 @@ static char *lxcGetCapabilities(virConnectPtr conn) {
 static virDomainPtr lxcDomainLookupByID(virConnectPtr conn,
                                         int id)
 {
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
     virDomainObjPtr vm;
     virDomainPtr dom = NULL;
 
@@ -197,7 +196,7 @@ cleanup:
 static virDomainPtr lxcDomainLookupByUUID(virConnectPtr conn,
                                           const unsigned char *uuid)
 {
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
     virDomainObjPtr vm;
     virDomainPtr dom = NULL;
 
@@ -226,7 +225,7 @@ cleanup:
 static virDomainPtr lxcDomainLookupByName(virConnectPtr conn,
                                           const char *name)
 {
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
     virDomainObjPtr vm;
     virDomainPtr dom = NULL;
 
@@ -252,7 +251,7 @@ cleanup:
 
 static int lxcDomainIsActive(virDomainPtr dom)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr obj;
     int ret = -1;
 
@@ -277,7 +276,7 @@ cleanup:
 
 static int lxcDomainIsPersistent(virDomainPtr dom)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr obj;
     int ret = -1;
 
@@ -301,7 +300,7 @@ cleanup:
 
 static int lxcDomainIsUpdated(virDomainPtr dom)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr obj;
     int ret = -1;
 
@@ -324,7 +323,7 @@ cleanup:
 }
 
 static int lxcListDomains(virConnectPtr conn, int *ids, int nids) {
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
     int n;
 
     lxcDriverLock(driver);
@@ -335,7 +334,7 @@ static int lxcListDomains(virConnectPtr conn, int *ids, int nids) {
 }
 
 static int lxcNumDomains(virConnectPtr conn) {
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
     int n;
 
     lxcDriverLock(driver);
@@ -347,7 +346,7 @@ static int lxcNumDomains(virConnectPtr conn) {
 
 static int lxcListDefinedDomains(virConnectPtr conn,
                                  char **const names, int nnames) {
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
     int n;
 
     lxcDriverLock(driver);
@@ -359,7 +358,7 @@ static int lxcListDefinedDomains(virConnectPtr conn,
 
 
 static int lxcNumDefinedDomains(virConnectPtr conn) {
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
     int n;
 
     lxcDriverLock(driver);
@@ -373,7 +372,7 @@ static int lxcNumDefinedDomains(virConnectPtr conn) {
 
 static virDomainPtr lxcDomainDefine(virConnectPtr conn, const char *xml)
 {
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
     virDomainDefPtr def = NULL;
     virDomainObjPtr vm = NULL;
     virDomainPtr dom = NULL;
@@ -434,7 +433,7 @@ cleanup:
 static int lxcDomainUndefineFlags(virDomainPtr dom,
                                   unsigned int flags)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     virDomainEventPtr event = NULL;
     int ret = -1;
@@ -492,7 +491,7 @@ static int lxcDomainUndefine(virDomainPtr dom)
 static int lxcDomainGetInfo(virDomainPtr dom,
                             virDomainInfoPtr info)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     virCgroupPtr cgroup = NULL;
     int ret = -1, rc;
@@ -556,7 +555,7 @@ lxcDomainGetState(virDomainPtr dom,
                   int *reason,
                   unsigned int flags)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     int ret = -1;
 
@@ -585,7 +584,7 @@ cleanup:
 
 static char *lxcGetOSType(virDomainPtr dom)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     char *ret = NULL;
 
@@ -616,7 +615,7 @@ cleanup:
 static unsigned long long
 lxcDomainGetMaxMemory(virDomainPtr dom)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     unsigned long long ret = 0;
 
@@ -641,7 +640,7 @@ cleanup:
 }
 
 static int lxcDomainSetMaxMemory(virDomainPtr dom, unsigned long newmax) {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     int ret = -1;
 
@@ -673,7 +672,7 @@ cleanup:
 }
 
 static int lxcDomainSetMemory(virDomainPtr dom, unsigned long newmem) {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     virCgroupPtr cgroup = NULL;
     int ret = -1;
@@ -735,7 +734,7 @@ lxcDomainSetMemoryParameters(virDomainPtr dom,
                              int nparams,
                              unsigned int flags)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     int i;
     virCgroupPtr cgroup = NULL;
     virDomainObjPtr vm = NULL;
@@ -813,7 +812,7 @@ lxcDomainGetMemoryParameters(virDomainPtr dom,
                              int *nparams,
                              unsigned int flags)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     int i;
     virCgroupPtr cgroup = NULL;
     virDomainObjPtr vm = NULL;
@@ -909,7 +908,7 @@ cleanup:
 static char *lxcDomainGetXMLDesc(virDomainPtr dom,
                                  unsigned int flags)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     char *ret = NULL;
 
@@ -949,7 +948,7 @@ cleanup:
  */
 static int lxcDomainStartWithFlags(virDomainPtr dom, unsigned int flags)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     virDomainEventPtr event = NULL;
     int ret = -1;
@@ -1027,7 +1026,7 @@ static virDomainPtr
 lxcDomainCreateAndStart(virConnectPtr conn,
                         const char *xml,
                         unsigned int flags) {
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
     virDomainObjPtr vm = NULL;
     virDomainDefPtr def;
     virDomainPtr dom = NULL;
@@ -1090,7 +1089,7 @@ cleanup:
 
 static int lxcDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr seclabel)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     int ret = -1;
 
@@ -1149,7 +1148,7 @@ cleanup:
 static int lxcNodeGetSecurityModel(virConnectPtr conn,
                                    virSecurityModelPtr secmodel)
 {
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
     int ret = 0;
 
     lxcDriverLock(driver);
@@ -1190,7 +1189,7 @@ lxcDomainEventRegister(virConnectPtr conn,
                        void *opaque,
                        virFreeCallback freecb)
 {
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
     int ret;
 
     lxcDriverLock(driver);
@@ -1207,7 +1206,7 @@ static int
 lxcDomainEventDeregister(virConnectPtr conn,
                          virConnectDomainEventCallback callback)
 {
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
     int ret;
 
     lxcDriverLock(driver);
@@ -1228,7 +1227,7 @@ lxcDomainEventRegisterAny(virConnectPtr conn,
                           void *opaque,
                           virFreeCallback freecb)
 {
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
     int ret;
 
     lxcDriverLock(driver);
@@ -1247,7 +1246,7 @@ static int
 lxcDomainEventDeregisterAny(virConnectPtr conn,
                             int callbackID)
 {
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
     int ret;
 
     lxcDriverLock(driver);
@@ -1273,7 +1272,7 @@ static int
 lxcDomainDestroyFlags(virDomainPtr dom,
                       unsigned int flags)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     virDomainEventPtr event = NULL;
     int ret = -1;
@@ -1346,7 +1345,7 @@ static int lxcCheckNetNsSupport(void)
 
 
 static int
-lxcSecurityInit(lxc_driver_t *driver)
+lxcSecurityInit(virLXCDriverPtr driver)
 {
     VIR_INFO("lxcSecurityInit %s", driver->securityDriverName);
     virSecurityManagerPtr mgr = virSecurityManagerNew(driver->securityDriverName,
@@ -1473,7 +1472,7 @@ cleanup:
 
 static void lxcNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque)
 {
-    lxc_driver_t *driver = opaque;
+    virLXCDriverPtr driver = opaque;
 
     if (newVM) {
         virDomainEventPtr event =
@@ -1601,7 +1600,7 @@ cleanup:
 }
 
 
-static bool lxcCgroupControllerActive(lxc_driver_t *driver,
+static bool lxcCgroupControllerActive(virLXCDriverPtr driver,
                                       int controller)
 {
     if (driver->cgroup == NULL)
@@ -1622,7 +1621,7 @@ static bool lxcCgroupControllerActive(lxc_driver_t *driver,
 static char *lxcGetSchedulerType(virDomainPtr domain,
                                  int *nparams)
 {
-    lxc_driver_t *driver = domain->conn->privateData;
+    virLXCDriverPtr driver = domain->conn->privateData;
     char *ret = NULL;
     int rc;
 
@@ -1732,7 +1731,7 @@ lxcSetSchedulerParametersFlags(virDomainPtr dom,
                                int nparams,
                                unsigned int flags)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     int i;
     virCgroupPtr group = NULL;
     virDomainObjPtr vm = NULL;
@@ -1872,7 +1871,7 @@ lxcGetSchedulerParametersFlags(virDomainPtr dom,
                                int *nparams,
                                unsigned int flags)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virCgroupPtr group = NULL;
     virDomainObjPtr vm = NULL;
     virDomainDefPtr persistentDef;
@@ -1992,7 +1991,7 @@ lxcDomainSetBlkioParameters(virDomainPtr dom,
                             int nparams,
                             unsigned int flags)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     int i;
     virCgroupPtr group = NULL;
     virDomainObjPtr vm = NULL;
@@ -2093,7 +2092,7 @@ lxcDomainGetBlkioParameters(virDomainPtr dom,
                             int *nparams,
                             unsigned int flags)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     int i;
     virCgroupPtr group = NULL;
     virDomainObjPtr vm = NULL;
@@ -2198,7 +2197,7 @@ lxcDomainInterfaceStats(virDomainPtr dom,
                         const char *path,
                         struct _virDomainInterfaceStats *stats)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     int i;
     int ret = -1;
@@ -2254,7 +2253,7 @@ lxcDomainInterfaceStats(virDomainPtr dom,
 
 static int lxcDomainGetAutostart(virDomainPtr dom,
                                    int *autostart) {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     int ret = -1;
 
@@ -2281,7 +2280,7 @@ cleanup:
 
 static int lxcDomainSetAutostart(virDomainPtr dom,
                                    int autostart) {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     char *configFile = NULL, *autostartLink = NULL;
     int ret = -1;
@@ -2354,7 +2353,7 @@ cleanup:
     return ret;
 }
 
-static int lxcFreezeContainer(lxc_driver_t *driver, virDomainObjPtr vm)
+static int lxcFreezeContainer(virLXCDriverPtr driver, virDomainObjPtr vm)
 {
     int timeout = 1000; /* In milliseconds */
     int check_interval = 1; /* In milliseconds */
@@ -2449,7 +2448,7 @@ cleanup:
 
 static int lxcDomainSuspend(virDomainPtr dom)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     virDomainEventPtr event = NULL;
     int ret = -1;
@@ -2497,7 +2496,7 @@ cleanup:
     return ret;
 }
 
-static int lxcUnfreezeContainer(lxc_driver_t *driver, virDomainObjPtr vm)
+static int lxcUnfreezeContainer(virLXCDriverPtr driver, virDomainObjPtr vm)
 {
     int ret;
     virCgroupPtr cgroup = NULL;
@@ -2514,7 +2513,7 @@ static int lxcUnfreezeContainer(lxc_driver_t *driver, virDomainObjPtr vm)
 
 static int lxcDomainResume(virDomainPtr dom)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     virDomainEventPtr event = NULL;
     int ret = -1;
@@ -2569,7 +2568,7 @@ lxcDomainOpenConsole(virDomainPtr dom,
                       virStreamPtr st,
                       unsigned int flags)
 {
-    lxc_driver_t *driver = dom->conn->privateData;
+    virLXCDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm = NULL;
     char uuidstr[VIR_UUID_STRING_BUFLEN];
     int ret = -1;
@@ -2638,7 +2637,7 @@ lxcListAllDomains(virConnectPtr conn,
                   virDomainPtr **domains,
                   unsigned int flags)
 {
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
     int ret = -1;
 
     virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, -1);
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index 86895a4..90830b4 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -48,7 +48,7 @@
 
 #define START_POSTFIX ": starting up\n"
 
-int virLXCProcessAutoDestroyInit(lxc_driver_t *driver)
+int virLXCProcessAutoDestroyInit(virLXCDriverPtr driver)
 {
     if (!(driver->autodestroy = virHashCreate(5, NULL)))
         return -1;
@@ -57,7 +57,7 @@ int virLXCProcessAutoDestroyInit(lxc_driver_t *driver)
 }
 
 struct virLXCProcessAutoDestroyData {
-    lxc_driver_t *driver;
+    virLXCDriverPtr driver;
     virConnectPtr conn;
 };
 
@@ -108,7 +108,7 @@ static void virLXCProcessAutoDestroyDom(void *payload,
 /*
  * Precondition: driver is locked
  */
-void virLXCProcessAutoDestroyRun(lxc_driver_t *driver, virConnectPtr conn)
+void virLXCProcessAutoDestroyRun(virLXCDriverPtr driver, virConnectPtr conn)
 {
     struct virLXCProcessAutoDestroyData data = {
         driver, conn
@@ -117,12 +117,12 @@ void virLXCProcessAutoDestroyRun(lxc_driver_t *driver, virConnectPtr conn)
     virHashForEach(driver->autodestroy, virLXCProcessAutoDestroyDom, &data);
 }
 
-void virLXCProcessAutoDestroyShutdown(lxc_driver_t *driver)
+void virLXCProcessAutoDestroyShutdown(virLXCDriverPtr driver)
 {
     virHashFree(driver->autodestroy);
 }
 
-int virLXCProcessAutoDestroyAdd(lxc_driver_t *driver,
+int virLXCProcessAutoDestroyAdd(virLXCDriverPtr driver,
                                 virDomainObjPtr vm,
                                 virConnectPtr conn)
 {
@@ -134,7 +134,7 @@ int virLXCProcessAutoDestroyAdd(lxc_driver_t *driver,
     return 0;
 }
 
-int virLXCProcessAutoDestroyRemove(lxc_driver_t *driver,
+int virLXCProcessAutoDestroyRemove(virLXCDriverPtr driver,
                                    virDomainObjPtr vm)
 {
     char uuidstr[VIR_UUID_STRING_BUFLEN];
@@ -155,7 +155,7 @@ int virLXCProcessAutoDestroyRemove(lxc_driver_t *driver,
  * Cleanout resources associated with the now dead VM
  *
  */
-static void virLXCProcessCleanup(lxc_driver_t *driver,
+static void virLXCProcessCleanup(virLXCDriverPtr driver,
                                  virDomainObjPtr vm,
                                  virDomainShutoffReason reason)
 {
@@ -300,7 +300,7 @@ static int virLXCProcessSetupInterfaceDirect(virConnectPtr conn,
 {
     int ret = 0;
     char *res_ifname = NULL;
-    lxc_driver_t *driver = conn->privateData;
+    virLXCDriverPtr driver = conn->privateData;
     virNetDevBandwidthPtr bw;
     virNetDevVPortProfilePtr prof;
 
@@ -472,7 +472,7 @@ cleanup:
 }
 
 
-static int virLXCProcessMonitorClient(lxc_driver_t * driver,
+static int virLXCProcessMonitorClient(virLXCDriverPtr  driver,
                                       virDomainObjPtr vm)
 {
     char *sockpath = NULL;
@@ -529,7 +529,7 @@ error:
 }
 
 
-int virLXCProcessStop(lxc_driver_t *driver,
+int virLXCProcessStop(virLXCDriverPtr driver,
                       virDomainObjPtr vm,
                       virDomainShutoffReason reason)
 {
@@ -581,13 +581,13 @@ cleanup:
     return rc;
 }
 
-extern lxc_driver_t *lxc_driver;
+extern virLXCDriverPtr lxc_driver;
 static void virLXCProcessMonitorEvent(int watch,
                                       int fd,
                                       int events ATTRIBUTE_UNUSED,
                                       void *data)
 {
-    lxc_driver_t *driver = lxc_driver;
+    virLXCDriverPtr driver = lxc_driver;
     virDomainObjPtr vm = data;
     virDomainEventPtr event = NULL;
     lxcDomainObjPrivatePtr priv;
@@ -628,7 +628,7 @@ cleanup:
 
 
 static virCommandPtr
-virLXCProcessBuildControllerCmd(lxc_driver_t *driver,
+virLXCProcessBuildControllerCmd(virLXCDriverPtr driver,
                                 virDomainObjPtr vm,
                                 int nveths,
                                 char **veths,
@@ -789,7 +789,7 @@ cleanup:
  * Returns 0 on success or -1 in case of error
  */
 int virLXCProcessStart(virConnectPtr conn,
-                       lxc_driver_t * driver,
+                       virLXCDriverPtr  driver,
                        virDomainObjPtr vm,
                        bool autoDestroy,
                        virDomainRunningReason reason)
@@ -1119,7 +1119,7 @@ error:
 }
 
 struct virLXCAutostartData {
-    lxc_driver_t *driver;
+    virLXCDriverPtr driver;
     virConnectPtr conn;
 };
 
@@ -1154,7 +1154,8 @@ virLXCProcessAutostartDomain(void *payload, const void *name ATTRIBUTE_UNUSED, v
 
 
 void
-virLXCProcessAutostartAll(lxc_driver_t *driver) {
+virLXCProcessAutostartAll(virLXCDriverPtr driver)
+{
     /* XXX: Figure out a better way todo this. The domain
      * startup code needs a connection handle in order
      * to lookup the bridge associated with a virtual
@@ -1177,7 +1178,7 @@ static void
 virLXCProcessReconnectDomain(void *payload, const void *name ATTRIBUTE_UNUSED, void *opaque)
 {
     virDomainObjPtr vm = payload;
-    lxc_driver_t *driver = opaque;
+    virLXCDriverPtr driver = opaque;
     lxcDomainObjPrivatePtr priv;
 
     virDomainObjLock(vm);
@@ -1234,7 +1235,7 @@ error:
 }
 
 
-int virLXCProcessReconnectAll(lxc_driver_t *driver,
+int virLXCProcessReconnectAll(virLXCDriverPtr driver,
                               virDomainObjListPtr doms)
 {
     virHashForEach(doms->objs, virLXCProcessReconnectDomain, driver);
diff --git a/src/lxc/lxc_process.h b/src/lxc/lxc_process.h
index eece8ad..ea7de96 100644
--- a/src/lxc/lxc_process.h
+++ b/src/lxc/lxc_process.h
@@ -25,26 +25,26 @@
 # include "lxc_conf.h"
 
 int virLXCProcessStart(virConnectPtr conn,
-                       lxc_driver_t * driver,
+                       virLXCDriverPtr  driver,
                        virDomainObjPtr vm,
                        bool autoDestroy,
                        virDomainRunningReason reason);
-int virLXCProcessStop(lxc_driver_t *driver,
+int virLXCProcessStop(virLXCDriverPtr driver,
                       virDomainObjPtr vm,
                       virDomainShutoffReason reason);
 
-int virLXCProcessAutoDestroyInit(lxc_driver_t *driver);
-void virLXCProcessAutoDestroyRun(lxc_driver_t *driver,
+int virLXCProcessAutoDestroyInit(virLXCDriverPtr driver);
+void virLXCProcessAutoDestroyRun(virLXCDriverPtr driver,
                                  virConnectPtr conn);
-void virLXCProcessAutoDestroyShutdown(lxc_driver_t *driver);
-int virLXCProcessAutoDestroyAdd(lxc_driver_t *driver,
+void virLXCProcessAutoDestroyShutdown(virLXCDriverPtr driver);
+int virLXCProcessAutoDestroyAdd(virLXCDriverPtr driver,
                                 virDomainObjPtr vm,
                                 virConnectPtr conn);
-int virLXCProcessAutoDestroyRemove(lxc_driver_t *driver,
+int virLXCProcessAutoDestroyRemove(virLXCDriverPtr driver,
                                    virDomainObjPtr vm);
 
-void virLXCProcessAutostartAll(lxc_driver_t *driver);
-int virLXCProcessReconnectAll(lxc_driver_t *driver,
+void virLXCProcessAutostartAll(virLXCDriverPtr driver);
+int virLXCProcessReconnectAll(virLXCDriverPtr driver,
                               virDomainObjListPtr doms);
 
 #endif /* __LXC_PROCESS_H__ */
-- 
1.7.10.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]