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

2012-08-13 Thread Corey Bryant
I'll send a new version shortly with these updates also. -- Regards, Corey On 08/11/2012 10:28 AM, Eric Blake wrote: On 08/11/2012 07:14 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

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

2012-08-13 Thread Eric Blake
On 08/13/2012 07:44 AM, Corey Bryant wrote: I'll send a new version shortly with these updates also. + +ret = monitor_fdset_dup_fd_add(fdset_id, dupfd); +if (ret == -1) { +close(dupfd); +return -1; This function appears to promise a reasonable

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

2012-08-13 Thread Corey Bryant
On 08/13/2012 12:16 PM, Eric Blake wrote: On 08/13/2012 07:44 AM, Corey Bryant wrote: I'll send a new version shortly with these updates also. + +ret = monitor_fdset_dup_fd_add(fdset_id, dupfd); +if (ret == -1) { +close(dupfd); +return -1; This

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

2012-08-13 Thread Eric Blake
On 08/13/2012 10:33 AM, Corey Bryant wrote: The only way it could fail is if we are trying to add an fd that is already in the set, or if we don't find mon_fdset; both of which would indicate logic bugs earlier in our program. Would it be worth asserting that these conditions are impossible,

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

2012-08-13 Thread Corey Bryant
On 08/13/2012 01:13 PM, Eric Blake wrote: On 08/13/2012 10:33 AM, Corey Bryant wrote: The only way it could fail is if we are trying to add an fd that is already in the set, or if we don't find mon_fdset; both of which would indicate logic bugs earlier in our program. Would it be worth

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

2012-08-11 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. Signed-off-by: Corey Bryant

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

2012-08-11 Thread Eric Blake
On 08/11/2012 07:14 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