vhost-vdpa: Add qemu_close in vhost_vdpa_cleanup
PATCH v2 1/2 vhost-vdpa: Add qemu_close in vhost_vdpa_cleanup
fix the bug that fd will still open after the cleanup
Signed-off-by Cindy Lu <[email protected]>
--- net/vhost-vdpa.c | 4 ++++ 1 file changed, 4 insertions(+)
net/vhost-vdpa.c +4 -0
@@ -144,6 +144,10 @@ static void vhost_vdpa_cleanup(NetClientState *nc)g_free (s->vhost_net); s->vhost_net =NULL ; } +if (s->vhost_vdpa.device_fd >=0 ) { +qemu_close (s->vhost_vdpa.device_fd); + s->vhost_vdpa.device_fd =-1 ; + } }static bool vhost_vdpa_has_vnet_hdr (NetClientState *nc)
Signature · 1 line
2.21.3
PATCH v2 2/2 net: Add vhost-vdpa in show_netdevs()
Fix the bug that while Check qemu supported netdev, there is no vhost-vdpa
Signed-off-by Cindy Lu <[email protected]>
--- net/net.c | 3 +++ 1 file changed, 3 insertions(+)
net/net.c +3 -0
@@ -1049,6 +1049,9 @@ static void show_netdevs(void)#endif #ifdef CONFIG_POSIX "vhost-user", +#endif +#ifdef CONFIG_VHOST_VDPA + "vhost-vdpa",#endif };
Signature · 1 line
2.21.3
Re: [PATCH v2 2/2] net: Add vhost-vdpa in show_netdevs()
Quoted 13 lines · Cindy Lu
Fix the bug that while Check qemu supported netdev, there is no vhost-vdpa
Signed-off-by Cindy Lu <[email protected]>--- net/net.c | 3 +++ 1 file changed, 3 insertions(+)net/net.c +0
-0
net/net.c static void show_netdevs(void) · line 1056
Quoted 8 lines
net/net.c +3
-0@@ -1049,6 +1049,9 @@ static void show_netdevs(void)#endif #ifdef CONFIG_POSIX "vhost-user", +#endif +#ifdef CONFIG_VHOST_VDPA + "vhost-vdpa",#endif };
Acked-by Jason Wang <[email protected]>
Quoted 1 line
Quoted 12 lines · Cindy Lu
fix the bug that fd will still open after the cleanup
Signed-off-by Cindy Lu <[email protected]>--- net/vhost-vdpa.c | 4 ++++ 1 file changed, 4 insertions(+)net/vhost-vdpa.c +0
-0
net/vhost-vdpa.c static void vhost_vdpa_cleanup(NetClientState *nc) · line 153
Quoted 10 lines
net/vhost-vdpa.c +4
-0@@ -144,6 +144,10 @@ static void vhost_vdpa_cleanup(NetClientState *nc)g_free (s->vhost_net); s->vhost_net =NULL ; } +if (s->vhost_vdpa.device_fd >=0 ) { +qemu_close (s->vhost_vdpa.device_fd); + s->vhost_vdpa.device_fd =-1 ; + } }static bool vhost_vdpa_has_vnet_hdr (NetClientState *nc)
Acked-by Jason Wang <[email protected]>