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

[Xen-changelog] [xen-unstable] Merge with ia64/xen-unstable.hg



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1187365690 -3600
# Node ID 1892f4a9822fe0993c758a4c4719082a0dd5baa6
# Parent  049d4baa9965b35eed8b4b4a1a2283906d956ac3
# Parent  8ef276326042c380037bea94feaae965f6b771a8
Merge with ia64/xen-unstable.hg
---
 Config.mk                               |    3 +
 buildconfigs/mk.linux-2.6-xen           |   15 ++++++++
 buildconfigs/src.hg-clone               |   14 -------
 buildconfigs/src.tarball                |    4 +-
 config/FreeBSD.mk                       |    1 
 config/x86_32.mk                        |    8 +---
 tools/examples/blktap                   |   57 ++++++++++++++++++++++++++++++++
 tools/examples/block                    |   42 -----------------------
 tools/examples/block-common.sh          |   43 ++++++++++++++++++++++++
 tools/python/xen/xend/XendCheckpoint.py |    3 +
 tools/python/xen/xend/XendDomainInfo.py |    5 ++
 xen/Makefile                            |    2 -
 12 files changed, 131 insertions(+), 66 deletions(-)

diff -r 049d4baa9965 -r 1892f4a9822f Config.mk
--- a/Config.mk Thu Aug 16 13:46:50 2007 -0600
+++ b/Config.mk Fri Aug 17 16:48:10 2007 +0100
@@ -20,6 +20,9 @@ HOSTCC      = gcc
 HOSTCC      = gcc
 HOSTCFLAGS  = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
 HOSTCFLAGS += -fno-strict-aliasing
+HOSTCFLAGS_x86_32 = -m32
+HOSTCFLAGS_x86_64 = -m64
+HOSTCFLAGS += $(HOSTCFLAGS_$(XEN_COMPILE_ARCH))
 
 DISTDIR     ?= $(XEN_ROOT)/dist
 DESTDIR     ?= /
diff -r 049d4baa9965 -r 1892f4a9822f buildconfigs/mk.linux-2.6-xen
--- a/buildconfigs/mk.linux-2.6-xen     Thu Aug 16 13:46:50 2007 -0600
+++ b/buildconfigs/mk.linux-2.6-xen     Fri Aug 17 16:48:10 2007 +0100
@@ -6,6 +6,16 @@ EXTRAVERSION ?= -xen
 # Linux search path, will be searched for tarballs and mercurial
 # repositories.
 LINUX_SRC_PATH ?= .:..
+
+# The source directory is not automatically updated to avoid blowing
+# away developer's changes. If you want to automatically pull a new
+# version of the Linux tree then add `XEN_LINUX_UPDATE=y' to your make
+# command line.
+ifeq ($(XEN_LINUX_UPDATE),y)
+__XEN_LINUX_UPDATE = $(LINUX_SRCDIR)/.force-update
+else
+__XEN_LINUX_UPDATE =
+endif
 
 XEN_LINUX_SOURCE ?= hg-clone
 
@@ -115,6 +125,7 @@ endif
              echo "    \$$(MAKE) -C \$$(KERNELSRC) O=\$$(KERNELOUTPUT) \$$@"; \
            ) > $(LINUX_DIR)/Makefile ; \
        fi
+       $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) prepare
 
 .PHONY: prep
 prep: $(LINUX_DIR)/include/linux/autoconf.h
@@ -137,3 +148,7 @@ mrproper:
 mrproper:
        rm -rf $(LINUX_SRCDIR)
        rm -f linux-$(LINUX_VER).tar.bz2
