]> xenbits.xensource.com Git - libvirt.git/commitdiff
virnetdevtap: Clarify virNetDevTapCreate() behavior wrt VIR_NETDEV_TAP_CREATE_ALLOW_E...
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 23 Jan 2023 10:38:03 +0000 (11:38 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 23 Jan 2023 11:29:04 +0000 (12:29 +0100)
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 <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/util/virnetdevtap.c

index a4ead0ae93f150a3f3cb17e0df303d4b9f5dfbf0..2101d7847cd37c641680c6d5abd28a92d301e0d9 100644 (file)
@@ -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