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

2012-01-18 Thread Anthony Liguori
On 01/18/2012 10:00 AM, Kevin Wolf wrote: Am 13.01.2012 19:32, schrieb Anthony Liguori: This also includes a qtest wrapper script to make it easier to launch qtest tests directly. Signed-off-by: Anthony Liguori +QTestState *qtest_init(const char *extra_args) +{ +QTestState *s; +struc

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

2012-01-18 Thread Paolo Bonzini
On 01/18/2012 05:00 PM, Kevin Wolf wrote: > +do { > +sleep(1); This is the line that takes the greatest part of the time for make check-qtest. Can we use some shorter delay if it's required at all? You can use a client socket, listen before spawning QEMU and accept afterwards.

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

2012-01-18 Thread Kevin Wolf
Am 13.01.2012 19:32, schrieb Anthony Liguori: > This also includes a qtest wrapper script to make it easier to launch qtest > tests directly. > > Signed-off-by: Anthony Liguori > +QTestState *qtest_init(const char *extra_args) > +{ > +QTestState *s; > +struct sockaddr_un addr; > +int

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

2012-01-17 Thread Paolo Bonzini
On 01/13/2012 07:32 PM, Anthony Liguori wrote: This also includes a qtest wrapper script to make it easier to launch qtest tests directly. Signed-off-by: Anthony Liguori Here is a Python test harness for qtest. I haven't tried merging them with the makefiles. Feel free to add my s-o-b and

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

2012-01-17 Thread Stefan Hajnoczi
On Tue, Jan 17, 2012 at 1:33 PM, Paolo Bonzini wrote: > On 01/17/2012 12:33 PM, Stefan Hajnoczi wrote: >> >> I was wondering about a qemu-side solution where a closed qtest socket >> means we need to shut down, but am not sure if the chardev code lets >> us do that.  (Really we want POLLHUP but we

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

2012-01-17 Thread Paolo Bonzini
On 01/17/2012 12:33 PM, Stefan Hajnoczi wrote: I was wondering about a qemu-side solution where a closed qtest socket means we need to shut down, but am not sure if the chardev code lets us do that. (Really we want POLLHUP but we only seem to have POLLIN/POLLOUT handlers.) For poll, both POLLI

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

2012-01-17 Thread Stefan Hajnoczi
On Fri, Jan 13, 2012 at 6:32 PM, Anthony Liguori wrote: > +    pid = fork(); > +    if (pid == 0) { > +        command = g_strdup_printf("%s " > +                                  "-qtest unix:%s,server,nowait " > +                                  "-qtest-log /dev/null " > +                      

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

2012-01-13 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 |2 + tests/libqtest.c | 334 ++ tests/libqtest.h | 63 ++