+
+.PHONY: $(LINUX_SRCDIR)/.force-update
+$(LINUX_SRCDIR)/.force-update:
+       @ :
diff -r 049d4baa9965 -r 1892f4a9822f buildconfigs/src.hg-clone
--- a/buildconfigs/src.hg-clone Thu Aug 16 13:46:50 2007 -0600
+++ b/buildconfigs/src.hg-clone Fri Aug 17 16:48:10 2007 +0100
@@ -5,16 +5,6 @@ LINUX_SRCDIR ?= linux-$(LINUX_VER)-xen.h
 
 # Repository to clone.
 XEN_LINUX_HGREPO ?= $$(sh buildconfigs/select-repository $(LINUX_SRCDIR) 
$(LINUX_SRC_PATH))
-
-# The source directory is not automatically updated to avoid blowing
-# away developer's changes. If you want to automatically pull a new
-# version of the Linux tree then add `XEN_LINUX_UPDATE=y' to your make
-# command line.
-ifeq ($(XEN_LINUX_UPDATE),y)
-__XEN_LINUX_UPDATE = $(LINUX_SRCDIR)/.force-update
-else
-__XEN_LINUX_UPDATE =
-endif
 
 # Set XEN_LINUX_HGREV to update to a particlar revision.
 XEN_LINUX_HGREV  ?= tip
@@ -40,7 +30,3 @@ XEN_LINUX_HGREV  ?= tip
            ( cd $(LINUX_SRCDIR) && $(HG) update $(XEN_LINUX_HGREV) ); \
        fi
        touch $@
-
-.PHONY: $(LINUX_SRCDIR)/.force-update
-$(LINUX_SRCDIR)/.force-update:
-       @ :
diff -r 049d4baa9965 -r 1892f4a9822f buildconfigs/src.tarball
--- a/buildconfigs/src.tarball  Thu Aug 16 13:46:50 2007 -0600
+++ b/buildconfigs/src.tarball  Fri Aug 17 16:48:10 2007 +0100
@@ -18,11 +18,11 @@ linux-%.tar.bz2:
 # XXX create a pristine tree for diff -Nurp convenience
 
 ifeq ($(XEN_LINUX_TARBALL_KETCHUP),y)
-%/.valid-src:
+%/.valid-src: $(__XEN_LINUX_UPDATE)
        $(KETCHUP) -d $(@D) $(LINUX_VER)
        touch $@ # update timestamp to avoid rebuild
 else
-%/.valid-src: %.tar.bz2
+%/.valid-src: $(__XEN_LINUX_UPDATE) %.tar.bz2
        rm -rf tmp-linux-$* $(@D)
        mkdir -p tmp-linux-$*
        tar -C tmp-linux-$* -jxf $<
diff -r 049d4baa9965 -r 1892f4a9822f config/FreeBSD.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/config/FreeBSD.mk Fri Aug 17 16:48:10 2007 +0100
@@ -0,0 +1,1 @@
+include $(XEN_ROOT)/config/StdGNU.mk
diff -r 049d4baa9965 -r 1892f4a9822f config/x86_32.mk
--- a/config/x86_32.mk  Thu Aug 16 13:46:50 2007 -0600
+++ b/config/x86_32.mk  Fri Aug 17 16:48:10 2007 +0100
@@ -11,8 +11,6 @@ LIBDIR := lib
 LIBDIR := lib
 
 # Use only if calling $(LD) directly.
-ifeq ($(XEN_OS),OpenBSD)
-LDFLAGS_DIRECT += -melf_i386_obsd
-else
-LDFLAGS_DIRECT += -melf_i386
-endif
+LDFLAGS_DIRECT_OpenBSD = _obsd
+LDFLAGS_DIRECT_FreeBSD = _fbsd
+LDFLAGS_DIRECT += -melf_i386$(LDFLAGS_DIRECT_$(XEN_OS))
diff -r 049d4baa9965 -r 1892f4a9822f tools/examples/blktap
--- a/tools/examples/blktap     Thu Aug 16 13:46:50 2007 -0600
+++ b/tools/examples/blktap     Fri Aug 17 16:48:10 2007 +0100
@@ -7,6 +7,57 @@ dir=$(dirname "$0")
 . "$dir/block-common.sh"
 
 findCommand "$@"
