Re: [Qemu-devel] [PATCH 3/9] qtest: add C version of test infrastructure

2012-03-15 Thread Paolo Bonzini
Il 15/03/2012 15:58, Kevin Wolf ha scritto: >> > I believe Kevin suggested using -qtest unix:%s and creating the listen >> > socket in the test program rather than inside QEMU. The advantage is >> > that we never sleep(3), instead we accept(2) the connection from QEMU >> > and get going right away

Re: [Qemu-devel] [PATCH 3/9] qtest: add C version of test infrastructure

2012-03-15 Thread Anthony Liguori
On 03/15/2012 09:42 AM, Stefan Hajnoczi wrote: On Thu, Mar 15, 2012 at 1:37 PM, Anthony Liguori wrote: +sock = socket(PF_UNIX, SOCK_STREAM, 0); +g_assert_no_errno(sock); + +addr.sun_family = AF_UNIX; +snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", socket_path); + +pid

Re: [Qemu-devel] [PATCH 3/9] qtest: add C version of test infrastructure

2012-03-15 Thread Kevin Wolf
Am 15.03.2012 15:42, schrieb Stefan Hajnoczi: > On Thu, Mar 15, 2012 at 1:37 PM, Anthony Liguori wrote: >> +sock = socket(PF_UNIX, SOCK_STREAM, 0); >> +g_assert_no_errno(sock); >> + >> +addr.sun_family = AF_UNIX; >> +snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", socket_path)

Re: [Qemu-devel] [PATCH 3/9] qtest: add C version of test infrastructure

2012-03-15 Thread Stefan Hajnoczi
On Thu, Mar 15, 2012 at 1:37 PM, Anthony Liguori wrote: > +    sock = socket(PF_UNIX, SOCK_STREAM, 0); > +    g_assert_no_errno(sock); > + > +    addr.sun_family = AF_UNIX; > +    snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", socket_path); > + > +    pid = fork(); > +    if (pid == 0) { > +

[Qemu-devel] [PATCH 3/9] qtest: add C version of test infrastructure

2012-03-15 Thread Anthony Liguori
This also includes a qtest wrapper script to make it easier to launch qtest tests directly. Signed-off-by: Anthony Liguori --- scripts/qtest|5 + tests/Makefile |1 + tests/libqtest.c | 334 ++ tests/libqtest.h | 63 ++