Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-08-07 Thread Corey Bryant
On 08/06/2012 10:15 AM, Corey Bryant wrote: On 08/06/2012 09:51 AM, Kevin Wolf wrote: Am 06.08.2012 15:32, schrieb Corey Bryant: On 08/06/2012 05:15 AM, Kevin Wolf wrote: Am 03.08.2012 00:21, schrieb Corey Bryant: @@ -84,6 +158,36 @@ int qemu_open(const char *name, int flags, ...)

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-08-06 Thread Corey Bryant
On 08/06/2012 09:51 AM, Kevin Wolf wrote: Am 06.08.2012 15:32, schrieb Corey Bryant: On 08/06/2012 05:15 AM, Kevin Wolf wrote: Am 03.08.2012 00:21, schrieb Corey Bryant: @@ -84,6 +158,36 @@ int qemu_open(const char *name, int flags, ...) int ret; int mode = 0; +#ifndef _WIN3

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-08-06 Thread Kevin Wolf
Am 06.08.2012 15:32, schrieb Corey Bryant: > On 08/06/2012 05:15 AM, Kevin Wolf wrote: >> Am 03.08.2012 00:21, schrieb Corey Bryant: > @@ -84,6 +158,36 @@ int qemu_open(const char *name, int flags, ...) >int ret; >int mode = 0; > > +#ifndef _WIN32 > +cons

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-08-06 Thread Corey Bryant
On 08/06/2012 05:15 AM, Kevin Wolf wrote: Am 03.08.2012 00:21, schrieb Corey Bryant: @@ -84,6 +158,36 @@ int qemu_open(const char *name, int flags, ...) int ret; int mode = 0; +#ifndef _WIN32 +const char *fdset_id_str; + +/* Attempt dup of fd from fd set */ +if (strs

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-08-06 Thread Kevin Wolf
Am 03.08.2012 00:21, schrieb Corey Bryant: >>> @@ -84,6 +158,36 @@ int qemu_open(const char *name, int flags, ...) >>> int ret; >>> int mode = 0; >>> >>> +#ifndef _WIN32 >>> +const char *fdset_id_str; >>> + >>> +/* Attempt dup of fd from fd set */ >>> +if (strstart(name, "/d

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-08-02 Thread Corey Bryant
On 07/23/2012 09:14 AM, Corey Bryant wrote: On 07/23/2012 09:08 AM, Corey Bryant wrote: When qemu_open is passed a filename of the "/dev/fdset/nnn" format (where nnn is the fdset ID), an fd with matching access mode flags will be searched for within the specified monitor fd set. If the fd i

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-08-02 Thread Corey Bryant
On 07/25/2012 11:57 PM, Corey Bryant wrote: On 07/25/2012 03:43 PM, Eric Blake wrote: On 07/23/2012 07:08 AM, Corey Bryant wrote: When qemu_open is passed a filename of the "/dev/fdset/nnn" format (where nnn is the fdset ID), an fd with matching access mode flags will be searched for within

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-07-26 Thread Corey Bryant
On 07/26/2012 09:16 AM, Kevin Wolf wrote: Am 26.07.2012 15:13, schrieb Eric Blake: On 07/25/2012 09:21 PM, Corey Bryant wrote: On 07/25/2012 03:25 PM, Eric Blake wrote: On 07/25/2012 02:22 AM, Kevin Wolf wrote: Hm, not a nice interface where qemu_close() needs the filename and (worse) cou

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-07-26 Thread Corey Bryant
On 07/26/2012 05:07 AM, Kevin Wolf wrote: Am 26.07.2012 05:57, schrieb Corey Bryant: On 07/25/2012 03:43 PM, Eric Blake wrote: On 07/23/2012 07:08 AM, Corey Bryant wrote: +int monitor_fdset_get_fd(Monitor *mon, int64_t fdset_id, int flags) +{ +mon_fdset_t *mon_fdset; +mon_fdset_fd_t

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-07-26 Thread Corey Bryant
On 07/26/2012 05:07 AM, Kevin Wolf wrote: Am 26.07.2012 05:57, schrieb Corey Bryant: On 07/25/2012 03:43 PM, Eric Blake wrote: On 07/23/2012 07:08 AM, Corey Bryant wrote: +int monitor_fdset_get_fd(Monitor *mon, int64_t fdset_id, int flags) +{ +mon_fdset_t *mon_fdset; +mon_fdset_fd_t

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-07-26 Thread Kevin Wolf
Am 26.07.2012 15:13, schrieb Eric Blake: > On 07/25/2012 09:21 PM, Corey Bryant wrote: >> >> >> On 07/25/2012 03:25 PM, Eric Blake wrote: >>> On 07/25/2012 02:22 AM, Kevin Wolf wrote: >> Hm, not a nice interface where qemu_close() needs the filename and >> (worse) could be given a wrong fil

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-07-26 Thread Eric Blake
On 07/25/2012 09:21 PM, Corey Bryant wrote: > > > On 07/25/2012 03:25 PM, Eric Blake wrote: >> On 07/25/2012 02:22 AM, Kevin Wolf wrote: > Hm, not a nice interface where qemu_close() needs the filename and > (worse) could be given a wrong filename. Maybe it would be better to > mainta

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-07-26 Thread Kevin Wolf
Am 26.07.2012 05:57, schrieb Corey Bryant: > On 07/25/2012 03:43 PM, Eric Blake wrote: >> On 07/23/2012 07:08 AM, Corey Bryant wrote: >>> +int monitor_fdset_get_fd(Monitor *mon, int64_t fdset_id, int flags) >>> +{ >>> +mon_fdset_t *mon_fdset; >>> +mon_fdset_fd_t *mon_fdset_fd; >>> +int

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-07-25 Thread Corey Bryant
On 07/25/2012 03:43 PM, Eric Blake wrote: On 07/23/2012 07:08 AM, Corey Bryant wrote: When qemu_open is passed a filename of the "/dev/fdset/nnn" format (where nnn is the fdset ID), an fd with matching access mode flags will be searched for within the specified monitor fd set. If the fd is fo

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-07-25 Thread Corey Bryant
On 07/25/2012 03:25 PM, Eric Blake wrote: On 07/25/2012 02:22 AM, Kevin Wolf wrote: Hm, not a nice interface where qemu_close() needs the filename and (worse) could be given a wrong filename. Maybe it would be better to maintain a list of fd -> fdset mappings in qemu_open/close? I agree, I

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-07-25 Thread Eric Blake
On 07/23/2012 07:08 AM, Corey Bryant wrote: > When qemu_open is passed a filename of the "/dev/fdset/nnn" > format (where nnn is the fdset ID), an fd with matching access > mode flags will be searched for within the specified monitor > fd set. If the fd is found, a dup of the fd will be returned >

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-07-25 Thread Eric Blake
On 07/25/2012 02:22 AM, Kevin Wolf wrote: >>> Hm, not a nice interface where qemu_close() needs the filename and >>> (worse) could be given a wrong filename. Maybe it would be better to >>> maintain a list of fd -> fdset mappings in qemu_open/close? >>> >> >> I agree, I don't really like it either.

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-07-25 Thread Kevin Wolf
Am 25.07.2012 05:41, schrieb Corey Bryant: >>> diff --git a/block/raw-posix.c b/block/raw-posix.c >>> index a172de3..5d0a801 100644 >>> --- a/block/raw-posix.c >>> +++ b/block/raw-posix.c >>> @@ -271,7 +271,7 @@ static int raw_open_common(BlockDriverState *bs, const >>> char *filename, >>> out_f

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-07-24 Thread Corey Bryant
On 07/24/2012 08:07 AM, Kevin Wolf wrote: Am 23.07.2012 15:08, schrieb Corey Bryant: When qemu_open is passed a filename of the "/dev/fdset/nnn" format (where nnn is the fdset ID), an fd with matching access mode flags will be searched for within the specified monitor fd set. If the fd is fou

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-07-24 Thread Kevin Wolf
Am 23.07.2012 15:08, schrieb Corey Bryant: > When qemu_open is passed a filename of the "/dev/fdset/nnn" > format (where nnn is the fdset ID), an fd with matching access > mode flags will be searched for within the specified monitor > fd set. If the fd is found, a dup of the fd will be returned >

[Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-07-23 Thread Corey Bryant
When qemu_open is passed a filename of the "/dev/fdset/nnn" format (where nnn is the fdset ID), an fd with matching access mode flags will be searched for within the specified monitor fd set. If the fd is found, a dup of the fd will be returned from qemu_open. Each fd set has a reference count.

Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

2012-07-23 Thread Corey Bryant
On 07/23/2012 09:08 AM, Corey Bryant wrote: When qemu_open is passed a filename of the "/dev/fdset/nnn" format (where nnn is the fdset ID), an fd with matching access mode flags will be searched for within the specified monitor fd set. If the fd is found, a dup of the fd will be returned from