[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Merged.



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID e336e186e5f96a0e93f842ca3a2e39601c2a0193
# Parent  c07d5bab4c2bd29b29b9de6b9588e4be89a71aac
# Parent  27a2cb379c8ffcca77d9ec262d3baf06e7f85175
Merged.

diff -r c07d5bab4c2b -r e336e186e5f9 install.sh
--- a/install.sh        Mon Nov 21 16:30:22 2005
+++ b/install.sh        Mon Nov 21 16:30:43 2005
@@ -27,7 +27,10 @@
 cp -fdRL $src/etc/init.d/* $dst/etc/init.d/
 echo "All done."
 
-if [ -x /sbin/udev ] && [ ! -z `/sbin/udev -V` ] && [ `/sbin/udev -V` -ge 059 
]; then
+[ -x "$(which udevinfo)" ] && \
+  UDEV_VERSION=$(udevinfo -V | sed -e 's/^.*\s\([0-9]\+\)[^0-9]*/\1/')
+
+if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
   cp -f $src/etc/udev/rules.d/*.rules $dst/etc/udev/rules.d/
 else
   cp -f $src/etc/hotplug/*.agent $dst/etc/hotplug/
diff -r c07d5bab4c2b -r e336e186e5f9 
linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c
--- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c       Mon Nov 21 
16:30:22 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c       Mon Nov 21 
16:30:43 2005
@@ -24,6 +24,7 @@
 #include <asm/io.h>
 #include <asm/pci.h>
 #include <asm/dma.h>
+#include <asm-xen/xen-public/memory.h>
 
 #define OFFSET(val,align) ((unsigned long)((val) & ( (align) - 1)))
 
@@ -177,6 +178,8 @@
 void
 swiotlb_init(void)
 {
+       long ram_end;
+
        /* The user can forcibly enable swiotlb. */
        if (swiotlb_force)
                swiotlb = 1;
@@ -186,10 +189,8 @@
          * which we take to mean more than 2GB.
          */
        if (xen_start_info->flags & SIF_INITDOMAIN) {
-               dom0_op_t op;
-               op.cmd = DOM0_PHYSINFO;
-               if ((HYPERVISOR_dom0_op(&op) == 0) &&
-                   (op.u.physinfo.total_pages > 0x7ffff))
+               ram_end = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);
+               if (ram_end > 0x7ffff)
                        swiotlb = 1;
        }
 
diff -r c07d5bab4c2b -r e336e186e5f9 
linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c     Mon Nov 21 16:30:22 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c     Mon Nov 21 16:30:43 2005
@@ -189,17 +189,16 @@
 #endif
 
        /* 
-       ** Only resume xenbus /after/ we've prepared our VCPUs; otherwise
-       ** the VCPU hotplug callback can race with our vcpu_prepare
-       */
+        * Only resume xenbus /after/ we've prepared our VCPUs; otherwise
+        * the VCPU hotplug callback can race with our vcpu_prepare
+        */
        xenbus_resume();
