From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPFGI-0005pP-Bw for qemu-devel@nongnu.org; Tue, 01 May 2012 11:45:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SPFGG-0005um-Hw for qemu-devel@nongnu.org; Tue, 01 May 2012 11:45:09 -0400 Received: from e06smtp18.uk.ibm.com ([195.75.94.114]:58043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPF40-0001Bq-7D for qemu-devel@nongnu.org; Tue, 01 May 2012 11:32:28 -0400 Received: from /spool/local by e06smtp18.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 May 2012 16:32:02 +0100 Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q41FW0NT2814100 for ; Tue, 1 May 2012 16:32:00 +0100 Received: from d06av05.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q41FVx48032689 for ; Tue, 1 May 2012 09:31:59 -0600 From: Stefan Hajnoczi Date: Tue, 1 May 2012 16:31:44 +0100 Message-Id: <1335886307-27586-3-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1335886307-27586-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1335886307-27586-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC 2/5] block: add new command line parameter that and protocol description List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi , libvir-list@redhat.com, Corey Bryant From: Anthony Liguori Signed-off-by: Anthony Liguori Signed-off-by: Stefan Hajnoczi --- qemu-options.hx | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index a169792..ccf4d1d 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2724,6 +2724,48 @@ DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "-qtest-log LOG specify tracing options\n", QEMU_ARCH_ALL) +DEF("open-hook-fd", HAS_ARG, QEMU_OPTION_open_hook_fd, + "-open-hook-fd \n" + " delegate opens to external process using \n", QEMU_ARCH_ALL) +STEXI +@item -open-hook-fd @var{fd} +@findex -open-hook-fd +Delegates open()s to an external process using @var to communicate commands. +@var should be an open Unix Domain socket pipe that file descriptors can be +received from. The protocol the socket uses is a simple request/response initiated +by the client. All integers are in host byte order. It is assumed that this protocol +is only ever used on the same physical machine. It is currently defined as: + +u32 message_size +u32 command +u8 payload[message_size - 8] + +The contents of payload depend on command. Currently the following commands are +defined: + +1. QEMU_OPEN (1) + +The full message will be: + +u32 message_size +u32 command = 1 +u32 flags (O_ flags defined by libc) +u32 mode (mode_t flags as defined by libc) +u16 filename_len; +u8 filename[filename_len] + +The server will then respond with: + +u32 message_size +u32 command = 1 +s32 result + +If result is < 0, the value will be negated errno value as defined in errno.h. If +result is equal to 0, then there will also be a file descriptor available via SCM_RIGHTS +in the extended sendmsg data. + +ETEXI + HXCOMM This is the last statement. Insert new options before this line! STEXI @end table -- 1.7.10