qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] main: switch qemu_set_fd_handler to g_io_ad


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 2/2] main: switch qemu_set_fd_handler to g_io_add_watch
Date: Mon, 22 Aug 2011 15:47:53 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110707 Thunderbird/5.0

On 08/22/2011 03:45 PM, Anthony Liguori wrote:

Almost: in Win32 you need to use g_io_channel_win32_new_socket. But
indeed on Windows you can only use qemu_set_fd_handler for sockets too.

I think that's really only for read/write though.  If you're just
polling on I/O, it shouldn't matter IIUC.

If someone has a Windows box, they can confirm/deny by using qemu
-monitor tcp:localhost:1024,socket,nowait with this patch.

Actually you're right, it works automagically:

 * On Win32, this can be used either for files opened with the MSVCRT
 * (the Microsoft run-time C library) _open() or _pipe, including file
 * descriptors 0, 1 and 2 (corresponding to stdin, stdout and stderr),
 * or for Winsock SOCKETs. If the parameter is a legal file
 * descriptor, it is assumed to be such, otherwise it should be a
 * SOCKET. This relies on SOCKETs and file descriptors not
 * overlapping. If you want to be certain, call either
 * g_io_channel_win32_new_fd() or g_io_channel_win32_new_socket()
 * instead as appropriate.

So this patch would even let interested people enable exec migration on Windows.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]