-
 
 #ifdef CONFIG_SMP
  out_reenable_cpus:
        for_each_cpu_mask(i, prev_online_cpus) {
                j = cpu_up(i);
-               if (j != 0) {
+               if ((j != 0) && !cpu_online(i)) {
                        printk(KERN_CRIT "Failed to bring cpu "
                               "%d back up (%d).\n",
                               i, j);
diff -r c07d5bab4c2b -r e336e186e5f9 
linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c
--- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c        Mon Nov 21 
16:30:22 2005
+++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c        Mon Nov 21 
16:30:43 2005
@@ -586,7 +586,7 @@
        free_bootmem(__pa(map), PAGE_SIZE);
 
        if (!found) {
-               HYPERVISOR_memory_op(XENMEM_maximum_ram_page, &gapstart);
+               gapstart = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);
                gapstart = (gapstart << PAGE_SHIFT) + 1024*1024;
                printk(KERN_ERR "PCI: Warning: Cannot find a gap in the 32bit 
address range\n"
                       KERN_ERR "PCI: Unassigned devices with 32bit resource 
registers may break!\n");
diff -r c07d5bab4c2b -r e336e186e5f9 tools/check/check_hotplug
--- a/tools/check/check_hotplug Mon Nov 21 16:30:22 2005
+++ b/tools/check/check_hotplug Mon Nov 21 16:30:43 2005
@@ -6,8 +6,10 @@
    echo '  *** Check for the hotplug scripts (hotplug) FAILED'
    exit 1
 }
+[ -x "$(which udevinfo)" ] && \
+  UDEV_VERSION=$(udevinfo -V | sed -e 's/^.*\s\([0-9]\+\)[^0-9]*/\1/')
 
-if [ -x /sbin/udev ] && [ ! -z `/sbin/udev -V` ] && [ `/sbin/udev -V` -ge 059 
]; then
+if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
   exit 0
 fi
 
diff -r c07d5bab4c2b -r e336e186e5f9 tools/examples/vif-bridge
--- a/tools/examples/vif-bridge Mon Nov 21 16:30:22 2005
+++ b/tools/examples/vif-bridge Mon Nov 21 16:30:43 2005
@@ -48,9 +48,9 @@
 
 case "$command" in
     online)
-        if brctl show "$bridge" | grep "$vif" >&/dev/null
+        if brctl show | grep "$vif" >&/dev/null
         then
-          log debug "$vif already attached to $bridge"
+          log debug "$vif already attached to a bridge"
           exit 0
         fi
 
diff -r c07d5bab4c2b -r e336e186e5f9 tools/examples/vif-common.sh
--- a/tools/examples/vif-common.sh      Mon Nov 21 16:30:22 2005
+++ b/tools/examples/vif-common.sh      Mon Nov 21 16:30:43 2005
@@ -82,7 +82,7 @@
   # binary is not sufficient, because the user may not have the appropriate
   # modules installed.  If iptables is not working, then there's no need to do
   # anything with it, so we can just return.
-  if ! iptables -L >&/dev/null
+  if ! iptables -L -n >&/dev/null
   then
     return
   fi
diff -r c07d5bab4c2b -r e336e186e5f9 tools/libxc/xc_linux_save.c
--- a/tools/libxc/xc_linux_save.c       Mon Nov 21 16:30:22 2005
+++ b/tools/libxc/xc_linux_save.c       Mon Nov 21 16:30:43 2005
@@ -798,6 +798,7 @@
     pfn_batch = calloc(MAX_BATCH_SIZE, sizeof(unsigned long));
 
     if ((pfn_type == NULL) || (pfn_batch == NULL)) {
+        ERR("failed to alloc memory for pfn_type and/or pfn_batch arays."); 
         errno = ENOMEM;
         goto out;
     }
@@ -817,7 +818,7 @@
         for (i = 0; i < max_pfn; i++) {
 
             mfn = live_p2m[i];
-            if((live_m2p[mfn] != i) && (mfn != 0xffffffffUL)) { 
+            if((mfn != 0xffffffffUL) && (live_m2p[mfn] != i)) { 
                 DPRINTF("i=0x%x mfn=%lx live_m2p=%lx\n", i, 
                         mfn, live_m2p[mfn]);
                 err++;
@@ -912,7 +913,7 @@
                        unless its sent sooner anyhow */
 
                     set_bit(n, to_fix);
-                    if(iter > 1)
+                    if( (iter > 1) && IS_REAL_PFN(n) )
                         DPRINTF("netbuf race: iter %d, pfn %x. mfn %lx\n",
                                 iter, n, pfn_type[batch]);
                     continue;
@@ -1157,6 +1158,13 @@
 
  out:
 
+    if (live) {
+        if(xc_shadow_control(xc_handle, dom, DOM0_SHADOW_CONTROL_OP_OFF, 
+                             NULL, 0, NULL ) < 0) { 
+            DPRINTF("Warning - couldn't disable shadow mode");
+        }
+    }
+    
     if (live_shinfo)
         munmap(live_shinfo, PAGE_SIZE);
     
diff -r c07d5bab4c2b -r e336e186e5f9 tools/libxc/xc_private.c
--- a/tools/libxc/xc_private.c  Mon Nov 21 16:30:22 2005
+++ b/tools/libxc/xc_private.c  Mon Nov 21 16:30:43 2005
@@ -214,13 +214,6 @@
             goto out1;
         }
         break;
-    case XENMEM_maximum_ram_page:
-        if ( mlock(arg, sizeof(unsigned long)) != 0 )
-        {
-            PERROR("Could not mlock");
-            goto out1;
-        }
-        break;
     }
 
     ret = do_xen_hypercall(xc_handle, &hypercall);
@@ -233,9 +226,6 @@
         if ( reservation->extent_start != NULL )
             safe_munlock(reservation->extent_start,
                          reservation->nr_extents * sizeof(unsigned long));
-        break;
-    case XENMEM_maximum_ram_page:
-        safe_munlock(arg, sizeof(unsigned long));
         break;
     }
 
diff -r c07d5bab4c2b -r e336e186e5f9 tools/libxc/xg_save_restore.h
--- a/tools/libxc/xg_save_restore.h     Mon Nov 21 16:30:22 2005
+++ b/tools/libxc/xg_save_restore.h     Mon Nov 21 16:30:43 2005
@@ -64,7 +64,6 @@
 { 
     xen_capabilities_info_t xen_caps = "";
     xen_platform_parameters_t xen_params;
-    
 
     if (xc_version(xc_handle, XENVER_platform_parameters, &xen_params) != 0)
         return 0;
@@ -72,8 +71,7 @@
     if (xc_version(xc_handle, XENVER_capabilities, &xen_caps) != 0)
         return 0;
 
-    if (xc_memory_op(xc_handle, XENMEM_maximum_ram_page, max_mfn) != 0)
-        return 0; 
+    *max_mfn = xc_memory_op(xc_handle, XENMEM_maximum_ram_page, NULL);
     
     *hvirt_start = xen_params.virt_start;
 
@@ -125,6 +123,12 @@
 /* Number of entries in the pfn_to_mfn_frame_list_list */
 #define P2M_FLL_ENTRIES (((max_pfn)+(ulpp*ulpp)-1)/(ulpp*ulpp))
 
+/* Current guests allow 8MB 'slack' in their P2M */
+#define NR_SLACK_ENTRIES   ((8 * 1024 * 1024) / PAGE_SIZE)
+
+/* Is the given PFN within the 'slack' region at the top of the P2M? */
+#define IS_REAL_PFN(_pfn)  ((max_pfn - (_pfn)) > NR_SLACK_ENTRIES) 
+
 /* Returns TRUE if the PFN is currently mapped */
 #define is_mapped(pfn_type) (!((pfn_type) & 0x80000000UL))
 
diff -r c07d5bab4c2b -r e336e186e5f9 xen/arch/x86/shadow32.c
--- a/xen/arch/x86/shadow32.c   Mon Nov 21 16:30:22 2005
+++ b/xen/arch/x86/shadow32.c   Mon Nov 21 16:30:43 2005
@@ -920,9 +920,9 @@
     struct vcpu *v;
     int new_modes = (mode & ~d->arch.shadow_mode);
 
-    // Gotta be adding something to call this function.
-    ASSERT(new_modes);
-
+    if(!new_modes) /* Nothing to do - return success */
+        return 0; 
+        
     // can't take anything away by calling this function.
     ASSERT(!(d->arch.shadow_mode & ~mode));
 
diff -r c07d5bab4c2b -r e336e186e5f9 xen/common/memory.c
--- a/xen/common/memory.c       Mon Nov 21 16:30:22 2005
+++ b/xen/common/memory.c       Mon Nov 21 16:30:43 2005
@@ -136,6 +136,7 @@
     struct domain *d;
     int rc, start_extent, op, flags = 0, preempted = 0;
     struct xen_memory_reservation reservation;
+    domid_t domid;
 
     op = cmd & ((1 << START_EXTENT_SHIFT) - 1);
 
@@ -191,9 +192,26 @@
         break;
 
     case XENMEM_maximum_ram_page:
-        if ( put_user(max_page, (unsigned long *)arg) )
+        rc = max_page;
+        break;
+
+    case XENMEM_current_reservation:
+    case XENMEM_maximum_reservation:
+        if ( get_user(domid, (domid_t *)arg) )
             return -EFAULT;
-        rc = 0;
+
+        if ( likely((domid = (unsigned long)arg) == DOMID_SELF) )
+            d = current->domain;
+        else if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+        else if ( (d = find_domain_by_id(domid)) == NULL )
+            return -ESRCH;
+
+        rc = (op == XENMEM_current_reservation) ? d->tot_pages : d->max_pages;
+
+        if ( unlikely(domid != DOMID_SELF) )
+            put_domain(d);
+
         break;
 
     default:
diff -r c07d5bab4c2b -r e336e186e5f9 xen/include/public/memory.h
--- a/xen/include/public/memory.h       Mon Nov 21 16:30:22 2005
+++ b/xen/include/public/memory.h       Mon Nov 21 16:30:43 2005
@@ -9,15 +9,13 @@
 #ifndef __XEN_PUBLIC_MEMORY_H__
 #define __XEN_PUBLIC_MEMORY_H__
 
-/* arg == addr of struct xen_memory_reservation. */
+/*
+ * Increase or decrease the specified domain's memory reservation. Returns a
+ * -ve errcode on failure, or the # extents successfully allocated or freed.
+ * arg == addr of struct xen_memory_reservation.
+ */
 #define XENMEM_increase_reservation 0
-
-/* arg == addr of struct xen_memory_reservation. */
 #define XENMEM_decrease_reservation 1
-
-/* arg == addr of unsigned long. */
-#define XENMEM_maximum_ram_page     2
-
 typedef struct xen_memory_reservation {
 
     /*
@@ -47,6 +45,21 @@
 
 } xen_memory_reservation_t;
 
+/*
+ * Returns the maximum machine frame number of mapped RAM in this system.
+ * This command always succeeds (it never returns an error code).
+ * arg == NULL.
+ */
+#define XENMEM_maximum_ram_page     2
+
+/*
+ * Returns the current or maximum memory reservation, in pages, of the
+ * specified domain (may be DOMID_SELF). Returns -ve errcode on failure.
+ * arg == addr of domid_t.
+ */
+#define XENMEM_current_reservation  3
+#define XENMEM_maximum_reservation  4
+
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
 
 /*
diff -r c07d5bab4c2b -r e336e186e5f9 docs/man/xend-config.sxp.pod.5
--- /dev/null   Mon Nov 21 16:30:22 2005
+++ b/docs/man/xend-config.sxp.pod.5    Mon Nov 21 16:30:43 2005
@@ -0,0 +1,142 @@
+=head1 NAME
+
+xend-config.sxp - Xen daemon configuration file
+
+=head1 SYNOPSIS
+
+/etc/xen/xend-config.sxp
+
+=head1 DESCRIPTION
+
+The xend(1) program requires xend-config.sxp to specify operating
+parameters which determine the behavior of the daemon at runtime.
+
+The parameters are specified in S-expression format.  See the example
+configuration file in I</etc/xen/xend-config.sxp> for details.
+
+=head1 OPTIONS
+
+The following lists the daemon configuration parameters:
+
+=over 4
+
+=item I<logfile>
+
+The location of the file to record runtime log messages.  Defaults to
+I</var/log/xend.log>.
+
+=item I<loglevel>
+
+Filters out messages below the specified level.  Possible values are
+DEBUG, INFO, WARNING, ERROR, CRITICAL.  Defaults to I<DEBUG>.
+
+=item I<xend-http-server>
+
+A boolean value that tells xend whether or not to start the http
+stream socket management server.  Defaults to I<no>.
+
+=item I<xend-unix-server>
+
+A boolean value that tells xend whether or not to start the unix
+domain socket management server.  This is required for the CLI tools
+to operate.  Defaults to I<yes>.
+
+=item I<xend-relocation-server>
+
+A boolean value that tells xend whether or not to start the relocation
+server.  This is required for cross-machine migrations.  Defaults to
+I<no>.
+
+=item I<xend-unix-path>
+
+The location of the unix domain socket the xend-unix-server will use
+to communicate with the management tools.  Defaults to
+I</var/lib/xend/xend-socket>.
+
+=item I<xend-port>
+
+The port that will be used by the http management server.  Defaults to
+I<8000>.
+
+=item I<xend-relocation-port>
+
+The port that will be used by the relocation server.  Defaults to
+I<8002>.
+
+=item I<xend-address> 
+
+The address to which the http management server will bind.  Defaults
+to I<''> which means "all interfaces".
+
+=item I<xend-relocation-address>
+
+The address to which the relocation server will bind.  Defaults to
+I<''> which means "all interfaces".
+
+=item I<console-limit>
+
+The kilobyte buffer limit that will be enforced by the console server.
+This limit is set per-domain, and is needed to prevent a single domain
+from overwhelming the console server with massive amounts of data.
+Defaults to I<1024>.
+
+=item I<network-script>
+
+The name of the script in I</etc/xen/scripts> that will be run to
+setup the networking environment.  This can be any name, but in
+general is either I<network-bridge> or I<network-route>.
+
+=item I<vif-script>
+
+The name of the script in I</etc/xen/scripts> that will be run to
+setup a virtual interface when it is created or destroyed.  This needs
+to (in general) work in unison with the I<network-script>.
+
+=item I<dom0-min-mem>
+
+This specifies the minimum number of megabytes that will be reserved
+for Domain0.  If this value is positive, Domain0 will be automatically
+ballooned down to this limit to make space for new domains.  If this
+is set to 0, Domain0 will not be automatically ballooned.
+
+=item I<dom0-cpus>
+
+This specifies the number of CPUs that Domain0 will be allowed to use.
+If the value is 0, all available CPUs will be used by Domain0.
+
+=item I<enable-dump>
+
+A boolean value that tells xend whether or not core dumps of guest
+domains should be saved when a crash occurrs.  Defaults to I<no>.
+
+=back
+
+=head1 EXAMPLES
+
+An example configuration with relocation enabled for the local network:
+
+=over 4
+
+ (xend-relocation-server yes)
+ (xend-relocation-address 192.168.1.1)
+ (network-script network-bridge)
+ (vif-script vif-bridge)
+ (dom0-min-mem 0)
+ (dom0-cpus 0)
+
+=back
+
+=head1 CAVEATS
+
+Note that relocation is currently unsecured and is very dangerous if
+left enabled.  No authentication is performed, and very little sanity
+checking takes place.  Enable at your own risk.
+
+=head1 SEE ALSO
+
+B<xend>(1)
+
+=head1 AUTHOR
+
+Dan Smith <danms@xxxxxxxxxx>
+
diff -r c07d5bab4c2b -r e336e186e5f9 tools/examples/README.incompatibilities
--- /dev/null   Mon Nov 21 16:30:22 2005
+++ b/tools/examples/README.incompatibilities   Mon Nov 21 16:30:43 2005
@@ -0,0 +1,25 @@
+Command Incompatibilities
+=========================
+
+Known incompatibilities with various commands on various distributions, and
+the workarounds we use.
+
+
+brctl
+-----
+
+brctl show <bridge> fails on SLES9 SP2.  Workaround is to use brctl show
+without arguments, and grep, though this would be difficult were you to need
+to check for a specific bridge-interface pair, since brctl does not show the 
+bridge name on every line.
+
+
+ifup / ifdown
+-------------
+
+SuSE requires an extra parameter to ifup, which is created by calling getcfg
+appropriately.  See xen-network-common.sh for details.
+
+Gentoo doesn't have ifup/ifdown; appropriate alternatives are defined in
+xen-network-common.sh.
+

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.