]> Git Repo - qemu.git/blobdiff - chardev/char-win.c
Include qemu/main-loop.h less
[qemu.git] / chardev / char-win.c
index a7e3296909c885a8566d7f56408b9d643dd53eca..34825f683dbaa752fcfd6168916d142489a280a5 100644 (file)
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "qemu/main-loop.h"
+#include "qemu/module.h"
 #include "qapi/error.h"
-#include "char-win.h"
+#include "chardev/char-win.h"
 
 static void win_chr_read(Chardev *chr, DWORD len)
 {
@@ -192,17 +194,13 @@ static void char_win_finalize(Object *obj)
     Chardev *chr = CHARDEV(obj);
     WinChardev *s = WIN_CHARDEV(chr);
 
-    if (s->skip_free) {
-        return;
-    }
-
     if (s->hsend) {
         CloseHandle(s->hsend);
     }
     if (s->hrecv) {
         CloseHandle(s->hrecv);
     }
-    if (s->file) {
+    if (!s->keep_open && s->file) {
         CloseHandle(s->file);
     }
     if (s->fpipe) {
@@ -214,12 +212,12 @@ static void char_win_finalize(Object *obj)
     qemu_chr_be_event(chr, CHR_EVENT_CLOSED);
 }
 
-void qemu_chr_open_win_file(Chardev *chr, HANDLE fd_out)
+void win_chr_set_file(Chardev *chr, HANDLE file, bool keep_open)
 {
     WinChardev *s = WIN_CHARDEV(chr);
 
-    s->skip_free = true;
-    s->file = fd_out;
+    s->keep_open = keep_open;
+    s->file = file;
 }
 
 static void char_win_class_init(ObjectClass *oc, void *data)
This page took 0.02456 seconds and 4 git commands to generate.