Signed-off-by: Maxim Nestratov <mnestra...@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;
-- 
1.7.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to