Re: [Qemu-devel] [PATCH v4 0/7] file descriptor passing using pass-fd

2012-07-05 Thread Corey Bryant
On 07/05/2012 10:51 AM, Kevin Wolf wrote: Am 05.07.2012 16:22, schrieb Corey Bryant: For some examples: 1. client calls 'add-fd', qemu is now tracking fd=4 with refcount 1, in use by monitor, as member of fdset1 2. client crashes, so all tracked fds are visited; fd=4 had not yet b

Re: [Qemu-devel] [PATCH v4 0/7] file descriptor passing using pass-fd

2012-07-05 Thread Corey Bryant
On 07/05/2012 12:35 PM, Corey Bryant wrote: On 07/05/2012 10:51 AM, Kevin Wolf wrote: Am 05.07.2012 16:22, schrieb Corey Bryant: For some examples: 1. client calls 'add-fd', qemu is now tracking fd=4 with refcount 1, in use by monitor, as member of fdset1 2. client crashes, so a

Re: [Qemu-devel] [PATCH v4 0/7] file descriptor passing using pass-fd

2012-07-05 Thread Corey Bryant
On 07/05/2012 01:00 PM, Eric Blake wrote: On 07/05/2012 10:35 AM, Corey Bryant wrote: 1. client calls 'add-fd', qemu is now tracking fd=4 in fdset1 with refcount of 0; fd=4's in-use flag is turned on 2. client calls 'device-add' with /dev/fdset/1 as the backi

Re: [Qemu-devel] [PATCH v4 0/7] file descriptor passing using pass-fd

2012-07-06 Thread Corey Bryant
On 07/06/2012 05:11 AM, Kevin Wolf wrote: Am 05.07.2012 19:00, schrieb Eric Blake: On 07/05/2012 10:35 AM, Corey Bryant wrote: 1. client calls 'add-fd', qemu is now tracking fd=4 in fdset1 with refcount of 0; fd=4's in-use flag is turned on 2. client calls 'device-add&#

Re: [Qemu-devel] [PATCH v4 0/7] file descriptor passing using pass-fd

2012-07-06 Thread Corey Bryant
Ugh... please disregard this. I hit send accidentally. On 07/06/2012 01:14 PM, Corey Bryant wrote: On 07/06/2012 05:11 AM, Kevin Wolf wrote: Am 05.07.2012 19:00, schrieb Eric Blake: On 07/05/2012 10:35 AM, Corey Bryant wrote: 1. client calls 'add-fd', qemu is now tracking fd=4

Re: [Qemu-devel] [PATCH v4 0/7] file descriptor passing using pass-fd

2012-07-06 Thread Corey Bryant
On 07/06/2012 05:11 AM, Kevin Wolf wrote: Am 05.07.2012 19:00, schrieb Eric Blake: On 07/05/2012 10:35 AM, Corey Bryant wrote: 1. client calls 'add-fd', qemu is now tracking fd=4 in fdset1 with refcount of 0; fd=4's in-use flag is turned on 2. client calls 'device-add&#

Re: [Qemu-devel] [libvirt] [PATCH v4 0/7] file descriptor passing using pass-fd

2012-07-06 Thread Corey Bryant
On 07/06/2012 01:40 PM, Corey Bryant wrote: On 07/06/2012 05:11 AM, Kevin Wolf wrote: Am 05.07.2012 19:00, schrieb Eric Blake: On 07/05/2012 10:35 AM, Corey Bryant wrote: 1. client calls 'add-fd', qemu is now tracking fd=4 in fdset1 with refcount of 0; fd=4's in-use flag

[Qemu-devel] [PATCH v8 3/4] Add cap reduction support to enable use as SUID

2012-01-26 Thread Corey Bryant
prove security, use libcap to reduce our capability set to just cap_net_admin, then reduce privileges down to the calling user. This is hopefully close to equivalent to fscap support from a security perspective. Signed-off-by: Anthony Liguori Signed-off-by: Richa Marwaha Signed-off-by: Corey B

[Qemu-devel] [PATCH v8 4/4] Add support for net bridge

2012-01-26 Thread Corey Bryant
ux.img -netdev tap,helper="/usr/local/libexec/qemu-bridge-helper --br=qemubr0",id=hn0 -device virtio-net-pci,netdev=hn0,id=nic1 Signed-off-by: Anthony Liguori Signed-off-by: Richa Marwaha Signed-off-by: Corey Bryant --- configure |2 + net.c

[Qemu-devel] [PATCH v8 0/4] -net bridge: rootless bridge support for qemu

2012-01-26 Thread Corey Bryant
ption from -netdev tap v8: - Rebased on top of commit 5b4448d27d7c6ff6e18a1edc8245cb1db783e37c - Rebase required changes in configure script for libcap-ng config Corey Bryant (4): Add basic version of bridge helper Add access control support to qemu bridge helper Add cap reduction support to ena

[Qemu-devel] [PATCH v8 2/4] Add access control support to qemu bridge helper

