qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/3] qga: set file descriptor in qmp_guest_file_


From: Denis V. Lunev
Subject: Re: [Qemu-devel] [PATCH 3/3] qga: set file descriptor in qmp_guest_file_open non-blocking on Win32
Date: Tue, 27 Oct 2015 22:13:57 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 10/27/2015 10:11 PM, Michael Roth wrote:
Quoting Denis V. Lunev (2015-10-27 12:48:43)
From: Olga Krishtal <address@hidden>

Set fd non-blocking to avoid common use cases (like reading from a
named pipe) from hanging the agent. This was missed in the original
code.

The patch introduces analog of qemu_set_non/block for HANDLES.
The usage of handles in qemu_set_non/block is impossible, because for
win32 there is a difference between file discriptors and file handles,
and all file ops are made via Win32 api.
If this is specific to HANDLEs, why do we need to cast back and forth
between int64_t and HANDLE? I haven't build tested, but it seems like
this would break for 32-bit mingw builds.

I would define these as qemu_set_*_by_handle(HANDLE fh, ...) instead
and make them win32 only. If someone wants to introduce a FILE*
variant for posix they can introduce it as
qemu_set_*_by_handle(FILE *fh, ...) rather than us needing to
abstract away the handle type.

may be it would be better to add static function for this in QGA for now?

I am eager to drop this code at once for Posix and Windows and
switch to GLIB like was done for guest exec.

Den



reply via email to

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