ia64/xen-unstable

changeset 15779:1892f4a9822f

Merge with ia64/xen-unstable.hg
author kfraser@localhost.localdomain
date Fri Aug 17 16:48:10 2007 +0100 (2007-08-17)
parents 049d4baa9965 8ef276326042
children f279d776fcb0
files
line diff
     1.1 --- a/Config.mk	Thu Aug 16 13:46:50 2007 -0600
     1.2 +++ b/Config.mk	Fri Aug 17 16:48:10 2007 +0100
     1.3 @@ -20,6 +20,9 @@ SHELL     ?= /bin/sh
     1.4  HOSTCC      = gcc
     1.5  HOSTCFLAGS  = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
     1.6  HOSTCFLAGS += -fno-strict-aliasing
     1.7 +HOSTCFLAGS_x86_32 = -m32
     1.8 +HOSTCFLAGS_x86_64 = -m64
     1.9 +HOSTCFLAGS += $(HOSTCFLAGS_$(XEN_COMPILE_ARCH))
    1.10  
    1.11  DISTDIR     ?= $(XEN_ROOT)/dist
    1.12  DESTDIR     ?= /
     2.1 --- a/buildconfigs/mk.linux-2.6-xen	Thu Aug 16 13:46:50 2007 -0600
     2.2 +++ b/buildconfigs/mk.linux-2.6-xen	Fri Aug 17 16:48:10 2007 +0100
     2.3 @@ -7,6 +7,16 @@ EXTRAVERSION ?= -xen
     2.4  # repositories.
     2.5  LINUX_SRC_PATH ?= .:..
     2.6  
     2.7 +# The source directory is not automatically updated to avoid blowing
     2.8 +# away developer's changes. If you want to automatically pull a new
     2.9 +# version of the Linux tree then add `XEN_LINUX_UPDATE=y' to your make
    2.10 +# command line.
    2.11 +ifeq ($(XEN_LINUX_UPDATE),y)
    2.12 +__XEN_LINUX_UPDATE = $(LINUX_SRCDIR)/.force-update
    2.13 +else
    2.14 +__XEN_LINUX_UPDATE =
    2.15 +endif
    2.16 +
    2.17  XEN_LINUX_SOURCE ?= hg-clone
    2.18  
    2.19  # Let XEN_TARGET_ARCH override ARCH.
    2.20 @@ -115,6 +125,7 @@ endif
    2.21  	      echo "	\$$(MAKE) -C \$$(KERNELSRC) O=\$$(KERNELOUTPUT) \$$@"; \
    2.22  	    ) > $(LINUX_DIR)/Makefile ; \
    2.23  	fi
    2.24 +	$(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) prepare
    2.25  
    2.26  .PHONY: prep
    2.27  prep: $(LINUX_DIR)/include/linux/autoconf.h
    2.28 @@ -137,3 +148,7 @@ delete:
    2.29  mrproper:
    2.30  	rm -rf $(LINUX_SRCDIR)
    2.31  	rm -f linux-$(LINUX_VER).tar.bz2
    2.32 +
    2.33 +.PHONY: $(LINUX_SRCDIR)/.force-update
    2.34 +$(LINUX_SRCDIR)/.force-update:
    2.35 +	@ :
     3.1 --- a/buildconfigs/src.hg-clone	Thu Aug 16 13:46:50 2007 -0600
     3.2 +++ b/buildconfigs/src.hg-clone	Fri Aug 17 16:48:10 2007 +0100
     3.3 @@ -6,16 +6,6 @@ LINUX_SRCDIR ?= linux-$(LINUX_VER)-xen.h
     3.4  # Repository to clone.
     3.5  XEN_LINUX_HGREPO ?= $$(sh buildconfigs/select-repository $(LINUX_SRCDIR) $(LINUX_SRC_PATH))
     3.6  
     3.7 -# The source directory is not automatically updated to avoid blowing
     3.8 -# away developer's changes. If you want to automatically pull a new
     3.9 -# version of the Linux tree then add `XEN_LINUX_UPDATE=y' to your make
    3.10 -# command line.
    3.11 -ifeq ($(XEN_LINUX_UPDATE),y)
    3.12 -__XEN_LINUX_UPDATE = $(LINUX_SRCDIR)/.force-update
    3.13 -else
    3.14 -__XEN_LINUX_UPDATE =
    3.15 -endif
    3.16 -
    3.17  # Set XEN_LINUX_HGREV to update to a particlar revision.
    3.18  XEN_LINUX_HGREV  ?= tip
    3.19  
    3.20 @@ -40,7 +30,3 @@ XEN_LINUX_HGREV  ?= tip
    3.21  	    ( cd $(LINUX_SRCDIR) && $(HG) update $(XEN_LINUX_HGREV) ); \
    3.22  	fi
    3.23  	touch $@
    3.24 -
    3.25 -.PHONY: $(LINUX_SRCDIR)/.force-update
    3.26 -$(LINUX_SRCDIR)/.force-update:
    3.27 -	@ :
     4.1 --- a/buildconfigs/src.tarball	Thu Aug 16 13:46:50 2007 -0600
     4.2 +++ b/buildconfigs/src.tarball	Fri Aug 17 16:48:10 2007 +0100
     4.3 @@ -18,11 +18,11 @@ linux-%.tar.bz2:
     4.4  # XXX create a pristine tree for diff -Nurp convenience
     4.5  
     4.6  ifeq ($(XEN_LINUX_TARBALL_KETCHUP),y)
     4.7 -%/.valid-src:
     4.8 +%/.valid-src: $(__XEN_LINUX_UPDATE)
     4.9  	$(KETCHUP) -d $(@D) $(LINUX_VER)
    4.10  	touch $@ # update timestamp to avoid rebuild
    4.11  else
    4.12 -%/.valid-src: %.tar.bz2
    4.13 +%/.valid-src: $(__XEN_LINUX_UPDATE) %.tar.bz2
    4.14  	rm -rf tmp-linux-$* $(@D)
    4.15  	mkdir -p tmp-linux-$*
    4.16  	tar -C tmp-linux-$* -jxf $<
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/config/FreeBSD.mk	Fri Aug 17 16:48:10 2007 +0100
     5.3 @@ -0,0 +1,1 @@
     5.4 +include $(XEN_ROOT)/config/StdGNU.mk
     6.1 --- a/config/x86_32.mk	Thu Aug 16 13:46:50 2007 -0600
     6.2 +++ b/config/x86_32.mk	Fri Aug 17 16:48:10 2007 +0100
     6.3 @@ -11,8 +11,6 @@ CFLAGS += -m32 -march=i686
     6.4  LIBDIR := lib
     6.5  
     6.6  # Use only if calling $(LD) directly.
     6.7 -ifeq ($(XEN_OS),OpenBSD)
     6.8 -LDFLAGS_DIRECT += -melf_i386_obsd
     6.9 -else
    6.10 -LDFLAGS_DIRECT += -melf_i386
    6.11 -endif
    6.12 +LDFLAGS_DIRECT_OpenBSD = _obsd
    6.13 +LDFLAGS_DIRECT_FreeBSD = _fbsd
    6.14 +LDFLAGS_DIRECT += -melf_i386$(LDFLAGS_DIRECT_$(XEN_OS))
     7.1 --- a/tools/examples/blktap	Thu Aug 16 13:46:50 2007 -0600
     7.2 +++ b/tools/examples/blktap	Fri Aug 17 16:48:10 2007 +0100
     7.3 @@ -8,6 +8,57 @@ dir=$(dirname "$0")
     7.4  
     7.5  findCommand "$@"
     7.6  
     7.7 +##
     7.8 +# check_blktap_sharing file mode
     7.9 +#
    7.10 +# Perform the sharing check for the given blktap and mode.
    7.11 +#
    7.12 +check_blktap_sharing()
    7.13 +{
    7.14 +    local file="$1"
    7.15 +    local mode="$2"
    7.16 +
    7.17 +    local base_path="$XENBUS_BASE_PATH/$XENBUS_TYPE"
    7.18 +    for dom in $(xenstore-list "$base_path")
    7.19 +    do
    7.20 +        for dev in $(xenstore-list "$base_path/$dom")
    7.21 +        do
    7.22 +            params=$(xenstore_read "$base_path/$dom/$dev/params" | cut -d: -f2)
    7.23 +            if [ "$file" = "$params" ]
    7.24 +            then
    7.25 +
    7.26 +                if [ "$mode" = 'w' ]
    7.27 +                then
    7.28 +                    if ! same_vm "$dom" 
    7.29 +                    then
    7.30 +                        echo 'guest'
    7.31 +                        return
    7.32 +                    fi
    7.33 +                else 
    7.34 +                    local m=$(xenstore_read "$base_path/$dom/$dev/mode")
    7.35 +                    m=$(canonicalise_mode "$m")
    7.36 +
    7.37 +                    if [ "$m" = 'w' ] 
    7.38 +                    then
    7.39 +                        if ! same_vm "$dom"
    7.40 +                        then
    7.41 +                            echo 'guest'
    7.42 +                            return
    7.43 +                        fi
    7.44 +                    fi
    7.45 +                fi
    7.46 +            fi
    7.47 +        done
    7.48 +    done
    7.49 +
    7.50 +    echo 'ok'
    7.51 +}
    7.52 +
    7.53 +FRONTEND_ID=$(xenstore_read "$XENBUS_PATH/frontend-id")
    7.54 +FRONTEND_UUID=$(xenstore_read "/local/domain/$FRONTEND_ID/vm")
    7.55 +mode=$(xenstore_read "$XENBUS_PATH/mode")
    7.56 +mode=$(canonicalise_mode "$mode")
    7.57 +
    7.58  t=$(xenstore_read_default "$XENBUS_PATH/type" 'MISSING')
    7.59  if [ -n "$t" ]
    7.60  then
    7.61 @@ -20,6 +71,12 @@ then
    7.62  fi
    7.63  file=$(readlink -f "$p") || ebusy "$p does not exist."
    7.64  
    7.65 +if [ "$mode" != '!' ] 
    7.66 +then
    7.67 +    result=$(check_blktap_sharing "$file" "$mode")
    7.68 +    [ "$result" = 'ok' ] || ebusy "$file already in use by other domain"
    7.69 +fi
    7.70 +
    7.71  if [ "$command" = 'add' ]
    7.72  then
    7.73      [ -e "$file" ] || { ebusy $file does not exist; }
     8.1 --- a/tools/examples/block	Thu Aug 16 13:46:50 2007 -0600
     8.2 +++ b/tools/examples/block	Fri Aug 17 16:48:10 2007 +0100
     8.3 @@ -18,32 +18,6 @@ expand_dev() {
     8.4  
     8.5  
     8.6  ##
     8.7 -# canonicalise_mode mode
     8.8 -#
     8.9 -# Takes the given mode, which may be r, w, ro, rw, w!, or rw!, or variations
    8.10 -# thereof, and canonicalises them to one of
    8.11 -#
    8.12 -#   'r': perform checks for a new read-only mount;
    8.13 -#   'w': perform checks for a read-write mount; or
    8.14 -#   '!': perform no checks at all.
    8.15 -#
    8.16 -canonicalise_mode()
    8.17 -{
    8.18 -  local mode="$1"
    8.19 -
    8.20 -  if ! expr index "$mode" 'w' >/dev/null
    8.21 -  then
    8.22 -    echo 'r'
    8.23 -  elif ! expr index "$mode" '!' >/dev/null
    8.24 -  then
    8.25 -    echo 'w'
    8.26 -  else
    8.27 -    echo '!'
    8.28 -  fi
    8.29 -}
    8.30 -
    8.31 -
    8.32 -##
    8.33  # check_sharing device mode
    8.34  #
    8.35  # Check whether the device requested is already in use.  To use the device in
    8.36 @@ -126,22 +100,6 @@ check_sharing()
    8.37  }
    8.38  
    8.39  
    8.40 -same_vm()
    8.41 -{
    8.42 -  local otherdom="$1"
    8.43 -  # Note that othervm can be MISSING here, because Xend will be racing with
    8.44 -  # the hotplug scripts -- the entries in /local/domain can be removed by
    8.45 -  # Xend before the hotplug scripts have removed the entry in
    8.46 -  # /local/domain/0/backend/.  In this case, we want to pretend that the
    8.47 -  # VM is the same as FRONTEND_UUID, because that way the 'sharing' will be
    8.48 -  # allowed.
    8.49 -  local othervm=$(xenstore_read_default "/local/domain/$otherdom/vm"         \
    8.50 -                  "$FRONTEND_UUID")
    8.51 -
    8.52 -  [ "$FRONTEND_UUID" = "$othervm" ]
    8.53 -}
    8.54 -
    8.55 -
    8.56  ##
    8.57  # check_device_sharing dev mode
    8.58  #
     9.1 --- a/tools/examples/block-common.sh	Thu Aug 16 13:46:50 2007 -0600
     9.2 +++ b/tools/examples/block-common.sh	Fri Aug 17 16:48:10 2007 +0100
     9.3 @@ -71,3 +71,46 @@ write_dev() {
     9.4  
     9.5    success
     9.6  }
     9.7 +
     9.8 +
     9.9 +##
    9.10 +# canonicalise_mode mode
    9.11 +#
    9.12 +# Takes the given mode, which may be r, w, ro, rw, w!, or rw!, or variations
    9.13 +# thereof, and canonicalises them to one of
    9.14 +#
    9.15 +#   'r': perform checks for a new read-only mount;
    9.16 +#   'w': perform checks for a read-write mount; or
    9.17 +#   '!': perform no checks at all.
    9.18 +#
    9.19 +canonicalise_mode()
    9.20 +{
    9.21 +  local mode="$1"
    9.22 +
    9.23 +  if ! expr index "$mode" 'w' >/dev/null
    9.24 +  then
    9.25 +    echo 'r'
    9.26 +  elif ! expr index "$mode" '!' >/dev/null
    9.27 +  then
    9.28 +    echo 'w'
    9.29 +  else
    9.30 +    echo '!'
    9.31 +  fi
    9.32 +}
    9.33 +
    9.34 +
    9.35 +same_vm()
    9.36 +{
    9.37 +  local otherdom="$1"
    9.38 +  # Note that othervm can be MISSING here, because Xend will be racing with
    9.39 +  # the hotplug scripts -- the entries in /local/domain can be removed by
    9.40 +  # Xend before the hotplug scripts have removed the entry in
    9.41 +  # /local/domain/0/backend/.  In this case, we want to pretend that the
    9.42 +  # VM is the same as FRONTEND_UUID, because that way the 'sharing' will be
    9.43 +  # allowed.
    9.44 +  local othervm=$(xenstore_read_default "/local/domain/$otherdom/vm"         \
    9.45 +                  "$FRONTEND_UUID")
    9.46 +
    9.47 +  [ "$FRONTEND_UUID" = "$othervm" ]
    9.48 +}
    9.49 +
    10.1 --- a/tools/python/xen/xend/XendCheckpoint.py	Thu Aug 16 13:46:50 2007 -0600
    10.2 +++ b/tools/python/xen/xend/XendCheckpoint.py	Fri Aug 17 16:48:10 2007 +0100
    10.3 @@ -181,7 +181,8 @@ def restore(xd, fd, dominfo = None, paus
    10.4      assert store_port
    10.5      assert console_port
    10.6  
    10.7 -    nr_pfns = (dominfo.getMemoryTarget() + 3) / 4 
    10.8 +    page_size_kib = xc.pages_to_kib(1)
    10.9 +    nr_pfns = (dominfo.getMemoryTarget() + page_size_kib - 1) / page_size_kib 
   10.10  
   10.11      # if hvm, pass mem size to calculate the store_mfn
   10.12      image_cfg = dominfo.info.get('image', {})
    11.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Thu Aug 16 13:46:50 2007 -0600
    11.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Fri Aug 17 16:48:10 2007 +0100
    11.3 @@ -607,6 +607,9 @@ class XendDomainInfo:
    11.4                      _, dev_info = sxprs[dev]
    11.5              else:  # 'vbd' or 'tap'
    11.6                  dev_info = self.getDeviceInfo_vbd(dev)
    11.7 +                # To remove the UUID of the device from refs,
    11.8 +                # deviceClass must be always 'vbd'.
    11.9 +                deviceClass = 'vbd'
   11.10              if dev_info is None:
   11.11                  return rc
   11.12  
   11.13 @@ -981,7 +984,7 @@ class XendDomainInfo:
   11.14              changed = True
   11.15  
   11.16          # Check if the rtc offset has changes
   11.17 -        if vm_details.get("rtc/timeoffset", 0) != self.info["platform"].get("rtc_timeoffset", 0):
   11.18 +        if vm_details.get("rtc/timeoffset", "0") != self.info["platform"].get("rtc_timeoffset", "0"):
   11.19              self.info["platform"]["rtc_timeoffset"] = vm_details.get("rtc/timeoffset", 0)
   11.20              changed = True
   11.21   
    12.1 --- a/xen/Makefile	Thu Aug 16 13:46:50 2007 -0600
    12.2 +++ b/xen/Makefile	Fri Aug 17 16:48:10 2007 +0100
    12.3 @@ -1,7 +1,7 @@
    12.4  # This is the correct place to edit the build version.
    12.5  # All other places this is stored (eg. compile.h) should be autogenerated.
    12.6  export XEN_VERSION       = 3
    12.7 -export XEN_SUBVERSION    = 0
    12.8 +export XEN_SUBVERSION    = 2
    12.9  export XEN_EXTRAVERSION ?= -unstable$(XEN_VENDORVERSION)
   12.10  export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
   12.11  -include xen-version