Since the secondary drivers are only active when the primary
driver is also the Parallels driver, there is no need to use the
different type specific privateData fields. The object that was
being stored in the storagePrivateData can easily be kept in the
parallelsConn struct instead.
---
src/parallels/parallels_network.c | 2 --
src/parallels/parallels_storage.c | 12 ++++++------
src/parallels/parallels_utils.h | 1 +
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/parallels/parallels_network.c b/src/parallels/parallels_network.c
index f41c97f..90217df 100644
--- a/src/parallels/parallels_network.c
+++ b/src/parallels/parallels_network.c
@@ -328,8 +328,6 @@ parallelsNetworkOpen(virConnectPtr conn,
if (STRNEQ(conn->driver->name, "Parallels"))
return VIR_DRV_OPEN_DECLINED;
- conn->networkPrivateData = conn->privateData;
-
if (parallelsLoadNetworks(conn->privateData) < 0)
return VIR_DRV_OPEN_DECLINED;
diff --git a/src/parallels/parallels_storage.c b/src/parallels/parallels_storage.c
index 53bcfcb..e1b6ea8 100644
--- a/src/parallels/parallels_storage.c
+++ b/src/parallels/parallels_storage.c
@@ -72,8 +72,8 @@ parallelsStorageClose(virConnectPtr conn)
{
parallelsConnPtr privconn = conn->privateData;
- virStorageDriverStatePtr storageState = conn->storagePrivateData;
- conn->storagePrivateData = NULL;
+ virStorageDriverStatePtr storageState = conn->privateData->storageState;
+ conn->privateData->storageState = NULL;
parallelsStorageLock(storageState);
virStoragePoolObjListFree(&privconn->pools);
@@ -189,7 +189,7 @@ parallelsPoolCreateByPath(virConnectPtr conn, const char *path)
if (!(pool = virStoragePoolObjAssignDef(pools, def)))
goto error;
- if (virStoragePoolObjSaveDef(conn->storagePrivateData, pool, def) < 0) {
+ if (virStoragePoolObjSaveDef(conn->privateData->storageState, pool, def) <
0) {
virStoragePoolObjRemove(pools, pool);
goto error;
}
@@ -404,7 +404,7 @@ parallelsPoolsAdd(virDomainObjPtr dom,
static int parallelsLoadPools(virConnectPtr conn)
{
parallelsConnPtr privconn = conn->privateData;
- virStorageDriverStatePtr storageState = conn->storagePrivateData;
+ virStorageDriverStatePtr storageState = conn->privateData->storageState;
char *base = NULL;
size_t i;
@@ -475,7 +475,7 @@ parallelsStorageOpen(virConnectPtr conn,
return VIR_DRV_OPEN_ERROR;
}
- conn->storagePrivateData = storageState;
+ conn->privateData->storageState = storageState;
parallelsStorageLock(storageState);
if (parallelsLoadPools(conn))
@@ -728,7 +728,7 @@ parallelsStoragePoolDefineXML(virConnectPtr conn,
if (!(pool = virStoragePoolObjAssignDef(&privconn->pools, def)))
goto cleanup;
- if (virStoragePoolObjSaveDef(conn->storagePrivateData, pool, def) < 0) {
+ if (virStoragePoolObjSaveDef(conn->privateData->storageState, pool, def) <
0) {
virStoragePoolObjRemove(&privconn->pools, pool);
def = NULL;
goto cleanup;
diff --git a/src/parallels/parallels_utils.h b/src/parallels/parallels_utils.h
index aef590f..0d770c5 100644
--- a/src/parallels/parallels_utils.h
+++ b/src/parallels/parallels_utils.h
@@ -49,6 +49,7 @@ struct _parallelsConn {
virCapsPtr caps;
virDomainXMLOptionPtr xmlopt;
virObjectEventStatePtr domainEventState;
+ virStorageDriverStatePtr storageState;
};
typedef struct _parallelsConn parallelsConn;
--
2.1.0