Skip to contentSkip to conversation

Added cleanup for Win32 TAP interface

PATCH Paolo Bonzini 4 participants 4 messages Apr 15, 2013 – Apr 16, 2013 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Il 13/03/2013 13:23, Pavel Dovgaluk ha scritto:

Quoted 3 lines

Added cleanup for Win32 TAP interface.

Stefan, did this slip?

Paolo

Quoted 41 lines
---
 net/tap-win32.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
net/tap-win32.c +4 -4
index 91e9e84..1c1176c 100644
@@ -99,6 +99,7 @@ typedef struct tap_win32_overlapped {
     HANDLE output_queue_semaphore;
     HANDLE free_list_semaphore;
     HANDLE tap_semaphore;
+    HANDLE hThread;
     CRITICAL_SECTION output_queue_cs;
     CRITICAL_SECTION free_list_cs;
     OVERLAPPED read_overlapped;
@@ -625,7 +626,7 @@ static int tap_win32_open(tap_win32_overlapped_t **phandle,
 
     *phandle = &tap_overlapped;
 
-    CreateThread(NULL, 0, tap_win32_thread_entry,
+    tap_overlapped.hThread = CreateThread(NULL, 0, tap_win32_thread_entry,
                  (LPVOID)&tap_overlapped, 0, &idThread);
     return 0;
 }
@@ -643,9 +644,8 @@ static void tap_cleanup(NetClientState *nc)
 
     qemu_del_wait_object(s->handle->tap_semaphore, NULL, NULL);
 
-    /* FIXME: need to kill thread and close file handle:
-       tap_win32_close(s);
-    */
+    TerminateThread(s->handle->hThread, 0);
+    CloseHandle(s->handle->handle);
 }
 
 static ssize_t tap_receive(NetClientState *nc, const uint8_t *buf, size_t size)
#2 lore raw

Am 15.04.2013 17:55, schrieb Paolo Bonzini:

Quoted 3 lines

Il 13/03/2013 13:23, Pavel Dovgaluk ha scritto:

Quoted 1 line

Added cleanup for Win32 TAP interface. Signed-off-by: Pavel Dovgalyuk<[email protected]>

Stefan, did this slip? Paolo

Yes, I had not noticed this patch before. But there was a comment from Stefan H. which is still unanswered. See

https://lists.gnu.org/archive/html/qemu-devel/2013-03/msg02185.html

Pavel, please have a look on that mail and send an update of your patch. Please cc me for w32/w64 related patches.

Regards,
Stefan W.

#3 lore raw

Hello!

Quoted 7 lines

From: Stefan Weil [mailto:[email protected]]
Am 15.04.2013 17:55, schrieb Paolo Bonzini:

Quoted 4 lines

Il 13/03/2013 13:23, Pavel Dovgaluk ha scritto:

Quoted 2 lines

Added cleanup for Win32 TAP interface. Signed-off-by: Pavel Dovgalyuk<[email protected]>

Stefan, did this slip? Paolo

Quoted 7 lines

Yes, I had not noticed this patch before. But there was a comment from Stefan H. which is still unanswered. See

https://lists.gnu.org/archive/html/qemu-devel/2013-03/msg02185.html

Pavel, please have a look on that mail and send an update of your patch. Please cc me for w32/w64 related patches.

I've read this comment and I plan to rewrite the patch later,
but is not the highest priority task (as ROR bug).
I'll send you an update after finishing it.

Pavel Dovgaluk

#4 lore raw
In reply to Stefan Weil
Quoted 7 lines · Stefan Weil

Am 15.04.2013 17:55, schrieb Paolo Bonzini:

Quoted 4 lines

Il 13/03/2013 13:23, Pavel Dovgaluk ha scritto:

Quoted 2 lines

Added cleanup for Win32 TAP interface. Signed-off-by: Pavel Dovgalyuk<[email protected]>

Stefan, did this slip? Paolo

Quoted 7 lines

Yes, I had not noticed this patch before. But there was a comment from Stefan H. which is still unanswered. See

https://lists.gnu.org/archive/html/qemu-devel/2013-03/msg02185.html

Pavel, please have a look on that mail and send an update of your patch. Please cc me for w32/w64 related patches.

I reviewed the patch, replied (see Stefan Weil's link) and didn't see an updated patch after that.

Stefan