WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Merge.

# HG changeset patch
# User sos22@xxxxxxxxxxxxxxxxxxxx
# Node ID 6d9ea03c1baa19dfefbbb6ccc7ab43cff2383206
# Parent  9cc161c08b59ed78e405ac36fc67ec5d24dab37d
# Parent  1d754a4ad3507bd94d441f5367fa8010c6f075f7
Merge.

Signed-off-by: Steven Smith, sos22@xxxxxxxxx

diff -r 9cc161c08b59 -r 6d9ea03c1baa tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Wed Nov 23 12:35:50 2005
+++ b/tools/python/xen/xm/main.py       Wed Nov 23 12:38:34 2005
@@ -847,7 +847,8 @@
 
 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]
diff -r 9cc161c08b59 -r 6d9ea03c1baa tools/xm-test/configure.ac
--- a/tools/xm-test/configure.ac        Wed Nov 23 12:35:50 2005
+++ b/tools/xm-test/configure.ac        Wed Nov 23 12:38:34 2005
@@ -50,6 +50,7 @@
     tests/memmax/Makefile
     tests/memset/Makefile
     tests/migrate/Makefile
+    tests/network-attach/Makefile
     tests/pause/Makefile
     tests/reboot/Makefile
     tests/restore/Makefile
diff -r 9cc161c08b59 -r 6d9ea03c1baa tools/xm-test/lib/XmTestLib/Test.py
--- a/tools/xm-test/lib/XmTestLib/Test.py       Wed Nov 23 12:35:50 2005
+++ b/tools/xm-test/lib/XmTestLib/Test.py       Wed Nov 23 12:38:34 2005
@@ -161,6 +161,29 @@
     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()
diff -r 9cc161c08b59 -r 6d9ea03c1baa tools/xm-test/tests/Makefile.am
--- a/tools/xm-test/tests/Makefile.am   Wed Nov 23 12:35:50 2005
+++ b/tools/xm-test/tests/Makefile.am   Wed Nov 23 12:38:34 2005
@@ -13,6 +13,7 @@
                list            \
                memmax          \
                memset          \
+               network-attach  \
                pause           \
                reboot          \
                sedf            \
diff -r 9cc161c08b59 -r 6d9ea03c1baa 
tools/xm-test/tests/block-create/Makefile.am
--- a/tools/xm-test/tests/block-create/Makefile.am      Wed Nov 23 12:35:50 2005
+++ b/tools/xm-test/tests/block-create/Makefile.am      Wed Nov 23 12:38:34 2005
@@ -8,7 +8,9 @@
        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 = 
 
diff -r 9cc161c08b59 -r 6d9ea03c1baa 
tools/xm-test/tests/memset/04_memset_smallmem_pos.py
--- a/tools/xm-test/tests/memset/04_memset_smallmem_pos.py      Wed Nov 23 
12:35:50 2005
+++ b/tools/xm-test/tests/memset/04_memset_smallmem_pos.py      Wed Nov 23 
12:38:34 2005
@@ -30,7 +30,7 @@
     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 @@
     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))
 
diff -r 9cc161c08b59 -r 6d9ea03c1baa xen/arch/x86/acpi/boot.c
--- a/xen/arch/x86/acpi/boot.c  Wed Nov 23 12:35:50 2005
+++ b/xen/arch/x86/acpi/boot.c  Wed Nov 23 12:38:34 2005
@@ -602,7 +602,8 @@
                error = acpi_parse_madt_lapic_entries();
                if (!error) {
                        acpi_lapic = 1;
-
+                       generic_bigsmp_probe();
+ 
                        /*
                         * Parse MADT IO-APIC entries
                         */
diff -r 9cc161c08b59 -r 6d9ea03c1baa xen/arch/x86/genapic/bigsmp.c
--- a/xen/arch/x86/genapic/bigsmp.c     Wed Nov 23 12:35:50 2005
+++ b/xen/arch/x86/genapic/bigsmp.c     Wed Nov 23 12:38:34 2005
@@ -45,7 +45,10 @@
 
 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; 
 } 
 
diff -r 9cc161c08b59 -r 6d9ea03c1baa xen/arch/x86/genapic/probe.c
--- a/xen/arch/x86/genapic/probe.c      Wed Nov 23 12:35:50 2005
+++ b/xen/arch/x86/genapic/probe.c      Wed Nov 23 12:38:34 2005
@@ -29,6 +29,25 @@
        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 @@
 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()) {
diff -r 9cc161c08b59 -r 6d9ea03c1baa xen/arch/x86/mpparse.c
--- a/xen/arch/x86/mpparse.c    Wed Nov 23 12:35:50 2005
+++ b/xen/arch/x86/mpparse.c    Wed Nov 23 12:38:34 2005
@@ -62,6 +62,8 @@
 
 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;
@@ -213,6 +215,13 @@
                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;
 }
 
diff -r 9cc161c08b59 -r 6d9ea03c1baa xen/common/xmalloc.c
--- a/xen/common/xmalloc.c      Wed Nov 23 12:35:50 2005
+++ b/xen/common/xmalloc.c      Wed Nov 23 12:38:34 2005
@@ -111,9 +111,7 @@
     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);