+
+##
+# check_blktap_sharing file mode
+#
+# Perform the sharing check for the given blktap and mode.
+#
+check_blktap_sharing()
+{
+    local file="$1"
+    local mode="$2"
+
+    local base_path="$XENBUS_BASE_PATH/$XENBUS_TYPE"
+    for dom in $(xenstore-list "$base_path")
+    do
+        for dev in $(xenstore-list "$base_path/$dom")
+        do
+            params=$(xenstore_read "$base_path/$dom/$dev/params" | cut -d: -f2)
+            if [ "$file" = "$params" ]
+            then
+
+                if [ "$mode" = 'w' ]
+                then
+                    if ! same_vm "$dom" 
+                    then
+                        echo 'guest'
+                        return
+                    fi
+                else 
+                    local m=$(xenstore_read "$base_path/$dom/$dev/mode")
+                    m=$(canonicalise_mode "$m")
+
+                    if [ "$m" = 'w' ] 
+                    then
+                        if ! same_vm "$dom"
+                        then
+                            echo 'guest'
+                            return
+                        fi
+                    fi
+                fi
+            fi
+        done
+    done
+
+    echo 'ok'
+}
+
+FRONTEND_ID=$(xenstore_read "$XENBUS_PATH/frontend-id")
+FRONTEND_UUID=$(xenstore_read "/local/domain/$FRONTEND_ID/vm")
+mode=$(xenstore_read "$XENBUS_PATH/mode")
+mode=$(canonicalise_mode "$mode")
 
 t=$(xenstore_read_default "$XENBUS_PATH/type" 'MISSING')
 if [ -n "$t" ]
@@ -20,6 +71,12 @@ fi
 fi
 file=$(readlink -f "$p") || ebusy "$p does not exist."
 
+if [ "$mode" != '!' ] 
+then
+    result=$(check_blktap_sharing "$file" "$mode")
+    [ "$result" = 'ok' ] || ebusy "$file already in use by other domain"
+fi
+
 if [ "$command" = 'add' ]
 then
     [ -e "$file" ] || { ebusy $file does not exist; }
diff -r 049d4baa9965 -r 1892f4a9822f tools/examples/block
--- a/tools/examples/block      Thu Aug 16 13:46:50 2007 -0600
+++ b/tools/examples/block      Fri Aug 17 16:48:10 2007 +0100
@@ -14,32 +14,6 @@ expand_dev() {
     ;;
   esac
   echo -n $dev
-}
-
-
-##
-# canonicalise_mode mode
-#
-# Takes the given mode, which may be r, w, ro, rw, w!, or rw!, or variations
-# thereof, and canonicalises them to one of
-#
-#   'r': perform checks for a new read-only mount;
-#   'w': perform checks for a read-write mount; or
-#   '!': perform no checks at all.
-#
-canonicalise_mode()
-{
-  local mode="$1"
-
-  if ! expr index "$mode" 'w' >/dev/null
-  then
-    echo 'r'
-  elif ! expr index "$mode" '!' >/dev/null
-  then
-    echo 'w'
-  else
-    echo '!'
-  fi
 }
 
 
@@ -123,22 +97,6 @@ check_sharing()
   done
 
   echo 'ok'
-}
-
-
-same_vm()
-{
-  local otherdom="$1"
-  # Note that othervm can be MISSING here, because Xend will be racing with
-  # the hotplug scripts -- the entries in /local/domain can be removed by
-  # Xend before the hotplug scripts have removed the entry in
-  # /local/domain/0/backend/.  In this case, we want to pretend that the
-  # VM is the same as FRONTEND_UUID, because that way the 'sharing' will be
-  # allowed.
-  local othervm=$(xenstore_read_default "/local/domain/$otherdom/vm"         \
-                  "$FRONTEND_UUID")
-
-  [ "$FRONTEND_UUID" = "$othervm" ]
 }
 
 
