]> xenbits.xensource.com Git - libvirt.git/commitdiff
lxc: Don't shadow global symbol "link"
authorPeter Krempa <pkrempa@redhat.com>
Fri, 14 Feb 2014 12:46:35 +0000 (13:46 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 14 Feb 2014 13:01:45 +0000 (14:01 +0100)
Yet another variable name frowned upon by older compilers. Introduced in
commit b73c029d.

src/lxc/lxc_native.c

index 2cf479dc748c288c6020a942d9ee6b779651f10e..663e29c1ec51137802cd8f6a6f9ffa9ffa1b3eb0 100644 (file)
@@ -334,7 +334,7 @@ lxcFstabWalkCallback(const char* name, virConfValuePtr value, void * data)
 
 static virDomainNetDefPtr
 lxcCreateNetDef(const char *type,
-                const char *link,
+                const char *linkdev,
                 const char *mac,
                 const char *flag,
                 const char *macvlanmode)
@@ -357,18 +357,18 @@ lxcCreateNetDef(const char *type,
         net->mac = macAddr;
 
     if (STREQ(type, "veth")) {
-        if (!link)
+        if (!linkdev)
             goto error;
 
         net->type = VIR_DOMAIN_NET_TYPE_BRIDGE;
 
-        if (VIR_STRDUP(net->data.bridge.brname, link) < 0)
+        if (VIR_STRDUP(net->data.bridge.brname, linkdev) < 0)
             goto error;
 
     } else if (STREQ(type, "macvlan")) {
         net->type = VIR_DOMAIN_NET_TYPE_DIRECT;
 
-        if (!link || VIR_STRDUP(net->data.direct.linkdev, link) < 0)
+        if (!linkdev || VIR_STRDUP(net->data.direct.linkdev, linkdev) < 0)
             goto error;
 
         if (!macvlanmode || STREQ(macvlanmode, "private"))
@@ -411,7 +411,7 @@ lxcCreateHostdevDef(int mode, int type, const char *data)
 static int
 lxcAddNetworkDefinition(virDomainDefPtr def,
                         const char *type,
-                        const char *link,
+                        const char *linkdev,
                         const char *mac,
                         const char *flag,
                         const char *macvlanmode,
@@ -428,14 +428,14 @@ lxcAddNetworkDefinition(virDomainDefPtr def,
     isPhys = STREQ(type, "phys");
     isVlan = STREQ(type, "vlan");
     if (type != NULL && (isPhys || isVlan)) {
-        if (!link) {
+        if (!linkdev) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                            _("Missing 'link' attribute for NIC"));
             goto error;
         }
         if (!(hostdev = lxcCreateHostdevDef(VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES,
                                             VIR_DOMAIN_HOSTDEV_CAPS_TYPE_NET,
-                                            link)))
+                                            linkdev)))
             goto error;
 
         /* This still requires the user to manually setup the vlan interface
@@ -443,7 +443,7 @@ lxcAddNetworkDefinition(virDomainDefPtr def,
         if (isVlan && vlanid) {
             VIR_FREE(hostdev->source.caps.u.net.iface);
             if (virAsprintf(&hostdev->source.caps.u.net.iface,
-                            "%s.%s", link, vlanid) < 0)
+                            "%s.%s", linkdev, vlanid) < 0)
                 goto error;
         }
 
@@ -451,7 +451,7 @@ lxcAddNetworkDefinition(virDomainDefPtr def,
             goto error;
         def->hostdevs[def->nhostdevs - 1] = hostdev;
     } else {
-        if (!(net = lxcCreateNetDef(type, link, mac, flag, macvlanmode)))
+        if (!(net = lxcCreateNetDef(type, linkdev, mac, flag, macvlanmode)))
             goto error;
 
         if (VIR_EXPAND_N(def->nets, def->nnets, 1) < 0)