1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-25 01:34:11 +03:00

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 <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Michal Privoznik 2023-01-23 11:38:03 +01:00
parent 57b0678590
commit af99d60dc8

View 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