Just found out that I lost one necessary chunk of code, which appeared
to be in a separate commit I didn't send. Sorry for that.
Should I resend the whole series or this letter is enough?
diff --git a/src/parallels/parallels_network.c
b/src/parallels/parallels_network.c
index 45d1e4c..efa6da2 100644
--- a/src/parallels/parallels_network.c
+++ b/src/parallels/parallels_network.c
@@ -263,7 +263,7 @@ parallelsAddRoutedNetwork(parallelsConnPtr privconn)
def->forward.type = VIR_NETWORK_FORWARD_ROUTE;
- if (VIR_STRDUP(def->name, PARALLELS_ROUTED_NETWORK_NAME) < 0)
+ if (VIR_STRDUP(def->name, PARALLELS_DOMAIN_ROUTED_NETWORK_NAME) < 0)
goto cleanup;
if (virUUIDParse(PARALLELS_ROUTED_NETWORK_UUID, def->uuid) < 0) {
03.03.2015 23:32, Maxim Nestratov пишет:
Signed-off-by: Maxim Nestratov <mnestratov(a)parallels.com>
---
src/parallels/parallels_network.c | 4 ++--
src/parallels/parallels_sdk.c | 6 +++---
src/parallels/parallels_utils.h | 8 +++++++-
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/parallels/parallels_network.c b/src/parallels/parallels_network.c
index 3e7087d..2c793c1 100644
--- a/src/parallels/parallels_network.c
+++ b/src/parallels/parallels_network.c
@@ -211,12 +211,12 @@ parallelsLoadNetwork(parallelsConnPtr privconn, virJSONValuePtr
jobj)
goto cleanup;
}
- if (STREQ(tmp, "bridged")) {
+ if (STREQ(tmp, PARALLELS_BRIDGED_NETWORK_TYPE)) {
def->forward.type = VIR_NETWORK_FORWARD_BRIDGE;
if (parallelsGetBridgedNetInfo(def, jobj) < 0)
goto cleanup;
- } else if (STREQ(tmp, "host-only")) {
+ } else if (STREQ(tmp, PARALLELS_HOSTONLY_NETWORK_TYPE)) {
def->forward.type = VIR_NETWORK_FORWARD_NONE;
if (parallelsGetHostOnlyNetInfo(def, def->name) < 0)
diff --git a/src/parallels/parallels_sdk.c b/src/parallels/parallels_sdk.c
index 0c9837a..83af020 100644
--- a/src/parallels/parallels_sdk.c
+++ b/src/parallels/parallels_sdk.c
@@ -709,7 +709,7 @@ prlsdkGetNetInfo(PRL_HANDLE netAdapter, virDomainNetDefPtr net, bool
isCt)
* always up */
net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP;
if (VIR_STRDUP(net->data.network.name,
- PARALLELS_ROUTED_NETWORK_NAME) < 0)
+ PARALLELS_DOMAIN_ROUTED_NETWORK_NAME) < 0)
goto cleanup;
return 0;
}
@@ -728,7 +728,7 @@ prlsdkGetNetInfo(PRL_HANDLE netAdapter, virDomainNetDefPtr net, bool
isCt)
if (emulatedType == PNA_ROUTED) {
if (VIR_STRDUP(net->data.network.name,
- PARALLELS_ROUTED_NETWORK_NAME) < 0)
+ PARALLELS_DOMAIN_ROUTED_NETWORK_NAME) < 0)
goto cleanup;
} else {
pret = PrlVmDevNet_GetVirtualNetworkId(netAdapter, NULL, &buflen);
@@ -2649,8 +2649,8 @@ static int prlsdkAddNet(PRL_HANDLE sdkdom, virDomainNetDefPtr net)
pret = PrlVmDevNet_SetMacAddress(sdknet, macstr);
prlsdkCheckRetGoto(pret, cleanup);
- if (STREQ(net->data.network.name, PARALLELS_ROUTED_NETWORK_NAME)) {
pret = PrlVmDev_SetEmulatedType(sdknet, PNA_ROUTED);
+ if (STREQ(net->data.network.name, PARALLELS_DOMAIN_ROUTED_NETWORK_NAME)) {
prlsdkCheckRetGoto(pret, cleanup);
} else {
pret = PrlVmDevNet_SetVirtualNetworkId(sdknet, net->data.network.name);
diff --git a/src/parallels/parallels_utils.h b/src/parallels/parallels_utils.h
index bebf841..63fe78f 100644
--- a/src/parallels/parallels_utils.h
+++ b/src/parallels/parallels_utils.h
@@ -47,7 +47,13 @@
_("no domain with matching uuid '%s'"),
uuidstr); \
} while (0)
-# define PARALLELS_ROUTED_NETWORK_NAME "Routed"
+# 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 _parallelsConn {
virMutex lock;