]> xenbits.xensource.com Git - libvirt.git/commitdiff
ip link needs 'name' in 3.16 to create the veth pair
authorCédric Bosdonnat <cbosdonnat@suse.com>
Thu, 20 Nov 2014 14:26:35 +0000 (15:26 +0100)
committerCédric Bosdonnat <cbosdonnat@suse.com>
Tue, 25 Nov 2014 10:40:55 +0000 (11:40 +0100)
Due to a change (or bug?) in ip link implementation, the command
    'ip link add vnet0...'
is forced into
    'ip link add name vnet0...'
The changed command also works on older versions of iproute2, just the
'name' parameter has been made mandatory.

src/util/virnetdevveth.c

index e9d6f9c514d4e4566ea16f8277726b0136693a11..ad30e1d6a97639e283014b129083d1b8428347eb 100644 (file)
@@ -89,7 +89,7 @@ static int virNetDevVethGetFreeNum(int startDev)
  * @veth2: pointer to return name for container end of veth pair
  *
  * Creates a veth device pair using the ip command:
- * ip link add veth1 type veth peer name veth2
+ * ip link add name veth1 type veth peer name veth2
  * If veth1 points to NULL on entry, it will be a valid interface on
  * return.  veth2 should point to NULL on entry.
  *
@@ -146,7 +146,7 @@ int virNetDevVethCreate(char** veth1, char** veth2)
         }
 
         cmd = virCommandNew("ip");
-        virCommandAddArgList(cmd, "link", "add",
+        virCommandAddArgList(cmd, "link", "add", "name",
                              *veth1 ? *veth1 : veth1auto,
                              "type", "veth", "peer", "name",
                              *veth2 ? *veth2 : veth2auto,