On Fri, Nov 11, 2022 at 05:23:58PM +0800, Bin Meng wrote: > Hi Daniel, > > On Fri, Nov 11, 2022 at 5:08 PM Daniel P. Berrangé <berra...@redhat.com> > wrote: > > > > On Fri, Nov 11, 2022 at 12:22:10PM +0800, Bin Meng wrote: > > > Introduce a new QemuFd_t type to represent a file descriptor for > > > different platforms. On POSIX platforms, this is a file descriptor > > > On Windows, this is a file handle. > > > > Can we not use _open_osfhandle() to obtain a C runtime > > file descriptor from the Windows HANDLE. We do this in > > QEMU's socket code, so we don't have to work wit different > > types and APIs on Windows, and I think that's much nicer > > in general. > > > > I am sorry I don't understand your suggestion. I checked > qemu-sockets.c and did not see how sockets connect to this change. > > This change is required to make 9pfs Windows support much easier.
I'm just using it as an example to show that we can continue to use a plain 'int fd' everywhere, and not invent a QemuFd_t type abstraction With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|