2012-01-26 Thread Corey Bryant
ny Liguori Signed-off-by: Richa Marwaha Signed-off-by: Corey Bryant --- qemu-bridge-helper.c | 153 ++ 1 files changed, 153 insertions(+), 0 deletions(-) diff --git a/qemu-bridge-helper.c b/qemu-bridge-helper.c index 48c5e22..01eeb38 100644 --- a/q

[Qemu-devel] [PATCH v8 1/4] Add basic version of bridge helper

2012-01-26 Thread Corey Bryant
. The helper can then exit and let qemu use the tap device. Signed-off-by: Anthony Liguori Signed-off-by: Richa Marwaha Signed-off-by: Corey Bryant --- Makefile | 12 +++- configure|1 + qemu-bridge-helper.c | 221

Re: [Qemu-devel] [PATCH] w32: Fix build with new net bridge code

2012-02-05 Thread Corey Bryant
On 02/04/2012 03:24 AM, Stefan Weil wrote: Commit a7c36ee4920ea3acc227a0248dd161693f207357 added code for a net bridge and explicitly said that "this is very Linux centric". Indeed, compilation failed for w32, so the bridge code is now conditional. Hosts which don't support it can simply remov

Re: [Qemu-devel] buildbot failure in qemu on default_mingw32

2012-02-06 Thread Corey Bryant
On 02/04/2012 03:29 AM, Stefan Weil wrote: Am 04.02.2012 00:43, schrieb Anthony Liguori: On 02/03/2012 06:11 PM, q...@buildbot.b1-systems.de wrote: The Buildbot has detected a new failure on builder default_mingw32 while building qemu. Full details are available at: http://buildbot.b1-systems

[Qemu-devel] [PATCH] Change "-net tap, helper" to "-net tap, bridgehelper"

2012-02-06 Thread Corey Bryant
;/usr/local/libexec/qemu-bridge-helper --br=qemubr0",id=hn0 -device virtio-net-pci,netdev=hn0,id=nic1 Signed-off-by: Corey Bryant --- net.c |2 +- net/tap.c | 14 +++--- qemu-options.hx | 24 3 files changed, 20 insertions(+), 20 deletio

Re: [Qemu-devel] buildbot failure in qemu on default_mingw32

2012-02-07 Thread Corey Bryant
On 02/07/2012 05:28 AM, Stefan Hajnoczi wrote: On Mon, Feb 6, 2012 at 8:27 PM, Corey Bryant wrote: On 02/04/2012 03:29 AM, Stefan Weil wrote: Am 04.02.2012 00:43, schrieb Anthony Liguori: On 02/03/2012 06:11 PM, q...@buildbot.b1-systems.de wrote: The Buildbot has detected a new

Re: [Qemu-devel] buildbot failure in qemu on default_mingw32

2012-02-07 Thread Corey Bryant
On 02/07/2012 09:59 AM, Stefan Hajnoczi wrote: On Tue, Feb 7, 2012 at 2:32 PM, Corey Bryant wrote: On 02/07/2012 05:28 AM, Stefan Hajnoczi wrote: On Mon, Feb 6, 2012 at 8:27 PM, Corey Bryant wrote: On 02/04/2012 03:29 AM, Stefan Weil wrote: Am 04.02.2012 00:43, schrieb Anthony

[Qemu-devel] [PATCH v6 3/6] monitor: Clean up fd sets on monitor disconnect

2012-08-03 Thread Corey Bryant
fd. v5: -This patch is new in v5. -This support addresses concerns from v4 regarding fd leakage if the client disconnects unexpectedly. (ebl...@redhat.com, kw...@redhat.com, dberra...@redhat.com) v6: -No changes Signed-off-by: Corey Bryant --- monitor.c | 15 +++ 1 file

[Qemu-devel] [PATCH v6 5/6] block: Convert close calls to qemu_close

2012-08-03 Thread Corey Bryant
This patch converts all block layer close calls, that correspond to qemu_open calls, to qemu_close. v5: -This patch is new in v5. (kw...@redhat.com, ebl...@redhat.com) v6: -No changes Signed-off-by: Corey Bryant --- block/raw-posix.c | 24 block/raw-win32.c |2

[Qemu-devel] [PATCH v6 1/6] qemu-char: Add MSG_CMSG_CLOEXEC flag to recvmsg

