[ovs-dev] tap: flag as present after opening it.

Message ID 20180607141017.29865-1-fbl@redhat.com
State Accepted
Headers show
Series
  • [ovs-dev] tap: flag as present after opening it.
Related show

Commit Message

Flavio Leitner June 7, 2018, 2:10 p.m.
Assume the device is present if it can be opened.

Reported-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Flavio Leitner <fbl@redhat.com>
---
 lib/netdev-linux.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Eelco Chaudron June 7, 2018, 2:34 p.m. | #1
On 07/06/18 16:10, Flavio Leitner wrote:
> Assume the device is present if it can be opened.
>
> Reported-by: Eelco Chaudron <echaudro@redhat.com>
> Signed-off-by: Flavio Leitner <fbl@redhat.com>
> ---
>   lib/netdev-linux.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
> index d19bd86ac..d2b79e569 100644
> --- a/lib/netdev-linux.c
> +++ b/lib/netdev-linux.c
> @@ -940,6 +940,7 @@ netdev_linux_construct_tap(struct netdev *netdev_)
>           goto error_close;
>       }
>   
> +    netdev->present = true;
>       return 0;
>   
>   error_close:

Acked-by: Eelco Chaudron <echaudro@redhat.com>
Tested-by: Eelco Chaudron <echaudro@redhat.com>
Ben Pfaff June 14, 2018, 11:50 p.m. | #2
On Thu, Jun 07, 2018 at 04:34:02PM +0200, Eelco Chaudron wrote:
> On 07/06/18 16:10, Flavio Leitner wrote:
> >Assume the device is present if it can be opened.
> >
> >Reported-by: Eelco Chaudron <echaudro@redhat.com>
> >Signed-off-by: Flavio Leitner <fbl@redhat.com>
> >---
> >  lib/netdev-linux.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> >diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
> >index d19bd86ac..d2b79e569 100644
> >--- a/lib/netdev-linux.c
> >+++ b/lib/netdev-linux.c
> >@@ -940,6 +940,7 @@ netdev_linux_construct_tap(struct netdev *netdev_)
> >          goto error_close;
> >      }
> >+    netdev->present = true;
> >      return 0;
> >  error_close:
> 
> Acked-by: Eelco Chaudron <echaudro@redhat.com>
> Tested-by: Eelco Chaudron <echaudro@redhat.com>

Thanks, Flavio (and Eelco).  I applied this to master.

Patch

diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index d19bd86ac..d2b79e569 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -940,6 +940,7 @@  netdev_linux_construct_tap(struct netdev *netdev_)
         goto error_close;
     }
 
+    netdev->present = true;
     return 0;
 
 error_close: