]> git.proxmox.com Git - qemu.git/blobdiff - qga/channel-win32.c
Merge remote-tracking branch 'afaerber-or/prep-up' into staging
[qemu.git] / qga / channel-win32.c
index 190251bb57ac38ddc607fc3160b2e24c644b2e65..7ed98d72fb976df5d25df6a7fadf39b5f8c09efe 100644 (file)
@@ -259,6 +259,10 @@ static GIOStatus ga_channel_write(GAChannel *c, const char *buf, size_t size,
         *count = written;
     }
 
+    if (ov.hEvent) {
+        CloseHandle(ov.hEvent);
+        ov.hEvent = NULL;
+    }
     return status;
 }
 
@@ -283,7 +287,7 @@ GIOStatus ga_channel_write_all(GAChannel *c, const char *buf, size_t size)
 static gboolean ga_channel_open(GAChannel *c, GAChannelMethod method,
                                 const gchar *path)
 {
-    if (!method == GA_CHANNEL_VIRTIO_SERIAL) {
+    if (method != GA_CHANNEL_VIRTIO_SERIAL) {
         g_critical("unsupported communication method");
         return false;
     }