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

[Xen-changelog] merge?



# HG changeset patch
# User chris@xxxxxxxxxxxxxxxxxxxxxxxxxxx
# Node ID d48b19263e4687c82d9c58f339077759a5dffb2b
# Parent  99a1f5dc75a9a8aa703588f423ce1bcaf2a6b8ec
# Parent  3c88c4d68fc1ba7a0d30fb8f3710a5be5f788cc0
merge?

diff -r 99a1f5dc75a9 -r d48b19263e46 .hgignore
--- a/.hgignore Wed Dec 14 02:04:14 2005
+++ b/.hgignore Wed Dec 14 02:05:57 2005
@@ -10,6 +10,7 @@
 .*\.tar\.bz2$
 .*\.tar\.gz$
 .*~$
+^build.*$
 ^dist/.*$
 ^docs/.*\.aux$
 ^docs/.*\.dvi$
diff -r 99a1f5dc75a9 -r d48b19263e46 Config.mk
--- a/Config.mk Wed Dec 14 02:04:14 2005
+++ b/Config.mk Wed Dec 14 02:05:57 2005
@@ -3,7 +3,7 @@
 # Currently supported architectures: x86_32, x86_64
 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
 XEN_TARGET_ARCH     ?= $(XEN_COMPILE_ARCH)
-XEN_TARGET_X86_PAE  ?= n
+XEN_TARGET_X86_PAE  ?= y
 
 # Tools to run on system hosting the build
 HOSTCC     = gcc
diff -r 99a1f5dc75a9 -r d48b19263e46 buildconfigs/mk.linux-2.6-xen
--- a/buildconfigs/mk.linux-2.6-xen     Wed Dec 14 02:04:14 2005
+++ b/buildconfigs/mk.linux-2.6-xen     Wed Dec 14 02:05:57 2005
@@ -6,7 +6,8 @@
 
 EXTRAVERSION ?= xen
 
-LINUX_DIR    = $(OS)-$(LINUX_VER)-$(EXTRAVERSION)
+LINUX_SRCDIR = $(OS)-$(LINUX_VER)-xen
+LINUX_DIR    = build-$(OS)-$(LINUX_VER)-$(EXTRAVERSION)_$(XEN_TARGET_ARCH)
 
 include buildconfigs/Rules.mk
 
@@ -20,25 +21,32 @@
        fi
        $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_PATH=$(DESTDIR) 
install
 
-$(LINUX_DIR)/include/linux/autoconf.h: ref-$(OS)-$(LINUX_VER)/.valid-ref
-       rm -rf $(LINUX_DIR)
-       cp -al $(<D) $(LINUX_DIR)
+$(LINUX_SRCDIR)/.valid-src: ref-$(OS)-$(LINUX_VER)/.valid-ref
+       rm -rf $(LINUX_SRCDIR)
+       cp -al $(<D) $(LINUX_SRCDIR)
        # Apply arch-xen patches
        ( cd linux-$(LINUX_SERIES)-xen-sparse ; \
-          LINUX_ARCH=$(LINUX_ARCH) ./mkbuildtree ../$(LINUX_DIR) )
+          LINUX_ARCH=$(LINUX_ARCH) ./mkbuildtree ../$(LINUX_SRCDIR) )
+       # Patch kernel Makefile to set EXTRAVERSION
+       ( cd $(LINUX_SRCDIR) ; \
+         sed -e 's/^EXTRAVERSION.*/&$$(XENGUEST)/' \
+             -e 's,^KERNELRELEASE=,XENGUEST := $$(shell [ -r 
$$(objtree)/.xenguest ] \&\& cat $$(objtree)/.xenguest)\n&,' Makefile >Mk.tmp ; 
\
+         rm -f Makefile ; mv Mk.tmp Makefile )
+       touch $@
+
+$(LINUX_DIR)/include/linux/autoconf.h: $(LINUX_SRCDIR)/.valid-src
+       rm -rf $(LINUX_DIR)
+       mkdir -p $(LINUX_DIR)
        # Re-use config from install dir if one exits else use default config
