ia64/xen-unstable

changeset 7800:5aad7e145e50

If /sbin/ isn't in the path, udev rules will erroneously not get
installed.

Signed-off-by: Nivedita Singhvi <niv@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Nov 14 11:05:34 2005 +0100 (2005-11-14)
parents bffbe58801d0
children b631c9328e49
files install.sh linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c tools/check/check_hotplug tools/examples/Makefile tools/libxc/xc_linux_build.c tools/libxc/xc_linux_restore.c tools/libxc/xc_private.c tools/libxc/xc_vmx_build.c tools/libxc/xenctrl.h
line diff
     1.1 --- a/install.sh	Sat Nov 12 18:59:56 2005 +0100
     1.2 +++ b/install.sh	Mon Nov 14 11:05:34 2005 +0100
     1.3 @@ -27,7 +27,7 @@ echo "Installing Xen from '$src' to '$ds
     1.4  cp -fdRL $src/etc/init.d/* $dst/etc/init.d/
     1.5  echo "All done."
     1.6  
     1.7 -if [ -x /sbin/udev ] && [ ! -z `udev -V` ] && [ `/sbin/udev -V` -ge 059 ]; then
     1.8 +if [ -x /sbin/udev ] && [ ! -z `/sbin/udev -V` ] && [ `/sbin/udev -V` -ge 059 ]; then
     1.9    cp -f $src/etc/udev/rules.d/*.rules $dst/etc/udev/rules.d/
    1.10  else
    1.11    cp -f $src/etc/hotplug/*.agent $dst/etc/hotplug/
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c	Sat Nov 12 18:59:56 2005 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c	Mon Nov 14 11:05:34 2005 +0100
     2.3 @@ -30,6 +30,12 @@ static inline struct xencons_interface *
     2.4  	return mfn_to_virt(xen_start_info->console_mfn);
     2.5  }
     2.6  
     2.7 +static inline void notify_daemon(void)
     2.8 +{
     2.9 +	/* Use evtchn: this is called early, before irq is set up. */
    2.10 +	notify_remote_via_evtchn(xen_start_info->console_evtchn);
    2.11 +}
    2.12 +
    2.13  int xencons_ring_send(const char *data, unsigned len)
    2.14  {
    2.15  	int sent = 0;
    2.16 @@ -47,8 +53,7 @@ int xencons_ring_send(const char *data, 
    2.17  	wmb();
    2.18  	intf->out_prod = prod;
    2.19  
    2.20 -	/* Use evtchn: this is called early, before irq is set up. */
    2.21 -	notify_remote_via_evtchn(xen_start_info->console_evtchn);
    2.22 +	notify_daemon();
    2.23  
    2.24  	return sent;
    2.25  }	
    2.26 @@ -70,9 +75,11 @@ static irqreturn_t handle_input(int irq,
    2.27  				1, regs);
    2.28  	}
    2.29  
    2.30 -	wmb();
    2.31 +	mb();
    2.32  	intf->in_cons = cons;
    2.33  
    2.34 +	notify_daemon();
    2.35 +
    2.36  	return IRQ_HANDLED;
    2.37  }
    2.38  
    2.39 @@ -102,6 +109,9 @@ int xencons_ring_init(void)
    2.40  
    2.41  	xencons_irq = err;
    2.42  
    2.43 +	/* In case we have in-flight data after save/restore... */
    2.44 +	notify_daemon();
    2.45 +
    2.46  	return 0;
    2.47  }
    2.48  
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c	Sat Nov 12 18:59:56 2005 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c	Mon Nov 14 11:05:34 2005 +0100
     3.3 @@ -36,7 +36,7 @@
     3.4  #include <asm-xen/xenbus.h>
     3.5  #include "xenbus_comms.h"
     3.6  
     3.7 -static int xenbus_irq      = 0;
     3.8 +static int xenbus_irq;
     3.9  
    3.10  extern void xenbus_probe(void *); 
    3.11  extern int xenstored_ready; 
    3.12 @@ -51,7 +51,7 @@ static inline struct xenstore_domain_int
    3.13  
    3.14  static irqreturn_t wake_waiting(int irq, void *unused, struct pt_regs *regs)
    3.15  {
    3.16 -	if(unlikely(xenstored_ready == 0)) {
    3.17 +	if (unlikely(xenstored_ready == 0)) {
    3.18  		xenstored_ready = 1; 
    3.19  		schedule_work(&probe_work); 
    3.20  	} 
    3.21 @@ -189,9 +189,6 @@ int xb_init_comms(void)
    3.22  
    3.23  	xenbus_irq = err;
    3.24  
    3.25 -	/* FIXME zero out page -- domain builder should probably do this*/
    3.26 -	memset(mfn_to_virt(xen_start_info->store_mfn), 0, PAGE_SIZE);
    3.27 -
    3.28  	return 0;
    3.29  }
    3.30  
     4.1 --- a/tools/check/check_hotplug	Sat Nov 12 18:59:56 2005 +0100
     4.2 +++ b/tools/check/check_hotplug	Mon Nov 14 11:05:34 2005 +0100
     4.3 @@ -7,7 +7,7 @@ function error {
     4.4     exit 1
     4.5  }
     4.6  
     4.7 -if [ -x /sbin/udev ] && [ ! -z `udev -V` ] && [ `udev -V` -ge 059 ]; then
     4.8 +if [ -x /sbin/udev ] && [ ! -z `/sbin/udev -V` ] && [ `/sbin/udev -V` -ge 059 ]; then
     4.9    exit 0
    4.10  fi
    4.11  
     5.1 --- a/tools/examples/Makefile	Sat Nov 12 18:59:56 2005 +0100
     5.2 +++ b/tools/examples/Makefile	Mon Nov 14 11:05:34 2005 +0100
     5.3 @@ -41,7 +41,7 @@ DE = $(shell readlink -f $(DESTDIR))
     5.4  ifeq ($(findstring $(DI),$(DE)),$(DI))
     5.5  HOTPLUGS=install-hotplug install-udev
     5.6  else
     5.7 -ifeq ($(shell [ -x /sbin/udev ] && [ ! -z `udev -V` ] && [ `/sbin/udev -V` -ge 059 ] && echo 1),1)
     5.8 +ifeq ($(shell [ -x /sbin/udev ] && [ ! -z `/sbin/udev -V` ] && [ `/sbin/udev -V` -ge 059 ] && echo 1),1)
     5.9  HOTPLUGS=install-udev
    5.10  else
    5.11  HOTPLUGS=install-hotplug
     6.1 --- a/tools/libxc/xc_linux_build.c	Sat Nov 12 18:59:56 2005 +0100
     6.2 +++ b/tools/libxc/xc_linux_build.c	Mon Nov 14 11:05:34 2005 +0100
     6.3 @@ -619,7 +619,9 @@ static int setup_guest(int xc_handle,
     6.4  
     6.5      *store_mfn = page_array[(vstoreinfo_start-dsi.v_start) >> PAGE_SHIFT];
     6.6      *console_mfn = page_array[(vconsole_start-dsi.v_start) >> PAGE_SHIFT];
     6.7 -
     6.8 +    if ( xc_clear_domain_page(xc_handle, dom, *store_mfn) ||
     6.9 +         xc_clear_domain_page(xc_handle, dom, *console_mfn) )
    6.10 +        goto error_out;
    6.11  
    6.12      start_info = xc_map_foreign_range(
    6.13          xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE,
     7.1 --- a/tools/libxc/xc_linux_restore.c	Sat Nov 12 18:59:56 2005 +0100
     7.2 +++ b/tools/libxc/xc_linux_restore.c	Mon Nov 14 11:05:34 2005 +0100
     7.3 @@ -12,8 +12,6 @@
     7.4  #include "xg_private.h"
     7.5  #include "xg_save_restore.h"
     7.6  
     7.7 -
     7.8 -
     7.9  /* max mfn of the whole machine */
    7.10  static uint32_t max_mfn; 
    7.11  
     8.1 --- a/tools/libxc/xc_private.c	Sat Nov 12 18:59:56 2005 +0100
     8.2 +++ b/tools/libxc/xc_private.c	Mon Nov 14 11:05:34 2005 +0100
     8.3 @@ -336,6 +336,19 @@ int xc_copy_to_domain_page(int xc_handle
     8.4      return 0;
     8.5  }
     8.6  
     8.7 +int xc_clear_domain_page(int xc_handle,
     8.8 +                         uint32_t domid,
     8.9 +                         unsigned long dst_pfn)
    8.10 +{
    8.11 +    void *vaddr = xc_map_foreign_range(
    8.12 +        xc_handle, domid, PAGE_SIZE, PROT_WRITE, dst_pfn);
    8.13 +    if ( vaddr == NULL )
    8.14 +        return -1;
    8.15 +    memset(vaddr, 0, PAGE_SIZE);
    8.16 +    munmap(vaddr, PAGE_SIZE);
    8.17 +    return 0;
    8.18 +}
    8.19 +
    8.20  unsigned long xc_get_filesz(int fd)
    8.21  {
    8.22      uint16_t sig;
     9.1 --- a/tools/libxc/xc_vmx_build.c	Sat Nov 12 18:59:56 2005 +0100
     9.2 +++ b/tools/libxc/xc_vmx_build.c	Mon Nov 14 11:05:34 2005 +0100
     9.3 @@ -495,6 +495,9 @@ static int setup_guest(int xc_handle,
     9.4      }
     9.5  
     9.6      *store_mfn = page_array[(v_end-2) >> PAGE_SHIFT];
     9.7 +    if ( xc_clear_domain_page(xc_handle, dom, *store_mfn) )
     9.8 +        goto error_out;
     9.9 +
    9.10      shared_page_frame = (v_end - PAGE_SIZE) >> PAGE_SHIFT;
    9.11  
    9.12      if ((e820_page = xc_map_foreign_range(
    10.1 --- a/tools/libxc/xenctrl.h	Sat Nov 12 18:59:56 2005 +0100
    10.2 +++ b/tools/libxc/xenctrl.h	Mon Nov 14 11:05:34 2005 +0100
    10.3 @@ -424,6 +424,9 @@ int xc_ia64_get_pfn_list(int xc_handle, 
    10.4  int xc_copy_to_domain_page(int xc_handle, uint32_t domid,
    10.5  			   unsigned long dst_pfn, void *src_page);
    10.6  
    10.7 +int xc_clear_domain_page(int xc_handle, uint32_t domid,
    10.8 +                         unsigned long dst_pfn);
    10.9 +
   10.10  int xc_ia64_copy_to_domain_pages(int xc_handle, uint32_t domid,
   10.11          void* src_page, unsigned long dst_pfn, int nr_pages);
   10.12