2012-08-03 Thread Corey Bryant
) Signed-off-by: Corey Bryant --- qemu-char.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index c2aaaee..ab4a928 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -2238,6 +2238,9 @@ static void unix_process_msgfd(CharDriverState *chr

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

2012-08-03 Thread Corey Bryant
set can be closed. If an fd set has dup() references open, then we must keep the other fds in the fd set open in case a reopen of the file occurs that requires an fd with a different access mode. Signed-off-by: Corey Bryant v2: -Get rid of file_open and move dup code to qemu_open (kw...@redhat.

[Qemu-devel] [PATCH v6 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-03 Thread Corey Bryant
om, kw...@redhat.com, dberra...@redhat.com) v6 -Make @fd optional for remove-fd (ebl...@redhat.com) -Make @fdset-id optional for add-fd (ebl...@redhat.com) Signed-off-by: Corey Bryant --- monitor.c| 172 +

[Qemu-devel] [PATCH v6 4/6] block: Convert open calls to qemu_open

2012-08-03 Thread Corey Bryant
This patch converts all block layer open calls to qemu_open. Note that this adds the O_CLOEXEC flag to the changed open paths when the O_CLOEXEC macro is defined. Signed-off-by: Corey Bryant --- v2: -Convert calls to qemu_open instead of file_open (kw...@redhat.com) -Mention introduction of

[Qemu-devel] [PATCH v6 0/6] file descriptor passing using fd sets

2012-08-03 Thread Corey Bryant
nfs_t). The virt_use_nfs boolean type simply needs to be set to false, and open will be prevented (and dup will be allowed). For example: # setsebool virt_use_nfs 0 # getsebool virt_use_nfs virt_use_nfs --> off Corey Bryant (6): qemu-char: Add MSG_CMSG_CLOEXEC flag to recvms

Re: [Qemu-devel] [PATCH v6 1/6] qemu-char: Add MSG_CMSG_CLOEXEC flag to recvmsg

2012-08-03 Thread Corey Bryant
If these patches are acceptable, I'll resend and get the version history out of the commit message. -- Regards, Corey On 08/03/2012 01:28 PM, Corey Bryant wrote: Set the close-on-exec flag for the file descriptor received via SCM_RIGHTS. v4 -This patch is new in v4 (ebl...@redha

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

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

[Qemu-devel] [PATCH v7 3/6] monitor: Clean up fd sets on monitor disconnect

2012-08-07 Thread Corey Bryant
prior to using a passed fd. Signed-off-by: Corey Bryant --- v5: -This patch is new in v5. -This support addresses concerns from v4 regarding fd leakage if the client disconnects unexpectedly. (ebl...@redhat.com, kw...@redhat.com, dberra...@redhat.com) v6: -No changes v7: -Removed

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

2012-08-07 Thread Corey Bryant
set can be closed. If an fd set has dup() references open, then we must keep the other fds in the fd set open in case a reopen of the file occurs that requires an fd with a different access mode. Signed-off-by: Corey Bryant --- v2: -Get rid of file_open and move dup code to qemu_open (kw...@redhat.

[Qemu-devel] [PATCH v7 0/6] file descriptor passing using fd sets

2012-08-07 Thread Corey Bryant
nfs_t). The virt_use_nfs boolean type simply needs to be set to false, and open will be prevented (and dup will be allowed). For example: # setsebool virt_use_nfs 0 # getsebool virt_use_nfs virt_use_nfs --> off Corey Bryant (6): qemu-char: Add MSG_CMSG_CLOEXEC flag to recvms

[Qemu-devel] [PATCH v7 5/6] block: Convert close calls to qemu_close

2012-08-07 Thread Corey Bryant
This patch converts all block layer close calls, that correspond to qemu_open calls, to qemu_close. Signed-off-by: Corey Bryant --- v5: -This patch is new in v5. (kw...@redhat.com, ebl...@redhat.com) v6-v7: -No changes block/raw-posix.c | 24 block/raw-win32.c

[Qemu-devel] [PATCH v7 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-07 Thread Corey Bryant
etfd and closefd QMP commands. Signed-off-by: Corey Bryant --- v5: -This patch is new in v5 and replaces the pass-fd QMP command from v4. -By grouping fds in fd sets, we ease managability with an fd set per file, addressing concerns raised in v4 about handling "reopens" and preventing

[Qemu-devel] [PATCH v7 1/6] qemu-char: Add MSG_CMSG_CLOEXEC flag to recvmsg

2012-08-07 Thread Corey Bryant
Set the close-on-exec flag for the file descriptor received via SCM_RIGHTS. Signed-off-by: Corey Bryant --- v4 -This patch is new in v4 (ebl...@redhat.com) v5 -Fallback to FD_CLOEXEC if MSG_CMSG_CLOEXEC is not available (ebl...@redhat.com, stefa...@linux.vnet.ibm.com) v6 -Set cloexec on

[Qemu-devel] [PATCH v7 4/6] block: Convert open calls to qemu_open

2012-08-07 Thread Corey Bryant
This patch converts all block layer open calls to qemu_open. Note that this adds the O_CLOEXEC flag to the changed open paths when the O_CLOEXEC macro is defined. Signed-off-by: Corey Bryant --- v2: -Convert calls to qemu_open instead of file_open (kw...@redhat.com) -Mention introduction of

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 v7 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-07 Thread Corey Bryant
On 08/07/2012 12:49 PM, Eric Blake wrote: On 08/07/2012 09:58 AM, Corey Bryant wrote: This patch adds support that enables passing of file descriptors to the QEMU monitor where they will be stored in specified file descriptor sets. A file descriptor set can be used by a client like libvirt

Re: [Qemu-devel] [PATCH v6 3/6] monitor: Clean up fd sets on monitor disconnect

2012-08-07 Thread Corey Bryant
On 08/07/2012 01:32 PM, Stefan Hajnoczi wrote: On Fri, Aug 03, 2012 at 01:28:06PM -0400, Corey Bryant wrote: Each fd set has a boolean that keeps track of whether or not the fd set is in use by a monitor connection. When a monitor disconnects, all fds that are members of an fd set with

Re: [Qemu-devel] [PATCH v6 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-07 Thread Corey Bryant
On 08/07/2012 02:16 PM, Stefan Hajnoczi wrote: On Fri, Aug 3, 2012 at 6:28 PM, Corey Bryant wrote: diff --git a/monitor.c b/monitor.c index 49dccfe..9aa9f7e 100644 --- a/monitor.c +++ b/monitor.c @@ -140,6 +140,24 @@ struct mon_fd_t { QLIST_ENTRY(mon_fd_t) next; }; +/* file

Re: [Qemu-devel] [PATCH v6 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-08 Thread Corey Bryant
On 08/08/2012 04:52 AM, Stefan Hajnoczi wrote: On Tue, Aug 7, 2012 at 8:59 PM, Corey Bryant wrote: On 08/07/2012 02:16 PM, Stefan Hajnoczi wrote: On Fri, Aug 3, 2012 at 6:28 PM, Corey Bryant wrote: +snprintf(fd_str, sizeof(fd_str), "%ld", fd); +qerror_report(QERR_FD

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

2012-08-08 Thread Corey Bryant
On 08/08/2012 09:02 AM, Stefan Hajnoczi wrote: On Tue, Aug 07, 2012 at 11:58:28AM -0400, Corey Bryant wrote: @@ -2566,6 +2567,92 @@ FdsetInfoList *qmp_query_fdsets(Error **errp) return fdset_list; } +int monitor_fdset_get_fd(int64_t fdset_id, int flags) +{ +mon_fdset_t *mon_fdset

Re: [Qemu-devel] [PATCH v7 0/6] file descriptor passing using fd sets

2012-08-08 Thread Corey Bryant
On 08/08/2012 09:04 AM, Stefan Hajnoczi wrote: On Tue, Aug 7, 2012 at 4:58 PM, Corey Bryant wrote: libvirt's sVirt security driver provides SELinux MAC isolation for Qemu guest processes and their corresponding image files. In other words, sVirt uses SELinux to prevent a QEMU process

Re: [Qemu-devel] [PATCH v7 0/6] file descriptor passing using fd sets

2012-08-08 Thread Corey Bryant
On 08/08/2012 11:58 AM, Stefan Hajnoczi wrote: On Wed, Aug 8, 2012 at 3:54 PM, Corey Bryant wrote: On 08/08/2012 09:04 AM, Stefan Hajnoczi wrote: On Tue, Aug 7, 2012 at 4:58 PM, Corey Bryant wrote: libvirt's sVirt security driver provides SELinux MAC isolation for Qemu guest proc

Re: [Qemu-devel] [PATCH v7 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-08 Thread Corey Bryant
On 08/07/2012 06:16 PM, Eric Blake wrote: On 08/07/2012 11:07 AM, Corey Bryant wrote: +# +# Since: 1.2.0 We're not very consistent on '1.2' vs. '1.2.0' in since listings, but that's probably worth a global cleanup closer to hard freeze. I'll make a not

Re: [Qemu-devel] [PATCH v7 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-08 Thread Corey Bryant
On 08/08/2012 04:48 PM, Luiz Capitulino wrote: On Wed, 08 Aug 2012 15:07:02 -0400 Corey Bryant wrote: On 08/07/2012 06:16 PM, Eric Blake wrote: On 08/07/2012 11:07 AM, Corey Bryant wrote: +# +# Since: 1.2.0 We're not very consistent on '1.2' vs. '1.2.0' in s

Re: [Qemu-devel] [PATCH v7 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-08 Thread Corey Bryant
On 08/08/2012 05:13 PM, Luiz Capitulino wrote: On Wed, 08 Aug 2012 16:52:41 -0400 Corey Bryant wrote: On 08/08/2012 04:48 PM, Luiz Capitulino wrote: On Wed, 08 Aug 2012 15:07:02 -0400 Corey Bryant wrote: On 08/07/2012 06:16 PM, Eric Blake wrote: On 08/07/2012 11:07 AM, Corey Bryant

Re: [Qemu-devel] [libvirt] [PATCH v7 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-09 Thread Corey Bryant
On 08/09/2012 09:06 AM, Eric Blake wrote: On 08/09/2012 03:04 AM, Stefan Hajnoczi wrote: On Tue, Aug 7, 2012 at 4:58 PM, Corey Bryant wrote: +## +# @FdsetFdInfo: +# +# Information about a file descriptor that belongs to an fd set. +# +# @fd: The file descriptor value. +# +# @removed: If

Re: [Qemu-devel] [PATCH v7 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-09 Thread Corey Bryant
On 08/09/2012 06:11 AM, Kevin Wolf wrote: Am 07.08.2012 18:49, schrieb Eric Blake: On 08/07/2012 09:58 AM, Corey Bryant wrote: This patch adds support that enables passing of file descriptors to the QEMU monitor where they will be stored in specified file descriptor sets. A file descriptor

[Qemu-devel] [PATCH v8 3/7] monitor: Clean up fd sets on monitor disconnect

2012-08-09 Thread Corey Bryant
prior to using a passed fd. Signed-off-by: Corey Bryant --- v5: -This patch is new in v5. -This support addresses concerns from v4 regarding fd leakage if the client disconnects unexpectedly. (ebl...@redhat.com, kw...@redhat.com, dberra...@redhat.com) v6: -No changes v7: -Removed

[Qemu-devel] [PATCH v8 0/7] file descriptor passing using fd sets

2012-08-09 Thread Corey Bryant
nfs_t). The virt_use_nfs boolean type simply needs to be set to false, and open will be prevented (and dup will be allowed). For example: # setsebool virt_use_nfs 0 # getsebool virt_use_nfs virt_use_nfs --> off Corey Bryant (7): qemu-char: Add MSG_CMSG_CLOEXEC flag to recvms

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

2012-08-09 Thread Corey Bryant
set can be closed. If an fd set has dup() references open, then we must keep the other fds in the fd set open in case a reopen of the file occurs that requires an fd with a different access mode. Signed-off-by: Corey Bryant --- v2: -Get rid of file_open and move dup code to qemu_open (kw...@redhat.

[Qemu-devel] [PATCH v8 4/7] block: Prevent detection of /dev/fdset/ as floppy

2012-08-09 Thread Corey Bryant
Signed-off-by: Corey Bryant --- v8 -This patch is new in v8. It was reported on a prior fd passing approach and I realized it's needed in this series. (kw...@redhat.com) block/raw-posix.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/raw-posix.c b/

[Qemu-devel] [PATCH v8 6/7] block: Convert close calls to qemu_close

2012-08-09 Thread Corey Bryant
This patch converts all block layer close calls, that correspond to qemu_open calls, to qemu_close. Signed-off-by: Corey Bryant --- v5: -This patch is new in v5. (kw...@redhat.com, ebl...@redhat.com) v6-v8: -No changes block/raw-posix.c | 24 block/raw-win32.c

[Qemu-devel] [PATCH v8 2/7] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-09 Thread Corey Bryant
etfd and closefd QMP commands. Signed-off-by: Corey Bryant --- v5: -This patch is new in v5 and replaces the pass-fd QMP command from v4. -By grouping fds in fd sets, we ease managability with an fd set per file, addressing concerns raised in v4 about handling "reopens" and preventing

[Qemu-devel] [PATCH v8 1/7] qemu-char: Add MSG_CMSG_CLOEXEC flag to recvmsg

2012-08-09 Thread Corey Bryant
Set the close-on-exec flag for the file descriptor received via SCM_RIGHTS. Signed-off-by: Corey Bryant --- v4 -This patch is new in v4 (ebl...@redhat.com) v5 -Fallback to FD_CLOEXEC if MSG_CMSG_CLOEXEC is not available (ebl...@redhat.com, stefa...@linux.vnet.ibm.com) v6 -Set cloexec on

[Qemu-devel] [PATCH v8 5/7] block: Convert open calls to qemu_open

2012-08-09 Thread Corey Bryant
This patch converts all block layer open calls to qemu_open. Note that this adds the O_CLOEXEC flag to the changed open paths when the O_CLOEXEC macro is defined. Signed-off-by: Corey Bryant --- v2: -Convert calls to qemu_open instead of file_open (kw...@redhat.com) -Mention introduction of

Re: [Qemu-devel] [PATCH v8 2/7] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-10 Thread Corey Bryant
On 08/10/2012 01:57 AM, Eric Blake wrote: On 08/09/2012 08:10 PM, Corey Bryant wrote: This patch adds support that enables passing of file descriptors to the QEMU monitor where they will be stored in specified file descriptor sets. A file descriptor set can be used by a client like libvirt

Re: [Qemu-devel] [v2 Patch 2/9]block: raw-posix image file reopen

2012-08-10 Thread Corey Bryant
On 07/30/2012 05:34 PM, Supriya Kannery wrote: raw-posix driver changes for bdrv_reopen_xx functions to safely reopen image files. Reopening of image files while changing hostcache dynamically is handled here. Signed-off-by: Supriya Kannery --- Index: qemu/block/raw.c ===

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

2012-08-10 Thread Corey Bryant
On 08/10/2012 02:16 AM, Eric Blake wrote: On 08/09/2012 08:10 PM, 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

Re: [Qemu-devel] [PATCH v8 2/7] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-10 Thread Corey Bryant
On 08/10/2012 03:20 AM, Stefan Hajnoczi wrote: On Thu, Aug 09, 2012 at 10:10:44PM -0400, Corey Bryant wrote: +void qmp_remove_fd(int64_t fdset_id, bool has_fd, int64_t fd, Error **errp) +{ +MonFdset *mon_fdset; +MonFdsetFd *mon_fdset_fd; +char fd_str[20]; + +QLIST_FOREACH

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

2012-08-10 Thread Corey Bryant
On 08/10/2012 11:25 AM, Eric Blake wrote: On 08/10/2012 08:17 AM, Corey Bryant wrote: can be closed. If an fd set has dup() references open, then we must keep the other fds in the fd set open in case a reopen of the file occurs that requires an fd with a different access mode. Is this

Re: [Qemu-devel] [PATCH v8 2/7] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-10 Thread Corey Bryant
On 08/10/2012 12:08 PM, Kevin Wolf wrote: Am 10.08.2012 04:10, schrieb Corey Bryant: This patch adds support that enables passing of file descriptors to the QEMU monitor where they will be stored in specified file descriptor sets. A file descriptor set can be used by a client like libvirt to

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

2012-08-10 Thread Corey Bryant
On 08/10/2012 12:34 PM, Kevin Wolf wrote: Am 10.08.2012 04:10, 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

Re: [Qemu-devel] [PATCH v8 0/7] file descriptor passing using fd sets

2012-08-10 Thread Corey Bryant
On 08/10/2012 12:36 PM, Kevin Wolf wrote: Am 10.08.2012 04:10, schrieb Corey Bryant: libvirt's sVirt security driver provides SELinux MAC isolation for Qemu guest processes and their corresponding image files. In other words, sVirt uses SELinux to prevent a QEMU process from opening

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

2012-08-10 Thread Corey Bryant
On 08/10/2012 12:56 PM, Corey Bryant wrote: On 08/10/2012 12:34 PM, Kevin Wolf wrote: Am 10.08.2012 04:10, 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

[Qemu-devel] [PATCH v9 0/7] file descriptor passing using fd sets

2012-08-11 Thread Corey Bryant
nfs_t). The virt_use_nfs boolean type simply needs to be set to false, and open will be prevented (and dup will be allowed). For example: # setsebool virt_use_nfs 0 # getsebool virt_use_nfs virt_use_nfs --> off Corey Bryant (7): qemu-char: Add MSG_CMSG_CLOEXEC flag to recvms

[Qemu-devel] [PATCH v9 3/7] block: Prevent detection of /dev/fdset/ as floppy

2012-08-11 Thread Corey Bryant
Signed-off-by: Corey Bryant --- v8 -This patch is new in v8. It was reported on a prior fd passing approach and I realized it's needed in this series. (kw...@redhat.com) v9 -No changes block/raw-posix.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bloc

[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 Brya

[Qemu-devel] [PATCH v9 5/7] block: Convert close calls to qemu_close

2012-08-11 Thread Corey Bryant
This patch converts all block layer close calls, that correspond to qemu_open calls, to qemu_close. Signed-off-by: Corey Bryant --- v5: -This patch is new in v5. (kw...@redhat.com, ebl...@redhat.com) v6-v9: -No changes block/raw-posix.c | 24 block/raw-win32.c

[Qemu-devel] [PATCH v9 4/7] block: Convert open calls to qemu_open

2012-08-11 Thread Corey Bryant
This patch converts all block layer open calls to qemu_open. Note that this adds the O_CLOEXEC flag to the changed open paths when the O_CLOEXEC macro is defined. Signed-off-by: Corey Bryant --- v2: -Convert calls to qemu_open instead of file_open (kw...@redhat.com) -Mention introduction of

[Qemu-devel] [PATCH v9 7/7] monitor: Clean up fd sets on monitor disconnect

2012-08-11 Thread Corey Bryant
client disconnect prior to using a passed fd. Signed-off-by: Corey Bryant --- v5: -This patch is new in v5. -This support addresses concerns from v4 regarding fd leakage if the client disconnects unexpectedly. (ebl...@redhat.com, kw...@redhat.com, dberra...@redhat.com) v6: -No changes v7

[Qemu-devel] [PATCH v9 1/7] qemu-char: Add MSG_CMSG_CLOEXEC flag to recvmsg

2012-08-11 Thread Corey Bryant
Set the close-on-exec flag for the file descriptor received via SCM_RIGHTS. Signed-off-by: Corey Bryant --- v4 -This patch is new in v4 (ebl...@redhat.com) v5 -Fallback to FD_CLOEXEC if MSG_CMSG_CLOEXEC is not available (ebl...@redhat.com, stefa...@linux.vnet.ibm.com) v6 -Set cloexec on

[Qemu-devel] [PATCH v9 2/7] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-11 Thread Corey Bryant
etfd and closefd QMP commands. Signed-off-by: Corey Bryant --- v5: -This patch is new in v5 and replaces the pass-fd QMP command from v4. -By grouping fds in fd sets, we ease managability with an fd set per file, addressing concerns raised in v4 about handling "reopens" and preventing

Re: [Qemu-devel] [PATCH v9 5/7] block: Convert close calls to qemu_close

2012-08-13 Thread Corey Bryant
On 08/11/2012 09:22 AM, Blue Swirl wrote: On Sat, Aug 11, 2012 at 1:14 PM, Corey Bryant wrote: This patch converts all block layer close calls, that correspond to qemu_open calls, to qemu_close. Signed-off-by: Corey Bryant --- v5: -This patch is new in v5. (kw...@redhat.com, ebl

Re: [Qemu-devel] [PATCH v9 2/7] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-13 Thread Corey Bryant
I'll send a new version shortly with these updates. -- Regards, Corey On 08/11/2012 10:16 AM, Eric Blake wrote: On 08/11/2012 07:14 AM, Corey Bryant wrote: This patch adds support that enables passing of file descriptors to the QEMU monitor where they will be stored in specified

Re: [Qemu-devel] [PATCH v9 2/7] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-13 Thread Corey Bryant
I'll send a new version shortly with these updates. -- Regards, Corey On 08/11/2012 10:16 AM, Eric Blake wrote: On 08/11/2012 07:14 AM, Corey Bryant wrote: This patch adds support that enables passing of file descriptors to the QEMU monitor where they will be stored in specified

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 match

[Qemu-devel] [PATCH v10 1/7] qemu-char: Add MSG_CMSG_CLOEXEC flag to recvmsg

2012-08-13 Thread Corey Bryant
Set the close-on-exec flag for the file descriptor received via SCM_RIGHTS. Signed-off-by: Corey Bryant --- v4 -This patch is new in v4 (ebl...@redhat.com) v5 -Fallback to FD_CLOEXEC if MSG_CMSG_CLOEXEC is not available (ebl...@redhat.com, stefa...@linux.vnet.ibm.com) v6 -Set cloexec on

[Qemu-devel] [PATCH v10 4/7] block: Convert open calls to qemu_open

2012-08-13 Thread Corey Bryant
This patch converts all block layer open calls to qemu_open. Note that this adds the O_CLOEXEC flag to the changed open paths when the O_CLOEXEC macro is defined. Signed-off-by: Corey Bryant --- v2: -Convert calls to qemu_open instead of file_open (kw...@redhat.com) -Mention introduction of

[Qemu-devel] [PATCH v10 5/7] block: Convert close calls to qemu_close

2012-08-13 Thread Corey Bryant
This patch converts all block layer close calls, that correspond to qemu_open calls, to qemu_close. Signed-off-by: Corey Bryant --- v5: -This patch is new in v5. (kw...@redhat.com, ebl...@redhat.com) v6-v9: -No changes v10: -Don't use underscore prefix on functions. (blauwir...@gmai

[Qemu-devel] [PATCH v10 3/7] block: Prevent detection of /dev/fdset/ as floppy

2012-08-13 Thread Corey Bryant
Signed-off-by: Corey Bryant --- v8 -This patch is new in v8. It was reported on a prior fd passing approach and I realized it's needed in this series. (kw...@redhat.com) v9-v10 -No changes block/raw-posix.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/

[Qemu-devel] [PATCH v10 2/7] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-13 Thread Corey Bryant
etfd and closefd QMP commands. Signed-off-by: Corey Bryant --- v5: -This patch is new in v5 and replaces the pass-fd QMP command from v4. -By grouping fds in fd sets, we ease managability with an fd set per file, addressing concerns raised in v4 about handling "reopens" and preventing

[Qemu-devel] [PATCH v10 7/7] monitor: Clean up fd sets on monitor disconnect

2012-08-13 Thread Corey Bryant
client disconnect prior to using a passed fd. Signed-off-by: Corey Bryant --- v5: -This patch is new in v5. -This support addresses concerns from v4 regarding fd leakage if the client disconnects unexpectedly. (ebl...@redhat.com, kw...@redhat.com, dberra...@redhat.com) v6: -No changes v7

[Qemu-devel] [PATCH v10 0/7] file descriptor passing using fd sets

2012-08-13 Thread Corey Bryant
nfs_t). The virt_use_nfs boolean type simply needs to be set to false, and open will be prevented (and dup will be allowed). For example: # setsebool virt_use_nfs 0 # getsebool virt_use_nfs virt_use_nfs --> off Corey Bryant (7): qemu-char: Add MSG_CMSG_CLOEXEC flag to recvms

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

2012-08-13 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 Brya

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;

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

Re: [Qemu-devel] [PATCH v10 0/7] file descriptor passing using fd sets

2012-08-13 Thread Corey Bryant
On 08/13/2012 02:02 PM, Eric Blake wrote: On 08/13/2012 08:08 AM, Corey Bryant wrote: libvirt's sVirt security driver provides SELinux MAC isolation for Qemu guest processes and their corresponding image files. In other words, sVirt uses SELinux to prevent a QEMU process from opening

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

2012-08-14 Thread Corey Bryant
On 08/14/2012 08:07 AM, Kevin Wolf wrote: Am 13.08.2012 16: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

[Qemu-devel] [PATCH v11 4/7] block: Convert open calls to qemu_open

2012-08-14 Thread Corey Bryant
This patch converts all block layer open calls to qemu_open. Note that this adds the O_CLOEXEC flag to the changed open paths when the O_CLOEXEC macro is defined. Signed-off-by: Corey Bryant --- v2: -Convert calls to qemu_open instead of file_open (kw...@redhat.com) -Mention introduction of

[Qemu-devel] [PATCH v11 3/7] block: Prevent detection of /dev/fdset/ as floppy

2012-08-14 Thread Corey Bryant
Signed-off-by: Corey Bryant --- v8 -This patch is new in v8. It was reported on a prior fd passing approach and I realized it's needed in this series. (kw...@redhat.com) v9-v11 -No changes block/raw-posix.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/

[Qemu-devel] [PATCH v11 5/7] block: Convert close calls to qemu_close

2012-08-14 Thread Corey Bryant
This patch converts all block layer close calls, that correspond to qemu_open calls, to qemu_close. Signed-off-by: Corey Bryant --- v5: -This patch is new in v5. (kw...@redhat.com, ebl...@redhat.com) v6-v9: -No changes v10: -Don't use underscore prefix on functions. (blauwir...@gmai

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

2012-08-14 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 Brya

[Qemu-devel] [PATCH v11 0/7] file descriptor passing using fd sets

2012-08-14 Thread Corey Bryant
nfs_t). The virt_use_nfs boolean type simply needs to be set to false, and open will be prevented (and dup will be allowed). For example: # setsebool virt_use_nfs 0 # getsebool virt_use_nfs virt_use_nfs --> off Corey Bryant (7): qemu-char: Add MSG_CMSG_CLOEXEC flag to recvms

[Qemu-devel] [PATCH v11 7/7] monitor: Clean up fd sets on monitor disconnect

2012-08-14 Thread Corey Bryant
client disconnect prior to using a passed fd. Signed-off-by: Corey Bryant --- v5: -This patch is new in v5. -This support addresses concerns from v4 regarding fd leakage if the client disconnects unexpectedly. (ebl...@redhat.com, kw...@redhat.com, dberra...@redhat.com) v6: -No changes v7

[Qemu-devel] [PATCH v11 1/7] qemu-char: Add MSG_CMSG_CLOEXEC flag to recvmsg

2012-08-14 Thread Corey Bryant
Set the close-on-exec flag for the file descriptor received via SCM_RIGHTS. Signed-off-by: Corey Bryant --- v4 -This patch is new in v4 (ebl...@redhat.com) v5 -Fallback to FD_CLOEXEC if MSG_CMSG_CLOEXEC is not available (ebl...@redhat.com, stefa...@linux.vnet.ibm.com) v6 -Set cloexec on

[Qemu-devel] [PATCH v11 2/7] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-14 Thread Corey Bryant
etfd and closefd QMP commands. Signed-off-by: Corey Bryant --- v5: -This patch is new in v5 and replaces the pass-fd QMP command from v4. -By grouping fds in fd sets, we ease managability with an fd set per file, addressing concerns raised in v4 about handling "reopens" and preventing

Re: [Qemu-devel] [PATCH for-1.2] osdep: Fix compilation failure on BSD systems

2012-08-16 Thread Corey Bryant
On 08/16/2012 07:15 AM, Peter Maydell wrote: Fix compilation failure on BSD systems (which don't have O_DIRECT or O_NOATIME: osdep.c:116: error: ‘O_DIRECT’ undeclared (first use in this function) osdep.c:116: error: (Each undeclared identifier is reported only once osdep.c:116: error: for each

Re: [Qemu-devel] Is is possible to virtualise or share the TPM?

2012-08-23 Thread Corey Bryant
On 08/21/2012 06:31 AM, Jordi Cucurull Juan wrote: Dear all, After applying the TPM patches to QEMU, I was wondering if it is possible to simultaneously use the TPM in more than one virtual machine, i.e. virtualisation of the TPM. According to the paper "Stefan Berger, Ramón Cáceres, Kenneth

[Qemu-devel] [RFC PATCH 1/4] qemu-options: Add -filefd command line option

2012-05-21 Thread Corey Bryant
This patch provides support for the -filefd command line option. This option will allow passing of a filename and its corresponding file descriptor to QEMU at exec time. Signed-off-by: Corey Bryant --- qemu-config.c | 17 + qemu-config.h |1 + qemu-options.hx | 17

[Qemu-devel] [RFC PATCH 4/4] Example -filefd and getfd_file server

2012-05-21 Thread Corey Bryant
method. Usage: ./test-fd-passing /path/hda.img /path/hdb.img /path/hdc.img Signed-off-by: Corey Bryant --- test-fd-passing.c | 224 + 1 files changed, 224 insertions(+), 0 deletions(-) create mode 100644 test-fd-passing.c diff --git a/test-fd

<    1   2   3   4   5   6   >