From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbYnr-0000tH-Cc for qemu-devel@nongnu.org; Mon, 04 Jun 2012 11:02:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbYnl-0006AC-4W for qemu-devel@nongnu.org; Mon, 04 Jun 2012 11:02:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbYnk-00069o-SU for qemu-devel@nongnu.org; Mon, 04 Jun 2012 11:02:37 -0400 Message-ID: <4FCCCDCE.2080903@redhat.com> Date: Mon, 04 Jun 2012 17:01:34 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1338815410-24890-1-git-send-email-coreyb@linux.vnet.ibm.com> <1338815410-24890-4-git-send-email-coreyb@linux.vnet.ibm.com> In-Reply-To: <1338815410-24890-4-git-send-email-coreyb@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] Sample server that opens image files for QEMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corey Bryant Cc: aliguori@us.ibm.com, eblake@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com Am 04.06.2012 15:10, schrieb Corey Bryant: > This sample server opens image files and passes the fds to QEMU. The > paths for two image files are passed as parameters, the first being > the boot image, and the second being an image to be hot-attached. The > server will open the files and pass the fds to QEMU in one of two ways: > > 1) Over the command line (using -drive file=/dev/fd/X) or > 2) Via the QMP monitor with the getfd command (using SCM_RIGHTS) > followed by drive_add (using file=/dev/fd/X) and then > device_add. > > Usage: > gcc -Wall -o test-fd-passing test-fd-passing.c -L/usr/local/lib -ljson > ./test-fd-passing /path/hda.img /path/hdb.img > > Note: This requires json-c and json-c-devel packages. > > Signed-off-by: Corey Bryant > --- > test-fd-passing.c | 321 +++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 321 insertions(+) > create mode 100644 test-fd-passing.c Is this meant to be applied or just for reference? Maybe we can make a proper test case out of it that runs during make check? Would probably require that the json-c dependency is dropped, though. Maybe we should rewrite it in Python, as we already have QMP bindings for that (and there are already tests that use them). Kevin