From: Anthony Liguori <aliguori@us.ibm.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/9] qtest: add C version of test infrastructure
Date: Thu, 15 Mar 2012 10:03:03 -0500 [thread overview]
Message-ID: <4F6204A7.3070606@us.ibm.com> (raw)
In-Reply-To: <CAJSP0QWdNTZXAKWxLsw4LkkN5zS87p7WpdxvqTDB57TtW-2HOg@mail.gmail.com>
On 03/15/2012 09:42 AM, Stefan Hajnoczi wrote:
> On Thu, Mar 15, 2012 at 1:37 PM, Anthony Liguori<aliguori@us.ibm.com> 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) {
>> + command = g_strdup_printf("%s "
>> + "-qtest unix:%s,server,nowait "
>> + "-qtest-log /dev/null "
>> + "-pidfile %s "
>> + "-machine accel=qtest "
>> + "%s", qemu_binary, socket_path,
>> + pid_file,
>> + extra_args ?: "");
>> +
>> + ret = system(command);
>> + exit(ret);
>> + g_free(command);
>> + }
>> +
>> + do {
>> + sleep(1);
>> + ret = connect(sock, (struct sockaddr *)&addr, sizeof(addr));
>> + } while (ret == -1);
>
> 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.
Yeah, I missed that, it's an easy change to make. I'll update.
Regards,
Anthony Liguori
>
> This can be added as a patch later.
>
> Kevin: Do you already have a patch or does someone need to write it?
>
> Stefan
>
next prev parent reply other threads:[~2012-03-15 15:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-15 13:37 [Qemu-devel] [PATCH 0/9] qtest: a testing framework for devices (v3) Anthony Liguori
2012-03-15 13:37 ` [Qemu-devel] [PATCH 1/9] w32: Support tests (make check) Anthony Liguori
2012-03-15 13:37 ` [Qemu-devel] [PATCH 2/9] qtest: add test framework (v3) Anthony Liguori
2012-03-15 13:37 ` [Qemu-devel] [PATCH 3/9] qtest: add C version of test infrastructure Anthony Liguori
2012-03-15 14:42 ` Stefan Hajnoczi
2012-03-15 14:58 ` Kevin Wolf
2012-03-15 15:04 ` Paolo Bonzini
2012-03-15 15:03 ` Anthony Liguori [this message]
2012-03-15 13:37 ` [Qemu-devel] [PATCH 4/9] make: add check targets based on gtester (v2) Anthony Liguori
2012-03-15 15:08 ` Paolo Bonzini
2012-03-15 13:37 ` [Qemu-devel] [PATCH 5/9] qtest: IRQ interception infrastructure (v2) Anthony Liguori
2012-03-15 13:37 ` [Qemu-devel] [PATCH 6/9] libqtest: add IRQ intercept commands Anthony Liguori
2012-03-15 13:37 ` [Qemu-devel] [PATCH 7/9] rtc: split out macros into a header file and use in test case Anthony Liguori
2012-03-15 13:37 ` [Qemu-devel] [PATCH 8/9] qtest: add rtc-test test-case (v3) Anthony Liguori
2012-03-15 13:37 ` [Qemu-devel] [PATCH 9/9] qtest: add clock management Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F6204A7.3070606@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).