From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sba9O-00089o-Ma for qemu-devel@nongnu.org; Mon, 04 Jun 2012 12:29:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sba9J-0004Xm-M6 for qemu-devel@nongnu.org; Mon, 04 Jun 2012 12:29:02 -0400 Received: from e1.ny.us.ibm.com ([32.97.182.141]:51782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sba9J-0004XH-I1 for qemu-devel@nongnu.org; Mon, 04 Jun 2012 12:28:57 -0400 Received: from /spool/local by e1.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 4 Jun 2012 12:28:53 -0400 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 3AA9B38C84E4 for ; Mon, 4 Jun 2012 12:16:09 -0400 (EDT) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q54GG8jI122734 for ; Mon, 4 Jun 2012 12:16:08 -0400 Received: from d03av05.boulder.ibm.com (loopback [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q54GFsUh029751 for ; Mon, 4 Jun 2012 10:15:55 -0600 Message-ID: <4FCCDF33.2060306@linux.vnet.ibm.com> Date: Mon, 04 Jun 2012 12:15:47 -0400 From: Corey Bryant 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> <4FCCCDCE.2080903@redhat.com> In-Reply-To: <4FCCCDCE.2080903@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed 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: Kevin Wolf Cc: aliguori@us.ibm.com, eblake@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com On 06/04/2012 11:01 AM, Kevin Wolf wrote: > 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? > This was just for reference. It was the majority of my code (unit test) so I figured I'd share it. :) > 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). I won't promise anything but if I get a chance to convert to a Python test I will. -- Regards, Corey