diff -r 049d4baa9965 -r 1892f4a9822f tools/examples/block-common.sh
--- a/tools/examples/block-common.sh    Thu Aug 16 13:46:50 2007 -0600
+++ b/tools/examples/block-common.sh    Fri Aug 17 16:48:10 2007 +0100
@@ -71,3 +71,46 @@ write_dev() {
 
   success
 }
+
+
+##
+# canonicalise_mode mode
+#
+# Takes the given mode, which may be r, w, ro, rw, w!, or rw!, or variations
+# thereof, and canonicalises them to one of
+#
+#   'r': perform checks for a new read-only mount;
+#   'w': perform checks for a read-write mount; or
+#   '!': perform no checks at all.
+#
+canonicalise_mode()
+{
+  local mode="$1"
+
+  if ! expr index "$mode" 'w' >/dev/null
+  then
+    echo 'r'
+  elif ! expr index "$mode" '!' >/dev/null
+  then
+    echo 'w'
+  else
+    echo '!'
+  fi
+}
+
+
+same_vm()
+{
+  local otherdom="$1"
+  # Note that othervm can be MISSING here, because Xend will be racing with
+  # the hotplug scripts -- the entries in /local/domain can be removed by
+  # Xend before the hotplug scripts have removed the entry in
+  # /local/domain/0/backend/.  In this case, we want to pretend that the
+  # VM is the same as FRONTEND_UUID, because that way the 'sharing' will be
+  # allowed.
+  local othervm=$(xenstore_read_default "/local/domain/$otherdom/vm"         \
+                  "$FRONTEND_UUID")
+
+  [ "$FRONTEND_UUID" = "$othervm" ]
+}
+
diff -r 049d4baa9965 -r 1892f4a9822f tools/python/xen/xend/XendCheckpoint.py
--- a/tools/python/xen/xend/XendCheckpoint.py   Thu Aug 16 13:46:50 2007 -0600
+++ b/tools/python/xen/xend/XendCheckpoint.py   Fri Aug 17 16:48:10 2007 +0100
@@ -181,7 +181,8 @@ def restore(xd, fd, dominfo = None, paus
     assert store_port
     assert console_port
 
-    nr_pfns = (dominfo.getMemoryTarget() + 3) / 4 
+    page_size_kib = xc.pages_to_kib(1)
+    nr_pfns = (dominfo.getMemoryTarget() + page_size_kib - 1) / page_size_kib 
 
     # if hvm, pass mem size to calculate the store_mfn
     image_cfg = dominfo.info.get('image', {})
diff -r 049d4baa9965 -r 1892f4a9822f tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Thu Aug 16 13:46:50 2007 -0600
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Aug 17 16:48:10 2007 +0100
@@ -607,6 +607,9 @@ class XendDomainInfo:
                     _, dev_info = sxprs[dev]
             else:  # 'vbd' or 'tap'
                 dev_info = self.getDeviceInfo_vbd(dev)
+                # To remove the UUID of the device from refs,
+                # deviceClass must be always 'vbd'.
+                deviceClass = 'vbd'
             if dev_info is None:
                 return rc
 
@@ -981,7 +984,7 @@ class XendDomainInfo:
             changed = True
 
         # Check if the rtc offset has changes
-        if vm_details.get("rtc/timeoffset", 0) != 
self.info["platform"].get("rtc_timeoffset", 0):
+        if vm_details.get("rtc/timeoffset", "0") != 
self.info["platform"].get("rtc_timeoffset", "0"):
             self.info["platform"]["rtc_timeoffset"] = 
vm_details.get("rtc/timeoffset", 0)
             changed = True
  
diff -r 049d4baa9965 -r 1892f4a9822f xen/Makefile
--- a/xen/Makefile      Thu Aug 16 13:46:50 2007 -0600
+++ b/xen/Makefile      Fri Aug 17 16:48:10 2007 +0100
@@ -1,7 +1,7 @@
 # This is the correct place to edit the build version.
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 3
-export XEN_SUBVERSION    = 0
+export XEN_SUBVERSION    = 2
 export XEN_EXTRAVERSION ?= -unstable$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version

_______________________________________________
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®.