[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 12/15] qtest: add support for target-i386 -M pc
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 12/15] qtest: add support for target-i386 -M pc |
Date: |
Thu, 12 Jan 2012 10:25:14 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 |
On 01/11/2012 08:44 PM, Anthony Liguori wrote:
This is easier said than done. I started down this road and there's a
huge amount of code that assumes that first_cpu != NULL.
That's why I said do not create the CPU _threads_. :) But that wouldn't
be a big step forward from halted = 1; for example, it would prevent
using per-CPU work items. Currently they're only used internally by
KVM, but you never know.
So you can also create a CPU thread that does nothing. Here is how it
could look like, based on the KVM implementation:
static void *qemu_qtest_cpu_thread_fn(void *arg)
{
CPUState *env = arg;
int r;
qemu_mutex_lock(&qemu_global_mutex);
qemu_thread_get_self(env->thread);
env->thread_id = qemu_get_thread_id();
sigset_t waitset;
sigemptyset(&waitset);
sigaddset(&waitset, SIG_IPI);
/* signal CPU creation */
env->created = 1;
qemu_cond_signal(&qemu_cpu_cond);
cpu_single_env = env;
while (1) {
cpu_single_env = NULL;
qemu_mutex_unlock_iothread();
do {
int sig;
r = sigwait(&waitset, &sig);
} while (r == -1 && (errno == EAGAIN || errno == EINTR));
if (r == -1) {
perror("sigtimedwait");
exit(1);
}
qemu_mutex_lock_iothread();
cpu_single_env = env;
qemu_wait_io_event_common(env);
}
return NULL;
}
Paolo
- Re: [Qemu-devel] [PATCH 15/15] qtest: add rtc-test test-case, (continued)
[Qemu-devel] [PATCH 08/15] check-qjson: convert to gtest, Anthony Liguori, 2012/01/10
[Qemu-devel] [PATCH 13/15] qtest: add C version of test infrastructure, Anthony Liguori, 2012/01/10
[Qemu-devel] [PATCH 04/15] check-qfloat: convert to gtest, Anthony Liguori, 2012/01/10
[Qemu-devel] [PATCH 10/15] test: eliminate libcheck tests and have make check use gtester, Anthony Liguori, 2012/01/10
[Qemu-devel] [PATCH 12/15] qtest: add support for target-i386 -M pc, Anthony Liguori, 2012/01/10
[Qemu-devel] [PATCH 05/15] check-qint: convert to gtest, Anthony Liguori, 2012/01/10
[Qemu-devel] [PATCH 09/15] check-qjson: enable disabled tests, Anthony Liguori, 2012/01/10
[Qemu-devel] [PATCH 06/15] check-qstring: convert to gtest, Anthony Liguori, 2012/01/10
[Qemu-devel] [PATCH 11/15] qtest: add test framework, Anthony Liguori, 2012/01/10
[Qemu-devel] [PATCH 02/15] build: split unit test builds to a separate makefile fragment, Anthony Liguori, 2012/01/10
[Qemu-devel] [PATCH 07/15] check-qlist: convert to gtest, Anthony Liguori, 2012/01/10
Re: [Qemu-devel] [PATCH 01/15] tests: mv tests/* -> tests/tcg, Andreas Färber, 2012/01/10
Re: [Qemu-devel] [PATCH 01/15] tests: mv tests/* -> tests/tcg, Anthony Liguori, 2012/01/12