Re: [Qemu-devel] [PATCH v3 3/5] osdep: Enable qemu_open to dup pre-opened fd

2012-06-19 Thread Corey Bryant
On 06/18/2012 04:10 AM, Kevin Wolf wrote: Am 15.06.2012 22:00, schrieb Eric Blake: On 06/15/2012 01:19 PM, Corey Bryant wrote: There are some flags that I don't think we'll be able to change. For example: O_RDONLY, O_WRONLY, O_RDWR. I assume libvirt would open all files O_RDWR. I think w

Re: [Qemu-devel] [PATCH v3 3/5] osdep: Enable qemu_open to dup pre-opened fd

2012-06-18 Thread Kevin Wolf
Am 15.06.2012 22:00, schrieb Eric Blake: > On 06/15/2012 01:19 PM, Corey Bryant wrote: > There are some flags that I don't think we'll be able to change. For example: O_RDONLY, O_WRONLY, O_RDWR. I assume libvirt would open all files O_RDWR. >>> >>> I think we need to check all of

Re: [Qemu-devel] [PATCH v3 3/5] osdep: Enable qemu_open to dup pre-opened fd

2012-06-15 Thread Corey Bryant
On 06/15/2012 04:00 PM, Eric Blake wrote: On 06/15/2012 01:19 PM, Corey Bryant wrote: There are some flags that I don't think we'll be able to change. For example: O_RDONLY, O_WRONLY, O_RDWR. I assume libvirt would open all files O_RDWR. I think we need to check all of them and fail qemu_

Re: [Qemu-devel] [PATCH v3 3/5] osdep: Enable qemu_open to dup pre-opened fd

2012-06-15 Thread Eric Blake
On 06/15/2012 01:19 PM, Corey Bryant wrote: >>> There are some flags that I don't think we'll be able to change. For >>> example: O_RDONLY, O_WRONLY, O_RDWR. I assume libvirt would open all >>> files O_RDWR. >> >> I think we need to check all of them and fail qemu_open() if they don't >> match.

Re: [Qemu-devel] [PATCH v3 3/5] osdep: Enable qemu_open to dup pre-opened fd

2012-06-15 Thread Corey Bryant
On 06/15/2012 02:46 PM, Kevin Wolf wrote: Am 15.06.2012 20:16, schrieb Corey Bryant: On 06/15/2012 11:16 AM, Eric Blake wrote: On 06/14/2012 09:55 AM, Corey Bryant wrote: This patch adds support to qemu_open to dup(fd) a pre-opened file descriptor if the filename is of the format /dev/fd/X

Re: [Qemu-devel] [PATCH v3 3/5] osdep: Enable qemu_open to dup pre-opened fd

2012-06-15 Thread Corey Bryant
On 06/15/2012 02:42 PM, Eric Blake wrote: On 06/15/2012 12:16 PM, Corey Bryant wrote: I think you need to honor flags so that the end use of the fd will be as if qemu had directly opened the file, rather than just doing a blind dup with a resulting fd that is in a different state than the cal

Re: [Qemu-devel] [PATCH v3 3/5] osdep: Enable qemu_open to dup pre-opened fd

2012-06-15 Thread Kevin Wolf
Am 15.06.2012 20:16, schrieb Corey Bryant: > > > On 06/15/2012 11:16 AM, Eric Blake wrote: >> On 06/14/2012 09:55 AM, Corey Bryant wrote: >>> This patch adds support to qemu_open to dup(fd) a pre-opened file >>> descriptor if the filename is of the format /dev/fd/X. >>> >> >>> +++ b/osdep.c >>> @

Re: [Qemu-devel] [PATCH v3 3/5] osdep: Enable qemu_open to dup pre-opened fd

2012-06-15 Thread Eric Blake
On 06/15/2012 12:16 PM, Corey Bryant wrote: >> I think you need to honor flags so that the end use of the fd will be as >> if qemu had directly opened the file, rather than just doing a blind dup >> with a resulting fd that is in a different state than the caller >> expected. I can think of at le

Re: [Qemu-devel] [PATCH v3 3/5] osdep: Enable qemu_open to dup pre-opened fd

2012-06-15 Thread Corey Bryant
On 06/15/2012 11:16 AM, Eric Blake wrote: On 06/14/2012 09:55 AM, Corey Bryant wrote: This patch adds support to qemu_open to dup(fd) a pre-opened file descriptor if the filename is of the format /dev/fd/X. +++ b/osdep.c @@ -82,6 +82,19 @@ int qemu_open(const char *name, int flags, ...)

Re: [Qemu-devel] [PATCH v3 3/5] osdep: Enable qemu_open to dup pre-opened fd

2012-06-15 Thread Eric Blake
On 06/14/2012 09:55 AM, Corey Bryant wrote: > This patch adds support to qemu_open to dup(fd) a pre-opened file > descriptor if the filename is of the format /dev/fd/X. > > +++ b/osdep.c > @@ -82,6 +82,19 @@ int qemu_open(const char *name, int flags, ...) > int ret; > int mode = 0; >

[Qemu-devel] [PATCH v3 3/5] osdep: Enable qemu_open to dup pre-opened fd

2012-06-14 Thread Corey Bryant
This patch adds support to qemu_open to dup(fd) a pre-opened file descriptor if the filename is of the format /dev/fd/X. This can be used when QEMU is restricted from opening files, and the management application opens files on QEMU's behalf. If the fd was passed to the monitor with the pass-fd c