diff -r 9cc161c08b59 -r 6d9ea03c1baa xen/include/asm-x86/apicdef.h
--- a/xen/include/asm-x86/apicdef.h     Wed Nov 23 12:35:50 2005
+++ b/xen/include/asm-x86/apicdef.h     Wed Nov 23 12:38:34 2005
@@ -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
diff -r 9cc161c08b59 -r 6d9ea03c1baa 
xen/include/asm-x86/mach-generic/mach_apic.h
--- a/xen/include/asm-x86/mach-generic/mach_apic.h      Wed Nov 23 12:35:50 2005
+++ b/xen/include/asm-x86/mach-generic/mach_apic.h      Wed Nov 23 12:38:34 2005
@@ -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 */
diff -r 9cc161c08b59 -r 6d9ea03c1baa xen/include/asm-x86/mpspec.h
--- a/xen/include/asm-x86/mpspec.h      Wed Nov 23 12:35:50 2005
+++ b/xen/include/asm-x86/mpspec.h      Wed Nov 23 12:38:34 2005
@@ -11,6 +11,7 @@
 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);
diff -r 9cc161c08b59 -r 6d9ea03c1baa 
tools/xm-test/tests/block-create/11_block_attach_shared_dom0.py
--- /dev/null   Wed Nov 23 12:35:50 2005
+++ b/tools/xm-test/tests/block-create/11_block_attach_shared_dom0.py   Wed Nov 
23 12:38:34 2005
@@ -0,0 +1,32 @@
+#!/usr/bin/python
+
+# Copyright (C) International Business Machines Corp., 2005
+# Author: Dan Smith <danms@xxxxxxxxxx>
+
+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")
diff -r 9cc161c08b59 -r 6d9ea03c1baa 
tools/xm-test/tests/block-create/12_block_attach_shared_domU.py
--- /dev/null   Wed Nov 23 12:35:50 2005
+++ b/tools/xm-test/tests/block-create/12_block_attach_shared_domU.py   Wed Nov 
23 12:38:34 2005
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+
+# Copyright (C) International Business Machines Corp., 2005
+# Author: Dan Smith <danms@xxxxxxxxxx>
+
+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
+    
diff -r 9cc161c08b59 -r 6d9ea03c1baa 
tools/xm-test/tests/network-attach/01_network_attach_pos.py
--- /dev/null   Wed Nov 23 12:35:50 2005
+++ b/tools/xm-test/tests/network-attach/01_network_attach_pos.py       Wed Nov 
23 12:38:34 2005
@@ -0,0 +1,48 @@
+#!/usr/bin/python
+
+# Copyright (C) International Business Machines Corp., 2005
+# Author: Murillo F. Bernardes <mfb@xxxxxxxxxx>
+
+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()
diff -r 9cc161c08b59 -r 6d9ea03c1baa 
tools/xm-test/tests/network-attach/02_network_attach_detach_pos.py
--- /dev/null   Wed Nov 23 12:35:50 2005
+++ b/tools/xm-test/tests/network-attach/02_network_attach_detach_pos.py        
Wed Nov 23 12:38:34 2005
@@ -0,0 +1,54 @@
+#!/usr/bin/python
+
+# Copyright (C) International Business Machines Corp., 2005
+# Author: Murillo F. Bernardes <mfb@xxxxxxxxxx>
+
+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()
diff -r 9cc161c08b59 -r 6d9ea03c1baa 
tools/xm-test/tests/network-attach/03_network_attach_detach_multiple_pos.py
--- /dev/null   Wed Nov 23 12:35:50 2005
+++ 
b/tools/xm-test/tests/network-attach/03_network_attach_detach_multiple_pos.py   
    Wed Nov 23 12:38:34 2005
@@ -0,0 +1,54 @@
+#!/usr/bin/python
+
+# Copyright (C) International Business Machines Corp., 2005
+# Author: Murillo F. Bernardes <mfb@xxxxxxxxxx>
+
+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()
diff -r 9cc161c08b59 -r 6d9ea03c1baa 
tools/xm-test/tests/network-attach/04_network_attach_baddomain_neg.py
--- /dev/null   Wed Nov 23 12:35:50 2005
+++ b/tools/xm-test/tests/network-attach/04_network_attach_baddomain_neg.py     
Wed Nov 23 12:38:34 2005
@@ -0,0 +1,17 @@
+#!/usr/bin/python
+
+# Copyright (C) International Business Machines Corp., 2005
+# Author: Murillo F. Bernardes <mfb@xxxxxxxxxx>
+
+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 )
+       
+
diff -r 9cc161c08b59 -r 6d9ea03c1baa 
tools/xm-test/tests/network-attach/Makefile.am
--- /dev/null   Wed Nov 23 12:35:50 2005
+++ b/tools/xm-test/tests/network-attach/Makefile.am    Wed Nov 23 12:38:34 2005
@@ -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 *~
diff -r 9cc161c08b59 -r 6d9ea03c1baa 
tools/xm-test/tests/network-attach/network_utils.py
--- /dev/null   Wed Nov 23 12:35:50 2005
+++ b/tools/xm-test/tests/network-attach/network_utils.py       Wed Nov 23 
12:38:34 2005
@@ -0,0 +1,37 @@
+#!/usr/bin/python
+
+# Copyright (C) International Business Machines Corp., 2005
+# Author: Murillo F. Bernardes <mfb@xxxxxxxxxx>
+
+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

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>