mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
commit
3fa276f635
22 files changed
+364
-10
No files matched your search
@@ -847,7 +847,8 @@ def deprecated(old,new):
|
||||
|
||||
def usage(cmd=None):
|
||||
if cmd == 'create':
|
||||
xm_subcommand("create", "--help")
|
||||
mycmd = xm_lookup_cmd(cmd)
|
||||
mycmd( ['--help'] )
|
||||
sys.exit(1)
|
||||
if help.has_key(cmd):
|
||||
print " " + help[cmd]
|
||||
|
||||
@@ -50,6 +50,7 @@ AC_CONFIG_FILES([
|
||||
tests/memmax/Makefile
|
||||
tests/memset/Makefile
|
||||
tests/migrate/Makefile
|
||||
tests/network-attach/Makefile
|
||||
tests/pause/Makefile
|
||||
tests/reboot/Makefile
|
||||
tests/restore/Makefile
|
||||
|
||||
@@ -161,6 +161,29 @@ def timeStamp():
|
||||
print "*** Test %s started at %s %s" % (name, t,
|
||||
time.tzname[time.daylight])
|
||||
|
||||
#
|
||||
# Try to start a domain and attach a console to it to see if
|
||||
# the console system is working
|
||||
#
|
||||
def isConsoleDead():
|
||||
|
||||
from XmTestLib import XmTestDomain, DomainError, XmConsole, ConsoleError
|
||||
|
||||
domain = XmTestDomain()
|
||||
|
||||
try:
|
||||
domain.start()
|
||||
console = XmConsole(domain.getName())
|
||||
except DomainError, e:
|
||||
return True
|
||||
except ConsoleError, e:
|
||||
return True
|
||||
|
||||
domain.destroy()
|
||||
|
||||
return False
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
timeStamp()
|
||||
|
||||
@@ -13,6 +13,7 @@ SUBDIRS = \
|
||||
list \
|
||||
memmax \
|
||||
memset \
|
||||
network-attach \
|
||||
pause \
|
||||
reboot \
|
||||
sedf \
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
# Copyright (C) International Business Machines Corp., 2005
|
||||
# Author: Dan Smith <danms@us.ibm.com>
|
||||
|
||||
from XmTestLib import *
|
||||
|
||||
# Mount /dev/ram0
|
||||
|
||||
s, o = traceCommand("mkfs /dev/ram0")
|
||||
if s != 0:
|
||||
FAIL("Unable to mkfs /dev/ram0")
|
||||
|
||||
s, o = traceCommand("mkdir -p mnt");
|
||||
if s != 0:
|
||||
FAIL("Unable to create ./mnt")
|
||||
|
||||
s, o = traceCommand("mount /dev/ram0 mnt -o rw")
|
||||
if s != 0:
|
||||
FAIL("Unable to mount /dev/ram0 on ./mnt")
|
||||
|
||||
# Now try to start a DomU with write access to /dev/ram0
|
||||
|
||||
domain = XmTestDomain();
|
||||
domain.configAddDisk("phy:/dev/ram0", "hda1", "w")
|
||||
|
||||
try:
|
||||
domain.start()
|
||||
s, o = traceCommand("umount mnt")
|
||||
FAIL("Bug #331: Started a DomU with write access to a rw mounted block device")
|
||||
except DomainError, e:
|
||||
s, o = traceCommand("umount mnt")
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
# Copyright (C) International Business Machines Corp., 2005
|
||||
# Author: Dan Smith <danms@us.ibm.com>
|
||||
|
||||
from XmTestLib import *
|
||||
|
||||
dom1 = XmTestDomain()
|
||||
dom2 = XmTestDomain(dom1.getName() + "-2")
|
||||
|
||||
dom1.configAddDisk("phy:/dev/ram0", "hda1", "w")
|
||||
dom2.configAddDisk("phy:/dev/ram0", "hda1", "w")
|
||||
|
||||
try:
|
||||
dom1.start()
|
||||
except DomainError, e:
|
||||
FAIL("Unable to start domain")
|
||||
|
||||
try:
|
||||
dom2.start()
|
||||
FAIL("Bug #331: Started a DomU with write access to an in-use block device")
|
||||
except DomainError, e:
|
||||
pass
|
||||
|
||||
@@ -8,7 +8,9 @@ TESTS = 01_block_attach_device_pos.test \
|
||||
06_block_attach_baddomain_neg.test \
|
||||
07_block_attach_baddevice_neg.test \
|
||||
08_block_attach_bad_filedevice_neg.test \
|
||||
09_block_attach_and_dettach_device_check_data_pos.test
|
||||
09_block_attach_and_dettach_device_check_data_pos.test \
|
||||
11_block_attach_shared_dom0.test \
|
||||
12_block_attach_shared_domU.test
|
||||
|
||||
DISABLED =
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ if status != 0:
|
||||
FAIL("xm mem-set %s %i returned invalid %i != 0" %
|
||||
(domain.getName(), domain.minSafeMem(), status))
|
||||
|
||||
console.setLimit(8192)
|
||||
console.setLimit(65536)
|
||||
|
||||
try:
|
||||
# See if this hits the byte limit
|
||||
@@ -39,13 +39,15 @@ except ConsoleError, e:
|
||||
if e.reason == RUNAWAY:
|
||||
# Need to stop the domain before we restart the console daemon
|
||||
domain.destroy()
|
||||
if verbose:
|
||||
if isConsoleDead():
|
||||
print "*** Attempting restart of xenconsoled"
|
||||
s, o = traceCommand("killall xenconsoled")
|
||||
s, o = traceCommand("xenconsoled")
|
||||
if s != 0:
|
||||
print "*** Starting xenconsoled failed: %i" % s
|
||||
FAIL("Bug #380: I crashed the console system")
|
||||
FAIL("Bug #380: I crashed the console system")
|
||||
else:
|
||||
FAIL("Bug #145: Ballooning DomU too low caused run-away")
|
||||
else:
|
||||
FAIL(str(e))
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
# Copyright (C) International Business Machines Corp., 2005
|
||||
# Author: Murillo F. Bernardes <mfb@br.ibm.com>
|
||||
|
||||
import sys
|
||||
|
||||
from XmTestLib import *
|
||||
from network_utils import *
|
||||
|
||||
# Create a domain (default XmTestDomain, with our ramdisk)
|
||||
domain = XmTestDomain()
|
||||
|
||||
try:
|
||||
domain.start()
|
||||
except DomainError, e:
|
||||
if verbose:
|
||||
print "Failed to create test domain because:"
|
||||
print e.extra
|
||||
FAIL(str(e))
|
||||
|
||||
# Attach a console to it
|
||||
try:
|
||||
console = XmConsole(domain.getName(), historySaveCmds=True)
|
||||
except ConsoleError, e:
|
||||
FAIL(str(e))
|
||||
|
||||
try:
|
||||
# Activate the console
|
||||
console.sendInput("input")
|
||||
# Run 'ls'
|
||||
run = console.runCmd("ls")
|
||||
except ConsoleError, e:
|
||||
saveLog(console.getHistory())
|
||||
FAIL(str(e))
|
||||
|
||||
## Real test
|
||||
status, msg = network_attach(domain.getName(), console)
|
||||
if status:
|
||||
FAIL(msg)
|
||||
|
||||
|
||||
##
|
||||
# Close the console
|
||||
console.closeConsole()
|
||||
|
||||
# Stop the domain (nice shutdown)
|
||||
domain.stop()
|
||||
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
# Copyright (C) International Business Machines Corp., 2005
|
||||
# Author: Murillo F. Bernardes <mfb@br.ibm.com>
|
||||
|
||||
import sys
|
||||
import re
|
||||
import time
|
||||
|
||||
from XmTestLib import *
|
||||
from network_utils import *
|
||||
|
||||
# Create a domain (default XmTestDomain, with our ramdisk)
|
||||
domain = XmTestDomain()
|
||||
|
||||
try:
|
||||
domain.start()
|
||||
except DomainError, e:
|
||||
if verbose:
|
||||
print "Failed to create test domain because:"
|
||||
print e.extra
|
||||
FAIL(str(e))
|
||||
|
||||
# Attach a console to it
|
||||
try:
|
||||
console = XmConsole(domain.getName(), historySaveCmds=True)
|
||||
except ConsoleError, e:
|
||||
FAIL(str(e))
|
||||
|
||||
try:
|
||||
# Activate the console
|
||||
console.sendInput("input")
|
||||
# Run 'ls'
|
||||
run = console.runCmd("ls")
|
||||
except ConsoleError, e:
|
||||
saveLog(console.getHistory())
|
||||
FAIL(str(e))
|
||||
|
||||
## Real test - attach and detach
|
||||
status, msg = network_attach(domain.getName(), console)
|
||||
if status:
|
||||
FAIL(msg)
|
||||
|
||||
status, msg = network_detach(domain.getName(), console)
|
||||
if status:
|
||||
FAIL(msg)
|
||||
|
||||
|
||||
|
||||
# Close the console
|
||||
console.closeConsole()
|
||||
|
||||
# Stop the domain (nice shutdown)
|
||||
domain.stop()
|
||||
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
# Copyright (C) International Business Machines Corp., 2005
|
||||
# Author: Murillo F. Bernardes <mfb@br.ibm.com>
|
||||
|
||||
import sys
|
||||
import re
|
||||
import time
|
||||
|
||||
from XmTestLib import *
|
||||
from network_utils import *
|
||||
|
||||
# Create a domain (default XmTestDomain, with our ramdisk)
|
||||
domain = XmTestDomain()
|
||||
|
||||
try:
|
||||
domain.start()
|
||||
except DomainError, e:
|
||||
if verbose:
|
||||
print "Failed to create test domain because:"
|
||||
print e.extra
|
||||
FAIL(str(e))
|
||||
|
||||
# Attach a console to it
|
||||
try:
|
||||
console = XmConsole(domain.getName(), historySaveCmds=True)
|
||||
except ConsoleError, e:
|
||||
FAIL(str(e))
|
||||
|
||||
try:
|
||||
# Activate the console
|
||||
console.sendInput("input")
|
||||
# Run 'ls'
|
||||
run = console.runCmd("ls")
|
||||
except ConsoleError, e:
|
||||
saveLog(console.getHistory())
|
||||
FAIL(str(e))
|
||||
|
||||
for i in range(10):
|
||||
print "Attaching %d device" % i
|
||||
status, msg = network_attach(domain.getName(), console)
|
||||
if status:
|
||||
FAIL(msg)
|
||||
|
||||
print "Detaching %d device" % i
|
||||
status, msg = network_detach(domain.getName(), console, i)
|
||||
if status:
|
||||
FAIL(msg)
|
||||
|
||||
# Close the console
|
||||
console.closeConsole()
|
||||
|
||||
# Stop the domain (nice shutdown)
|
||||
domain.stop()
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
# Copyright (C) International Business Machines Corp., 2005
|
||||
# Author: Murillo F. Bernardes <mfb@br.ibm.com>
|
||||
|
||||
from XmTestLib import *
|
||||
|
||||
status, output = traceCommand("xm network-attach NOT-EXIST")
|
||||
|
||||
eyecatcher = "Error"
|
||||
where = output.find(eyecatcher)
|
||||
if status == 0:
|
||||
FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status )
|
||||
elif where == -1:
|
||||
FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output )
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
SUBDIRS =
|
||||
|
||||
TESTS = 01_network_attach_pos.test \
|
||||
02_network_attach_detach_pos.test \
|
||||
03_network_attach_detach_multiple_pos.test \
|
||||
04_network_attach_baddomain_neg.test
|
||||
|
||||
DISABLED =
|
||||
|
||||
EXTRA_DIST = $(TESTS) $(XFAIL_TESTS) network_utils.py
|
||||
|
||||
TESTS_ENVIRONMENT=@TENV@
|
||||
|
||||
%.test: %.py
|
||||
cp $< $@
|
||||
chmod +x $@
|
||||
|
||||
clean-local: am_config_clean-local
|
||||
|
||||
am_config_clean-local:
|
||||
rm -f *test
|
||||
rm -f *log
|
||||
rm -f *~
|
||||
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
# Copyright (C) International Business Machines Corp., 2005
|
||||
# Author: Murillo F. Bernardes <mfb@br.ibm.com>
|
||||
|
||||
from XmTestLib import *
|
||||
|
||||
def count_eth(console):
|
||||
try:
|
||||
run = console.runCmd("ifconfig -a | grep eth")
|
||||
except ConsoleError, e:
|
||||
FAIL(str(e))
|
||||
return = len(run['output'].splitlines())
|
||||
|
||||
def network_attach(domain_name, console):
|
||||
eths_before = count_eth(console)
|
||||
status, output = traceCommand("xm network-attach %s" % domain_name)
|
||||
if status != 0:
|
||||
return -1, "xm network-attach returned invalid %i != 0" % status
|
||||
|
||||
eths_after = count_eth(console)
|
||||
if (eths_after != (eths_before+1)):
|
||||
return -2, "Network device is not actually connected to domU"
|
||||
|
||||
return 0, None
|
||||
|
||||
def network_detach(domain_name, console, num=0):
|
||||
eths_before = count_eth(console)
|
||||
status, output = traceCommand("xm network-detach %s %d" % (domain_name, num))
|
||||
if status != 0:
|
||||
return -1, "xm network-attach returned invalid %i != 0" % status
|
||||
|
||||
eths_after = count_eth(console)
|
||||
if eths_after != (eths_before-1):
|
||||
return -2, "Network device was not actually disconnected from domU"
|
||||
|
||||
return 0, None
|
||||
@@ -602,7 +602,8 @@ acpi_process_madt(void)
|
||||
error = acpi_parse_madt_lapic_entries();
|
||||
if (!error) {
|
||||
acpi_lapic = 1;
|
||||
|
||||
generic_bigsmp_probe();
|
||||
|
||||
/*
|
||||
* Parse MADT IO-APIC entries
|
||||
*/
|
||||
|
||||
@@ -45,7 +45,10 @@ static struct dmi_system_id __initdata bigsmp_dmi_table[] = {
|
||||
|
||||
static __init int probe_bigsmp(void)
|
||||
{
|
||||
dmi_check_system(bigsmp_dmi_table);
|
||||
if (def_to_bigsmp)
|
||||
dmi_bigsmp = 1;
|
||||
else
|
||||
dmi_check_system(bigsmp_dmi_table);
|
||||
return dmi_bigsmp;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,25 @@ struct genapic *apic_probe[] __initdata = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
static int cmdline_apic;
|
||||
|
||||
void __init generic_bigsmp_probe(void)
|
||||
{
|
||||
/*
|
||||
* This routine is used to switch to bigsmp mode when
|
||||
* - There is no apic= option specified by the user
|
||||
* - generic_apic_probe() has choosen apic_default as the sub_arch
|
||||
* - we find more than 8 CPUs in acpi LAPIC listing with xAPIC support
|
||||
*/
|
||||
|
||||
if (!cmdline_apic && genapic == &apic_default)
|
||||
if (apic_bigsmp.probe()) {
|
||||
genapic = &apic_bigsmp;
|
||||
printk(KERN_INFO "Overriding APIC driver with %s\n",
|
||||
genapic->name);
|
||||
}
|
||||
}
|
||||
|
||||
static void __init genapic_apic_force(char *str)
|
||||
{
|
||||
int i;
|
||||
@@ -41,7 +60,7 @@ custom_param("apic", genapic_apic_force);
|
||||
void __init generic_apic_probe(void)
|
||||
{
|
||||
int i;
|
||||
int changed = (genapic != NULL);
|
||||
int changed = cmdline_apic = (genapic != NULL);
|
||||
|
||||
for (i = 0; !changed && apic_probe[i]; i++) {
|
||||
if (apic_probe[i]->probe()) {
|
||||
|
||||
@@ -63,6 +63,8 @@ int nr_ioapics;
|
||||
int pic_mode;
|
||||
unsigned long mp_lapic_addr;
|
||||
|
||||
unsigned int def_to_bigsmp;
|
||||
|
||||
/* Processor that is doing the boot up */
|
||||
unsigned int boot_cpu_physical_apicid = -1U;
|
||||
unsigned int boot_cpu_logical_apicid = -1U;
|
||||
@@ -213,6 +215,13 @@ void __init MP_processor_info (struct mpc_config_processor *m)
|
||||
ver = 0x10;
|
||||
}
|
||||
apic_version[m->mpc_apicid] = ver;
|
||||
if ((num_processors > 8) &&
|
||||
APIC_XAPIC(ver) &&
|
||||
(boot_cpu_data.x86_vendor == X86_VENDOR_INTEL))
|
||||
def_to_bigsmp = 1;
|
||||
else
|
||||
def_to_bigsmp = 0;
|
||||
|
||||
bios_cpu_apicid[num_processors - 1] = m->mpc_apicid;
|
||||
}
|
||||
|
||||
|
||||
@@ -111,9 +111,7 @@ void *_xmalloc(size_t size, size_t align)
|
||||
unsigned long flags;
|
||||
|
||||
/* We currently always return cacheline aligned. */
|
||||
#ifndef __ia64__
|
||||
BUG_ON(align > SMP_CACHE_BYTES);
|
||||
#endif
|
||||
|
||||
/* Add room for header, pad to align next header. */
|
||||
size += sizeof(struct xmalloc_hdr);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#define GET_APIC_VERSION(x) ((x)&0xFF)
|
||||
#define GET_APIC_MAXLVT(x) (((x)>>16)&0xFF)
|
||||
#define APIC_INTEGRATED(x) ((x)&0xF0)
|
||||
#define APIC_XAPIC(x) ((x) >= 0x14)
|
||||
#define APIC_TASKPRI 0x80
|
||||
#define APIC_TPRI_MASK 0xFF
|
||||
#define APIC_ARBPRI 0x90
|
||||
|
||||
@@ -28,4 +28,6 @@
|
||||
#define enable_apic_mode (genapic->enable_apic_mode)
|
||||
#define phys_pkg_id (genapic->phys_pkg_id)
|
||||
|
||||
extern void generic_bigsmp_probe(void);
|
||||
|
||||
#endif /* __ASM_MACH_APIC_H */
|
||||
@@ -11,6 +11,7 @@ extern int mp_bus_id_to_local [MAX_MP_BUSSES];
|
||||
extern int quad_local_to_mp_bus_id [NR_CPUS/4][4];
|
||||
extern int mp_bus_id_to_pci_bus [MAX_MP_BUSSES];
|
||||
|
||||
extern unsigned int def_to_bigsmp;
|
||||
extern unsigned int boot_cpu_physical_apicid;
|
||||
extern int smp_found_config;
|
||||
extern void find_smp_config (void);
|
||||
|
||||