[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 04/19] osdep.h: Introduce a QEMU file descriptor type
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH v2 04/19] osdep.h: Introduce a QEMU file descriptor type |
Date: |
Fri, 11 Nov 2022 09:29:29 +0000 |
User-agent: |
Mutt/2.2.7 (2022-08-07) |
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é <berrange@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 :|
[PATCH v2 03/19] hw/9pfs: Replace the direct call to xxxat() APIs with a wrapper, Bin Meng, 2022/11/10
[PATCH v2 05/19] hw/9pfs: Update 9pfs to use the new QemuFd_t type, Bin Meng, 2022/11/10