From: Michal Privoznik Date: Mon, 23 Jan 2023 10:38:03 +0000 (+0100) Subject: virnetdevtap: Clarify virNetDevTapCreate() behavior wrt VIR_NETDEV_TAP_CREATE_ALLOW_E... X-Git-Tag: v9.1.0-rc1~225 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af99d60dc8e2135701a8d55267770ad2a5460953;p=thirdparty%2Flibvirt.git virnetdevtap: Clarify virNetDevTapCreate() behavior wrt VIR_NETDEV_TAP_CREATE_ALLOW_EXISTING The VIR_NETDEV_TAP_CREATE_ALLOW_EXISTING flag is documented as: /* The device is allowed to exist before creation */ VIR_NETDEV_TAP_CREATE_ALLOW_EXISTING = 1 << 4, and yet, the documentation to virNetDevTapCreate() documents its behavior when the flag is passed as: * VIR_NETDEV_TAP_CREATE_ALLOW_EXISTING * - The device creation fails if @ifname already exists Fortunately, the function is implemented so that it follows the expected behavior (i.e. the former flag documentation). Fix the function documentation then. Signed-off-by: Michal Privoznik Reviewed-by: Martin Kletzander --- diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index a4ead0ae93..2101d7847c 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -156,7 +156,7 @@ virNetDevTapGetRealDeviceName(char *ifname G_GNUC_UNUSED) * VIR_NETDEV_TAP_CREATE_PERSIST * - The device will persist after the file descriptor is closed * VIR_NETDEV_TAP_CREATE_ALLOW_EXISTING - * - The device creation fails if @ifname already exists + * - The device creation does not fail if @ifname already exists * * Creates a tap interface. The caller must use virNetDevTapDelete to * remove a persistent TAP device when it is no longer needed. In case