-       CONFIG_VERSION=$$(sed -ne 's/^EXTRAVERSION = //p' 
$(LINUX_DIR)/Makefile); \
+       CONFIG_VERSION=$$(sed -ne 's/$$(XENGUEST)//; s/^EXTRAVERSION = //p' 
$(LINUX_SRCDIR)/Makefile); \
        [ -r 
$(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION-$(EXTRAVERSION) ] && \
          cp 
$(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION-$(EXTRAVERSION) 
$(LINUX_DIR)/.config \
-         || cp 
$(LINUX_DIR)/arch/xen/configs/$(EXTRAVERSION)_defconfig_$(XEN_TARGET_ARCH) \
+         || cp 
$(LINUX_SRCDIR)/arch/xen/configs/$(EXTRAVERSION)_defconfig_$(XEN_TARGET_ARCH) \
                $(LINUX_DIR)/.config
        # See if we need to munge config to enable PAE
        $(MAKE) CONFIG_FILE=$(LINUX_DIR)/.config -f buildconfigs/Rules.mk 
config-update-pae
-       # Patch kernel Makefile to set EXTRAVERSION
-       ( cd $(LINUX_DIR) ; \
-         sed -e 's/^EXTRAVERSION.*/&$$(XENGUEST)\nXENGUEST = 
-$(EXTRAVERSION)/' Makefile >Mk.tmp ; \
-         rm -f Makefile ; mv Mk.tmp Makefile )
-       $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) oldconfig
+       echo "-$(EXTRAVERSION)" >$(LINUX_DIR)/.xenguest
+       $(MAKE) -C $(LINUX_SRCDIR) ARCH=$(LINUX_ARCH) oldconfig 
O=$$(/bin/pwd)/$(LINUX_DIR)
 
 prep: $(LINUX_DIR)/include/linux/autoconf.h
 
diff -r 99a1f5dc75a9 -r d48b19263e46 
linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c     Wed Dec 14 02:04:14 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c     Wed Dec 14 02:05:57 2005
@@ -639,6 +639,44 @@
 }
 EXPORT_SYMBOL(notify_remote_via_irq);
 
+void mask_evtchn(int port)
+{
+       shared_info_t *s = HYPERVISOR_shared_info;
+       synch_set_bit(port, &s->evtchn_mask[0]);
+}
+EXPORT_SYMBOL(mask_evtchn);
+
+void unmask_evtchn(int port)
+{
+       shared_info_t *s = HYPERVISOR_shared_info;
+       unsigned int cpu = smp_processor_id();
+       vcpu_info_t *vcpu_info = &s->vcpu_info[cpu];
+
+       /* Slow path (hypercall) if this is a non-local port. */
+       if (unlikely(cpu != cpu_from_evtchn(port))) {
+               evtchn_op_t op = { .cmd = EVTCHNOP_unmask,
+                                  .u.unmask.port = port };
+               (void)HYPERVISOR_event_channel_op(&op);
+               return;
+       }
+
+       synch_clear_bit(port, &s->evtchn_mask[0]);
+
+       /*
+        * The following is basically the equivalent of 'hw_resend_irq'. Just
+        * like a real IO-APIC we 'lose the interrupt edge' if the channel is
+        * masked.
+        */
+       if (synch_test_bit(port, &s->evtchn_pending[0]) && 
+           !synch_test_and_set_bit(port / BITS_PER_LONG,
+                                   &vcpu_info->evtchn_pending_sel)) {
+               vcpu_info->evtchn_upcall_pending = 1;
+               if (!vcpu_info->evtchn_upcall_mask)
+                       force_evtchn_callback();
+       }
+}
+EXPORT_SYMBOL(unmask_evtchn);
+
 void irq_resume(void)
 {
        evtchn_op_t op;
diff -r 99a1f5dc75a9 -r d48b19263e46 
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Wed Dec 14 
02:04:14 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Wed Dec 14 
02:05:57 2005
@@ -10,8 +10,11 @@
  * Copyright (c) 2005, Christopher Clark
  * Copyright (c) 2005, XenSource Ltd
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -820,7 +823,7 @@
 }
 module_exit(xlblk_exit);
 
-MODULE_LICENSE("BSD");
+MODULE_LICENSE("Dual BSD/GPL");
 
 
 /*
diff -r 99a1f5dc75a9 -r d48b19263e46 
linux-2.6-xen-sparse/drivers/xen/console/console.c
--- a/linux-2.6-xen-sparse/drivers/xen/console/console.c        Wed Dec 14 
02:04:14 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c        Wed Dec 14 
02:05:57 2005
@@ -168,7 +168,7 @@
 
 static struct tty_driver *kcons_device(struct console *c, int *index)
 {
-       *index = c->index;
+       *index = 0;
        return xencons_driver;
 }
 
diff -r 99a1f5dc75a9 -r d48b19263e46 
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Wed Dec 14 
02:04:14 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Wed Dec 14 
02:05:57 2005
@@ -4,8 +4,11 @@
  * Copyright (c) 2002-2005, K A Fraser
  * Copyright (c) 2005, XenSource Ltd
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -1294,7 +1297,7 @@
 }
 module_exit(netif_exit);
 
-MODULE_LICENSE("BSD");
+MODULE_LICENSE("Dual BSD/GPL");
  
  
 /* ** /proc **/
diff -r 99a1f5dc75a9 -r d48b19263e46 
linux-2.6-xen-sparse/include/asm-xen/evtchn.h
--- a/linux-2.6-xen-sparse/include/asm-xen/evtchn.h     Wed Dec 14 02:04:14 2005
+++ b/linux-2.6-xen-sparse/include/asm-xen/evtchn.h     Wed Dec 14 02:05:57 2005
@@ -79,46 +79,16 @@
  */
 extern void unbind_from_irqhandler(unsigned int irq, void *dev_id);
 
-/*
- * Unlike notify_remote_via_evtchn(), this is safe to use across
- * save/restore. Notifications on a broken connection are silently dropped.
- */
-void notify_remote_via_irq(int irq);
-
 extern void irq_resume(void);
 
 /* Entry point for notifications into Linux subsystems. */
 asmlinkage void evtchn_do_upcall(struct pt_regs *regs);
 
 /* Entry point for notifications into the userland character device. */
-void evtchn_device_upcall(int port);
+extern void evtchn_device_upcall(int port);
 
-static inline void mask_evtchn(int port)
-{
-       shared_info_t *s = HYPERVISOR_shared_info;
-       synch_set_bit(port, &s->evtchn_mask[0]);
-}
-
-static inline void unmask_evtchn(int port)
-{
-       shared_info_t *s = HYPERVISOR_shared_info;
-       vcpu_info_t *vcpu_info = &s->vcpu_info[smp_processor_id()];
-
-       synch_clear_bit(port, &s->evtchn_mask[0]);
-
-       /*
-        * The following is basically the equivalent of 'hw_resend_irq'. Just
-        * like a real IO-APIC we 'lose the interrupt edge' if the channel is
-        * masked.
-        */
-       if (synch_test_bit(port, &s->evtchn_pending[0]) && 
-           !synch_test_and_set_bit(port / BITS_PER_LONG,
-                                   &vcpu_info->evtchn_pending_sel)) {
-               vcpu_info->evtchn_upcall_pending = 1;
-               if (!vcpu_info->evtchn_upcall_mask)
-                       force_evtchn_callback();
-       }
-}
+extern void mask_evtchn(int port);
+extern void unmask_evtchn(int port);
 
 static inline void clear_evtchn(int port)
 {
@@ -134,6 +104,12 @@
        (void)HYPERVISOR_event_channel_op(&op);
 }
 
+/*
+ * Unlike notify_remote_via_evtchn(), this is safe to use across
+ * save/restore. Notifications on a broken connection are silently dropped.
+ */
+extern void notify_remote_via_irq(int irq);
+
 #endif /* __ASM_EVTCHN_H__ */
 
 /*
diff -r 99a1f5dc75a9 -r d48b19263e46 tools/examples/vif-common.sh
--- a/tools/examples/vif-common.sh      Wed Dec 14 02:04:14 2005
+++ b/tools/examples/vif-common.sh      Wed Dec 14 02:05:57 2005
@@ -51,6 +51,17 @@
 # Check presence of compulsory args.
 XENBUS_PATH="${XENBUS_PATH:?}"
 vif="${vif:?}"
+
+
+vifname=$(xenstore_read_default "$XENBUS_PATH/vifname" "")
+if [ "$vifname" ]
+then
+  if [ "$command" == "online" ] && ! ip link show "$vifname" >&/dev/null
+  then
+    do_or_die ip link set "$vif" name "$vifname"
+  fi
+  vif="$vifname"
+fi
 
 
 function frob_iptable()
diff -r 99a1f5dc75a9 -r d48b19263e46 tools/python/xen/xend/XendClient.py
--- a/tools/python/xen/xend/XendClient.py       Wed Dec 14 02:04:14 2005
+++ b/tools/python/xen/xend/XendClient.py       Wed Dec 14 02:05:57 2005
@@ -354,7 +354,7 @@
 def getHttpServer(srv=None):
     """Create and return a xend client.
     """
-    return Xend(srv=srv, client=XendClientProtocol())
+    return Xend(srv=srv, client=HttpXendClientProtocol())
 
 def getUnixServer(srv=None):
     """Create and return a unix-domain xend client.
diff -r 99a1f5dc75a9 -r d48b19263e46 tools/python/xen/xend/XendProtocol.py
--- a/tools/python/xen/xend/XendProtocol.py     Wed Dec 14 02:04:14 2005
+++ b/tools/python/xen/xend/XendProtocol.py     Wed Dec 14 02:05:57 2005
@@ -13,10 +13,12 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #============================================================================
 # Copyright (C) 2004, 2005 Mike Wray <mike.wray@xxxxxx>
+# Copyright (C) 2005 XenSource Ltd.
 #============================================================================
 
 import socket
 import httplib
+import time
 import types
 
 from encode import *
@@ -165,23 +167,37 @@
         @param method: http method: POST or GET
         @param args:   request arguments (dict)
         """
-        self.request = self.makeRequest(url, method, args)
-        conn = self.makeConnection(url)
-        if DEBUG: conn.set_debuglevel(1)
-        conn.request(method, url.fullpath(), self.request.data, 
self.request.headers)
-        resp = conn.getresponse()
-        self.resp = resp
-        val = self.handleStatus(resp.version, resp.status, resp.reason)
-        if val is None:
-            data = None
-        else:
-            data = resp.read()
-        conn.close()
-        val = self.handleResponse(data)
-        return val
+        retries = 0
+        while retries < 2:
+            self.request = self.makeRequest(url, method, args)
+            conn = self.makeConnection(url)
+            try:
+                if DEBUG: conn.set_debuglevel(1)
+                conn.request(method, url.fullpath(), self.request.data,
+                             self.request.headers)
+                try:
+                    resp = conn.getresponse()
+                    self.resp = resp
+                    val = self.handleStatus(resp.version, resp.status,
+                                            resp.reason)
+                    if val is None:
+                        data = None
+                    else:
+                        data = resp.read()
+                    val = self.handleResponse(data)
+                    return val
+                except httplib.BadStatusLine:
+                    retries += 1
+                    time.sleep(5)
+            finally:
+                conn.close()
+
+        raise XendError("Received invalid response from Xend, twice.")
+
 
     def getHeader(self, key):
         return self.resp.getheader(key)
+
 
 class UnixConnection(httplib.HTTPConnection):
     """Subclass of Python library HTTPConnection that uses a unix-domain 
socket.
diff -r 99a1f5dc75a9 -r d48b19263e46 tools/python/xen/xend/server/netif.py
--- a/tools/python/xen/xend/server/netif.py     Wed Dec 14 02:04:14 2005
+++ b/tools/python/xen/xend/server/netif.py     Wed Dec 14 02:05:57 2005
@@ -74,9 +74,10 @@
         typ = sxp.child_value(config, 'type')
         if typ == 'ioemu':
             return (None,{},{})
-        bridge = sxp.child_value(config, 'bridge')
-        mac    = sxp.child_value(config, 'mac')
-        ipaddr = _get_config_ipaddr(config)
+        bridge  = sxp.child_value(config, 'bridge')
+        mac     = sxp.child_value(config, 'mac')
+        vifname = sxp.child_value(config, 'vifname')
+        ipaddr  = _get_config_ipaddr(config)
 
         devid = self.allocateDeviceID()
 
@@ -90,6 +91,8 @@
             back['ip'] = ' '.join(ipaddr)
         if bridge:
             back['bridge'] = bridge
+        if vifname:
+            back['vifname'] = vifname
 
         front = { 'handle' : "%i" % devid,
                   'mac'    : mac }
@@ -102,9 +105,8 @@
 
         result = DevController.configuration(self, devid)
 
-        (script, ip, bridge, mac) = self.readBackend(devid,
-                                                     'script', 'ip', 'bridge',
-                                                     'mac')
+        (script, ip, bridge, mac, typ, vifname) = self.readBackend(
+            devid, 'script', 'ip', 'bridge', 'mac', 'type', 'vifname')
 
         if script:
             result.append(['script',
@@ -116,5 +118,9 @@
             result.append(['bridge', bridge])
         if mac:
             result.append(['mac', mac])
+        if typ:
+            result.append(['type', typ])
+        if vifname:
+            result.append(['vifname', vifname])
 
         return result
diff -r 99a1f5dc75a9 -r d48b19263e46 tools/python/xen/xm/tests/test_create.py
--- a/tools/python/xen/xm/tests/test_create.py  Wed Dec 14 02:04:14 2005
+++ b/tools/python/xen/xm/tests/test_create.py  Wed Dec 14 02:05:57 2005
@@ -141,5 +141,55 @@
                  })
             
 
+    def testVMXConfigFile(self):
+        (fd, fname) = tempfile.mkstemp()
+        try:
+            os.write(fd,
+                     '''
+kernel = "/usr/lib/xen/boot/vmxloader"
+builder='vmx'
+memory = 128
+name = "ExampleVMXDomain"
+vcpus=1
+vif = [ 'type=ioemu, bridge=xenbr0' ]
+disk = [ 'file:/var/images/min-el3-i386.img,ioemu:hda,w' ]
+device_model = '/usr/lib/xen/bin/qemu-dm'
+sdl=0
+vnc=1
+vncviewer=1
+ne2000=0
+                     ''')
+        finally:
+            os.close(fd)
+
+        self.t('-f %s display=fakedisplay' % fname,
+               { 'kernel'      : '/usr/lib/xen/boot/vmxloader',
+                 'builder'     : 'vmx',
+                 'memory'      : 128,
+                 'name'        : 'ExampleVMXDomain',
+                 'vcpus'       : 1,
+                 'nics'        : -1,
+                 'vif'         : ['type=ioemu, bridge=xenbr0'],
+                 'disk'        : [['file:/var/images/min-el3-i386.img',
+                                   'ioemu:hda', 'w', None]],
+                 'device_model': '/usr/lib/xen/bin/qemu-dm',
+
+                 'extra'       : ('VNC_VIEWER=%s:%d ' %
+                                  (xen.xm.create.get_host_addr(),
+                                   xen.xm.create.VNC_BASE_PORT + 1)),
+                 'vnc'         : 1,
+                 'vncviewer'   : 1,
+
+                 'xm_file'     : fname,
+                 'defconfig'   : fname,
+                 'display'     : 'fakedisplay',
+
+                 'boot'        : 'c',
+                 'dhcp'        : 'off',
+                 'interface'   : 'eth0',
+                 'path'        : '.:/etc/xen',
+               })
+
+
 def test_suite():
     return unittest.makeSuite(test_create)
diff -r 99a1f5dc75a9 -r d48b19263e46 tools/xm-test/lib/XmTestReport/Report.py
--- a/tools/xm-test/lib/XmTestReport/Report.py  Wed Dec 14 02:04:14 2005
+++ b/tools/xm-test/lib/XmTestReport/Report.py  Wed Dec 14 02:05:57 2005
@@ -31,10 +31,12 @@
 import xml.dom.minidom
 import httplib
 import urllib
+import re
 
 #REPORT_HOST = "xmtest-dev.dague.org"
 REPORT_HOST = "xmtest.dague.org"
 REPORT_URL  = "/cgi-bin/report-results";
+VIEW_URL = "cgi-bin/display?view=single&testid="
 
 class XmTestReport:
 
@@ -101,16 +103,21 @@
     conn.request("POST", REPORT_URL, body, headers)
     
     resp = conn.getresponse()
+    data = resp.read()
+
     if resp.status == 200:
         print >>sys.stderr, "Your results have been submitted successfully!"
+        match = re.match("^id=([0-9]+)$", data.split("\n")[1])
+        if match:
+            id = match.group(1)
+            print >>sys.stderr, "See your report at:"
+            print >>sys.stderr, "http://%s/%s%s"; % (REPORT_HOST, VIEW_URL, id)
     else:
         print >>sys.stderr, "Unable to submit results:"
         print >>sys.stderr, "[http://%s%s] said %i: %s" % (REPORT_HOST,
                                                            REPORT_URL,
                                                            resp.status,
                                                            resp.reason)
-
-        data = resp.read()
         print >>sys.stderr, data
 
 if __name__ == "__main__":
diff -r 99a1f5dc75a9 -r d48b19263e46 xen/common/event_channel.c
--- a/xen/common/event_channel.c        Wed Dec 14 02:04:14 2005
+++ b/xen/common/event_channel.c        Wed Dec 14 02:05:57 2005
@@ -3,7 +3,7 @@
  * 
  * Event notifications from VIRQs, PIRQs, and other domains.
  * 
- * Copyright (c) 2003-2004, K A Fraser.
+ * Copyright (c) 2003-2005, K A Fraser.
  * 
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -541,6 +541,41 @@
     return rc;
 }
 
+static long evtchn_unmask(evtchn_unmask_t *unmask)
+{
+    struct domain *d = current->domain;
+    shared_info_t *s = d->shared_info;
+    int            port = unmask->port;
+    struct vcpu   *v;
+
+    spin_lock(&d->evtchn_lock);
+
+    if ( unlikely(!port_is_valid(d, port)) )
+    {
+        spin_unlock(&d->evtchn_lock);
+        return -EINVAL;
+    }
+
+    v = d->vcpu[evtchn_from_port(d, port)->notify_vcpu_id];
+
+    /*
+     * These operations must happen in strict order. Based on
+     * include/xen/event.h:evtchn_set_pending(). 
+     */
+    if ( test_and_clear_bit(port, &s->evtchn_mask[0]) &&
+         test_bit          (port, &s->evtchn_pending[0]) &&
+         !test_and_set_bit (port / BITS_PER_LONG,
+                            &v->vcpu_info->evtchn_pending_sel) &&
+         !test_and_set_bit (0, &v->vcpu_info->evtchn_upcall_pending) )
+    {
+        evtchn_notify(v);
+    }
+
+    spin_unlock(&d->evtchn_lock);
+
+    return 0;
+}
+
 long do_event_channel_op(evtchn_op_t *uop)
 {
     long rc;
@@ -600,6 +635,10 @@
 
     case EVTCHNOP_bind_vcpu:
         rc = evtchn_bind_vcpu(&op.u.bind_vcpu);
+        break;
+
+    case EVTCHNOP_unmask:
+        rc = evtchn_unmask(&op.u.unmask);
         break;
 
     default:
diff -r 99a1f5dc75a9 -r d48b19263e46 xen/include/public/event_channel.h
--- a/xen/include/public/event_channel.h        Wed Dec 14 02:04:14 2005
+++ b/xen/include/public/event_channel.h        Wed Dec 14 02:05:57 2005
@@ -164,6 +164,16 @@
     uint32_t vcpu;
 } evtchn_bind_vcpu_t;
 
+/*
+ * EVTCHNOP_unmask: Unmask the specified local event-channel port and deliver
+ * a notification to the appropriate VCPU if an event is pending.
+ */
+#define EVTCHNOP_unmask           9
+typedef struct evtchn_unmask {
+    /* IN parameters. */
+    evtchn_port_t port;
+} evtchn_unmask_t;
+
 typedef struct evtchn_op {
     uint32_t cmd; /* EVTCHNOP_* */
     union {
@@ -176,6 +186,7 @@
         evtchn_send_t             send;
         evtchn_status_t           status;
         evtchn_bind_vcpu_t        bind_vcpu;
+        evtchn_unmask_t           unmask;
     } u;
 } evtchn_op_t;
 
diff -r 99a1f5dc75a9 -r d48b19263e46 xen/include/xen/event.h
--- a/xen/include/xen/event.h   Wed Dec 14 02:04:14 2005
+++ b/xen/include/xen/event.h   Wed Dec 14 02:05:57 2005
@@ -3,7 +3,7 @@
  * 
  * A nice interface for passing asynchronous events to guest OSes.
  * 
- * Copyright (c) 2002, K A Fraser
+ * Copyright (c) 2002-2005, K A Fraser
  */
 
 #ifndef __XEN_EVENT_H__

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