]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: minor comment/formatting changes to virNetDevTapCreate()
authorLaine Stump <laine@redhat.com>
Tue, 15 Dec 2020 20:14:45 +0000 (15:14 -0500)
committerLaine Stump <laine@redhat.com>
Thu, 17 Dec 2020 02:32:07 +0000 (21:32 -0500)
The comment about auto-generating names was obsoleted by recent
changes, and there was an unnecessary set of braces around a single
line conditional body.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virnetdevtap.c

index c305cd65c440d084560abb8a5caabfa5d6674d6a..0142d3dda51fa6b4ae8929912267d1674bf5b66c 100644 (file)
@@ -174,15 +174,14 @@ int virNetDevTapCreate(char **ifname,
     int ret = -1;
     int fd = -1;
 
-    /* if ifname is "vnet%d", then auto-generate a name for the new
+    /* if ifname is empty, then auto-generate a name for the new
      * device (the kernel could do this for us, but has a bad habit of
      * immediately re-using names that have just been released, which
-     * can lead to race conditions).
-     * if ifname is just a user-provided name, virNetDevGenerateName
-     * leaves it unchanged. */
-    if (virNetDevGenerateName(ifname, VIR_NET_DEV_GEN_NAME_VNET) < 0) {
+     * can lead to race conditions).  if ifname is just a
+     * user-provided name, virNetDevGenerateName leaves it
+     * unchanged. */
+    if (virNetDevGenerateName(ifname, VIR_NET_DEV_GEN_NAME_VNET) < 0)
         return -1;
-    }
 
     if (!tunpath)
         tunpath = "/dev/net/tun";