[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/15] qtest: add support for target-i386 -M pc
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 12/15] qtest: add support for target-i386 -M pc |
Date: |
Tue, 10 Jan 2012 13:10:53 -0600 |
This involves forcing the CPU into the halted state if qtest is enabled and
replacing the local APIC with the qtest interrupt controller.
It should be pretty straight forward to do the same for other machine types on
other architectures.
Signed-off-by: Anthony Liguori <address@hidden>
---
hw/pc.c | 7 ++++++-
hw/pc_piix.c | 9 ++++++---
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c
index 85304cf..fac5098 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -43,6 +43,7 @@
#include "ui/qemu-spice.h"
#include "memory.h"
#include "exec-memory.h"
+#include "qtest.h"
/* output Bochs bios info messages */
//#define DEBUG_BIOS
@@ -926,7 +927,11 @@ static void pc_cpu_reset(void *opaque)
CPUState *env = opaque;
cpu_reset(env);
- env->halted = !cpu_is_bsp(env);
+ if (qtest_enabled()) {
+ env->halted = 1;
+ } else {
+ env->halted = !cpu_is_bsp(env);
+ }
}
static CPUState *pc_new_cpu(const char *cpu_model)
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index b70431f..2aba89c 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -46,6 +46,7 @@
#ifdef CONFIG_XEN
# include <xen/hvm/hvm_info_table.h>
#endif
+#include "qtest.h"
#define MAX_IDE_BUS 2
@@ -154,11 +155,13 @@ static void pc_init1(MemoryRegion *system_memory,
}
isa_bus_irqs(isa_bus, gsi);
- if (!xen_enabled()) {
+ if (xen_enabled()) {
+ i8259 = xen_interrupt_controller_init();
+ } else if (qtest_enabled()) {
+ i8259 = qtest_interrupt_controller_init();
+ } else {
cpu_irq = pc_allocate_cpu_irq();
i8259 = i8259_init(isa_bus, cpu_irq[0]);
- } else {
- i8259 = xen_interrupt_controller_init();
}
for (i = 0; i < ISA_NUM_IRQS; i++) {
--
1.7.4.1
- [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 <=
[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