aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>2005-09-14 15:36:10 -0600
committerdjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>2005-09-14 15:36:10 -0600
commit6be63db55dbb1b1e5f8e0395d65de82d60f5f56a (patch)
tree4ab335f927f9f40947a876d23a1d9096a499e850
parent5b59c8de0c9270ba64ec5d15e1a0ad272f9138a6 (diff)
parent95b767d8e109d10621172621218a4e239ffd25eb (diff)
downloadxen-6be63db55dbb1b1e5f8e0395d65de82d60f5f56a.tar.gz
xen-6be63db55dbb1b1e5f8e0395d65de82d60f5f56a.tar.bz2
xen-6be63db55dbb1b1e5f8e0395d65de82d60f5f56a.zip
Merge latest xen-unstable into xen-ia64-unstable to prep
for push back to xen-unstable
-rw-r--r--.hgignore1
-rw-r--r--docs/misc/sedf_scheduler_mini-HOWTO.txt24
-rw-r--r--extras/mini-os/include/hypervisor.h3
-rw-r--r--extras/mini-os/mm.c2
-rw-r--r--linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c2
-rw-r--r--linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c2
-rw-r--r--linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c36
-rw-r--r--linux-2.6-xen-sparse/arch/xen/i386/mm/init.c2
-rw-r--r--linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c2
-rw-r--r--linux-2.6-xen-sparse/arch/xen/i386/pci/Makefile2
-rw-r--r--linux-2.6-xen-sparse/arch/xen/i386/pci/i386.c304
-rw-r--r--linux-2.6-xen-sparse/arch/xen/kernel/devmem.c10
-rw-r--r--linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c2
-rw-r--r--linux-2.6-xen-sparse/arch/xen/kernel/reboot.c42
-rw-r--r--linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c2
-rw-r--r--linux-2.6-xen-sparse/arch/xen/x86_64/kernel/entry.S8
-rw-r--r--linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c2
-rw-r--r--linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c2
-rw-r--r--linux-2.6-xen-sparse/arch/xen/x86_64/pci/Makefile2
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c2
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/blkback/common.h11
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c4
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c2
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/blkfront/block.h2
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h2
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/blktap/common.h11
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/console/console.c2
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c2
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/netback/netback.c4
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/usbback/common.h2
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c2
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c2
-rw-r--r--linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypervisor.h (renamed from linux-2.6-xen-sparse/include/asm-xen/hypervisor.h)1
-rw-r--r--linux-2.6-xen-sparse/include/asm-xen/asm-i386/mmu_context.h6
-rw-r--r--linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h2
-rw-r--r--linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h2
-rw-r--r--linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypervisor.h2
-rw-r--r--linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mmu_context.h8
-rw-r--r--linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h2
-rw-r--r--linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h2
-rw-r--r--linux-2.6-xen-sparse/include/asm-xen/evtchn.h2
-rw-r--r--linux-2.6-xen-sparse/include/asm-xen/gnttab.h2
-rw-r--r--tools/console/daemon/io.c2
-rw-r--r--tools/console/daemon/utils.c2
-rw-r--r--tools/examples/Makefile10
-rwxr-xr-xtools/examples/network-bridge30
-rwxr-xr-xtools/examples/xen-backend.agent4
-rw-r--r--tools/examples/xmexample.vmx (renamed from tools/examples/xmexample.vmx.in)14
-rw-r--r--tools/firmware/Makefile2
-rw-r--r--tools/ioemu/hw/i8259.c27
-rw-r--r--tools/libxc/xc_domain.c35
-rw-r--r--tools/libxc/xc_linux_restore.c2
-rw-r--r--tools/libxc/xc_linux_save.c2
-rw-r--r--tools/libxc/xc_private.c4
-rw-r--r--tools/libxc/xc_vmx_build.c30
-rw-r--r--tools/libxc/xg_private.c2
-rw-r--r--tools/python/xen/lowlevel/xs/xs.c19
-rw-r--r--tools/python/xen/xend/XendCheckpoint.py40
-rw-r--r--tools/python/xen/xend/XendDomain.py105
-rw-r--r--tools/python/xen/xend/XendDomainInfo.py282
-rw-r--r--tools/python/xen/xend/image.py13
-rw-r--r--tools/python/xen/xend/server/SrvDomain.py42
-rw-r--r--tools/python/xen/xend/server/SrvDomainDir.py2
-rwxr-xr-xtools/python/xen/xend/server/blkif.py4
-rwxr-xr-xtools/python/xen/xend/server/netif.py4
-rw-r--r--tools/python/xen/xend/xenstore/xsnode.py18
-rw-r--r--tools/python/xen/xend/xenstore/xsobj.py32
-rw-r--r--tools/python/xen/xend/xenstore/xstransact.py115
-rw-r--r--tools/python/xen/xend/xenstore/xsutil.py20
-rw-r--r--tools/python/xen/xm/create.py2
-rw-r--r--tools/python/xen/xm/main.py115
-rw-r--r--tools/xenstore/testsuite/16block-watch-crash.test13
-rw-r--r--tools/xenstore/xenstored_core.c1
-rw-r--r--tools/xenstore/xenstored_watch.c2
-rw-r--r--tools/xenstore/xs_test.c16
-rw-r--r--xen/arch/x86/mm.c43
-rw-r--r--xen/arch/x86/vmx.c2
-rw-r--r--xen/arch/x86/vmx_intercept.c8
-rw-r--r--xen/common/schedule.c9
-rw-r--r--xen/include/public/arch-x86_64.h30
-rw-r--r--xen/include/public/io/domain_controller.h787
-rw-r--r--xen/include/public/io/ring.h2
-rw-r--r--xen/include/public/xen.h4
83 files changed, 1051 insertions, 1372 deletions
diff --git a/.hgignore b/.hgignore
index 8b9d816f4b..765ce75534 100644
--- a/.hgignore
+++ b/.hgignore
@@ -84,7 +84,6 @@
^tools/blktap/ublkback/ublkback$
^tools/blktap/xen/.*$
^tools/check/\..*$
-^tools/examples/xmexample\.vmx$
^tools/console/xenconsoled$
^tools/console/xenconsole$
^tools/debugger/pdb/pdb$
diff --git a/docs/misc/sedf_scheduler_mini-HOWTO.txt b/docs/misc/sedf_scheduler_mini-HOWTO.txt
index ad3cc62e1f..52e5b6ead3 100644
--- a/docs/misc/sedf_scheduler_mini-HOWTO.txt
+++ b/docs/misc/sedf_scheduler_mini-HOWTO.txt
@@ -10,7 +10,7 @@ Overview:
Usage:
   -add "sched=sedf" on Xen's boot command-line
   -create domains as usual
-   -use "xm sedf <dom-id> <period> <slice> <latency-hint> <extra> <weight>"
+   -use "xm sched-sedf <dom-id> <period> <slice> <latency-hint> <extra> <weight>"
  Where:
  -period/slice are the normal EDF scheduling parameters in nanosecs
  -latency-hint is the scaled period in case the domain is doing heavy I/O
@@ -22,23 +22,23 @@ Usage:
Examples:
 normal EDF (20ms/5ms):
-  xm sedf <dom-id> 20000000 5000000 0 0 0
+  xm sched-sedf <dom-id> 20000000 5000000 0 0 0
 best-effort domains (i.e. non-realtime):
-  xm sedf <dom-id> 20000000 0 0 1 0
+  xm sched-sedf <dom-id> 20000000 0 0 1 0
 
normal EDF (20ms/5ms) + share of extra-time:
-  xm sedf <dom-id> 20000000 5000000 0 1 0
+  xm sched-sedf <dom-id> 20000000 5000000 0 1 0
 4 domains with weights 2:3:4:2
-  xm sedf <d1> 0 0 0 0 2
-  xm sedf <d2> 0 0 0 0 3
-  xm sedf <d3> 0 0 0 0 4
-  xm sedf <d4> 0 0 0 0 2
+  xm sched-sedf <d1> 0 0 0 0 2
+  xm sched-sedf <d2> 0 0 0 0 3
+  xm sched-sedf <d3> 0 0 0 0 4
+  xm sched-sedf <d4> 0 0 0 0 2
 1 fully-specified (10ms/3ms) domain, 3 other domains share
 available rest in 2:7:3 ratio:
-  xm sedf <d1> 10000000 3000000 0 0 0
-  xm sedf <d2> 0 0 0 0 2
-  xm sedf <d3> 0 0 0 0 7
-  xm sedf <d4> 0 0 0 0 3 \ No newline at end of file
+  xm sched-sedf <d1> 10000000 3000000 0 0 0
+  xm sched-sedf <d2> 0 0 0 0 2
+  xm sched-sedf <d3> 0 0 0 0 7
+  xm sched-sedf <d4> 0 0 0 0 3
diff --git a/extras/mini-os/include/hypervisor.h b/extras/mini-os/include/hypervisor.h
index ee96d30bb0..d8b9b62948 100644
--- a/extras/mini-os/include/hypervisor.h
+++ b/extras/mini-os/include/hypervisor.h
@@ -14,9 +14,6 @@
#include <types.h>
#include <xen/xen.h>
-#include <xen/io/domain_controller.h>
-
-
/*
* a placeholder for the start of day information passed up from the hypervisor
diff --git a/extras/mini-os/mm.c b/extras/mini-os/mm.c
index 72970bca92..700805723e 100644
--- a/extras/mini-os/mm.c
+++ b/extras/mini-os/mm.c
@@ -432,7 +432,7 @@ void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
/* Pin the page to provide correct protection */
pin_request.cmd = MMUEXT_PIN_L1_TABLE;
- pin_request.mfn = pfn_to_mfn(pt_frame);
+ pin_request.arg1.mfn = pfn_to_mfn(pt_frame);
if(HYPERVISOR_mmuext_op(&pin_request, 1, NULL, DOMID_SELF) < 0)
{
printk("ERROR: pinning failed\n");
diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c
index 31ded2cf58..861c2d2f62 100644
--- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c
+++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c
@@ -15,7 +15,7 @@
#include <asm/apic.h>
#include <mach_apic.h>
#endif
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include "cpu.h"
diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c
index 1855042fa0..7915b4f394 100644
--- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c
+++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c
@@ -53,7 +53,7 @@
#include <asm/io_apic.h>
#include <asm/ist.h>
#include <asm/io.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm-xen/xen-public/physdev.h>
#include <asm-xen/xen-public/memory.h>
#include "setup_arch_pre.h"
diff --git a/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c b/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c
index 7332d2f9af..a30d64f876 100644
--- a/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c
+++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c
@@ -33,7 +33,7 @@
#include <linux/vmalloc.h>
#include <asm/page.h>
#include <asm/pgtable.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm-xen/balloon.h>
#include <asm-xen/xen-public/memory.h>
#include <linux/module.h>
@@ -115,7 +115,7 @@ void xen_pt_switch(unsigned long ptr)
{
struct mmuext_op op;
op.cmd = MMUEXT_NEW_BASEPTR;
- op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
+ op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
@@ -123,7 +123,7 @@ void xen_new_user_pt(unsigned long ptr)
{
struct mmuext_op op;
op.cmd = MMUEXT_NEW_USER_BASEPTR;
- op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
+ op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
@@ -138,7 +138,7 @@ void xen_invlpg(unsigned long ptr)
{
struct mmuext_op op;
op.cmd = MMUEXT_INVLPG_LOCAL;
- op.linear_addr = ptr & PAGE_MASK;
+ op.arg1.linear_addr = ptr & PAGE_MASK;
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
@@ -157,7 +157,7 @@ void xen_tlb_flush_mask(cpumask_t *mask)
if ( cpus_empty(*mask) )
return;
op.cmd = MMUEXT_TLB_FLUSH_MULTI;
- op.vcpumask = mask->bits;
+ op.arg2.vcpumask = mask->bits;
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
@@ -165,7 +165,7 @@ void xen_invlpg_all(unsigned long ptr)
{
struct mmuext_op op;
op.cmd = MMUEXT_INVLPG_ALL;
- op.linear_addr = ptr & PAGE_MASK;
+ op.arg1.linear_addr = ptr & PAGE_MASK;
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
@@ -175,8 +175,8 @@ void xen_invlpg_mask(cpumask_t *mask, unsigned long ptr)
if ( cpus_empty(*mask) )
return;
op.cmd = MMUEXT_INVLPG_MULTI;
- op.vcpumask = mask->bits;
- op.linear_addr = ptr & PAGE_MASK;
+ op.arg1.linear_addr = ptr & PAGE_MASK;
+ op.arg2.vcpumask = mask->bits;
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
@@ -193,7 +193,7 @@ void xen_pgd_pin(unsigned long ptr)
#else
op.cmd = MMUEXT_PIN_L2_TABLE;
#endif
- op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
+ op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
@@ -201,7 +201,7 @@ void xen_pgd_unpin(unsigned long ptr)
{
struct mmuext_op op;
op.cmd = MMUEXT_UNPIN_TABLE;
- op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
+ op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
@@ -209,7 +209,7 @@ void xen_pte_pin(unsigned long ptr)
{
struct mmuext_op op;
op.cmd = MMUEXT_PIN_L1_TABLE;
- op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
+ op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
@@ -217,7 +217,7 @@ void xen_pte_unpin(unsigned long ptr)
{
struct mmuext_op op;
op.cmd = MMUEXT_UNPIN_TABLE;
- op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
+ op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
@@ -226,7 +226,7 @@ void xen_pud_pin(unsigned long ptr)
{
struct mmuext_op op;
op.cmd = MMUEXT_PIN_L3_TABLE;
- op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
+ op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
@@ -234,7 +234,7 @@ void xen_pud_unpin(unsigned long ptr)
{
struct mmuext_op op;
op.cmd = MMUEXT_UNPIN_TABLE;
- op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
+ op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
@@ -242,7 +242,7 @@ void xen_pmd_pin(unsigned long ptr)
{
struct mmuext_op op;
op.cmd = MMUEXT_PIN_L2_TABLE;
- op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
+ op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
@@ -250,7 +250,7 @@ void xen_pmd_unpin(unsigned long ptr)
{
struct mmuext_op op;
op.cmd = MMUEXT_UNPIN_TABLE;
- op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
+ op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
#endif /* CONFIG_X86_64 */
@@ -260,8 +260,8 @@ void xen_set_ldt(unsigned long ptr, unsigned long len)
{
struct mmuext_op op;
op.cmd = MMUEXT_SET_LDT;
- op.linear_addr = ptr;
- op.nr_ents = len;
+ op.arg1.linear_addr = ptr;
+ op.arg2.nr_ents = len;
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
diff --git a/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c b/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c
index 4ef646b3fe..b5f7005012 100644
--- a/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c
+++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c
@@ -39,7 +39,7 @@
#include <asm/tlb.h>
#include <asm/tlbflush.h>
#include <asm/sections.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
extern unsigned long *contiguous_bitmap;
diff --git a/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c b/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c
index e46d69df0d..503d48842a 100644
--- a/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c
+++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c
@@ -25,7 +25,7 @@
#include <asm/mmu_context.h>
#include <asm-xen/foreign_page.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
void show_mem(void)
{
diff --git a/linux-2.6-xen-sparse/arch/xen/i386/pci/Makefile b/linux-2.6-xen-sparse/arch/xen/i386/pci/Makefile
index 263411c635..8ee668f45a 100644
--- a/linux-2.6-xen-sparse/arch/xen/i386/pci/Makefile
+++ b/linux-2.6-xen-sparse/arch/xen/i386/pci/Makefile
@@ -2,7 +2,7 @@ XENARCH := $(subst ",,$(CONFIG_XENARCH))
CFLAGS += -Iarch/$(XENARCH)/pci
-c-obj-y := i386.o
+obj-y := i386.o
#c-obj-$(CONFIG_PCI_BIOS) += pcbios.o
c-obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o
diff --git a/linux-2.6-xen-sparse/arch/xen/i386/pci/i386.c b/linux-2.6-xen-sparse/arch/xen/i386/pci/i386.c
new file mode 100644
index 0000000000..e132e7d42d
--- /dev/null
+++ b/linux-2.6-xen-sparse/arch/xen/i386/pci/i386.c
@@ -0,0 +1,304 @@
+/*
+ * Low-Level PCI Access for i386 machines
+ *
+ * Copyright 1993, 1994 Drew Eckhardt
+ * Visionary Computing
+ * (Unix and Linux consulting and custom programming)
+ * Drew@Colorado.EDU
+ * +1 (303) 786-7975
+ *
+ * Drew's work was sponsored by:
+ * iX Multiuser Multitasking Magazine
+ * Hannover, Germany
+ * hm@ix.de
+ *
+ * Copyright 1997--2000 Martin Mares <mj@ucw.cz>
+ *
+ * For more information, please consult the following manuals (look at
+ * http://www.pcisig.com/ for how to get them):
+ *
+ * PCI BIOS Specification
+ * PCI Local Bus Specification
+ * PCI to PCI Bridge Specification
+ * PCI System Design Guide
+ *
+ */
+
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/errno.h>
+
+#include "pci.h"
+
+/*
+ * We need to avoid collisions with `mirrored' VGA ports
+ * and other strange ISA hardware, so we always want the
+ * addresses to be allocated in the 0x000-0x0ff region
+ * modulo 0x400.
+ *
+ * Why? Because some silly external IO cards only decode
+ * the low 10 bits of the IO address. The 0x00-0xff region
+ * is reserved for motherboard devices that decode all 16
+ * bits, so it's ok to allocate at, say, 0x2800-0x28ff,
+ * but we want to try to avoid allocating at 0x2900-0x2bff
+ * which might have be mirrored at 0x0100-0x03ff..
+ */
+void
+pcibios_align_resource(void *data, struct resource *res,
+ unsigned long size, unsigned long align)
+{
+ if (res->flags & IORESOURCE_IO) {
+ unsigned long start = res->start;
+
+ if (start & 0x300) {
+ start = (start + 0x3ff) & ~0x3ff;
+ res->start = start;
+ }
+ }
+}
+
+
+/*
+ * Handle resources of PCI devices. If the world were perfect, we could
+ * just allocate all the resource regions and do nothing more. It isn't.
+ * On the other hand, we cannot just re-allocate all devices, as it would
+ * require us to know lots of host bridge internals. So we attempt to
+ * keep as much of the original configuration as possible, but tweak it
+ * when it's found to be wrong.
+ *
+ * Known BIOS problems we have to work around:
+ * - I/O or memory regions not configured
+ * - regions configured, but not enabled in the command register
+ * - bogus I/O addresses above 64K used
+ * - expansion ROMs left enabled (this may sound harmless, but given
+ * the fact the PCI specs explicitly allow address decoders to be
+ * shared between expansion ROMs and other resource regions, it's
+ * at least dangerous)
+ *
+ * Our solution:
+ * (1) Allocate resources for all buses behind PCI-to-PCI bridges.
+ * This gives us fixed barriers on where we can allocate.
+ * (2) Allocate resources for all enabled devices. If there is
+ * a collision, just mark the resource as unallocated. Also
+ * disable expansion ROMs during this step.
+ * (3) Try to allocate resources for disabled devices. If the
+ * resources were assigned correctly, everything goes well,
+ * if they weren't, they won't disturb allocation of other
+ * resources.
+ * (4) Assign new addresses to resources which were either
+ * not configured at all or misconfigured. If explicitly
+ * requested by the user, configure expansion ROM address
+ * as well.
+ */
+
+static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
+{
+ struct pci_bus *bus;
+ struct pci_dev *dev;
+ int idx;
+ struct resource *r, *pr;
+
+ /* Depth-First Search on bus tree */
+ list_for_each_entry(bus, bus_list, node) {
+ if ((dev = bus->self)) {
+ for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) {
+ r = &dev->resource[idx];
+ if (!r->start)
+ continue;
+ pr = pci_find_parent_resource(dev, r);
+ if (!pr || request_resource(pr, r) < 0)
+ printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev));
+ }
+ }
+ pcibios_allocate_bus_resources(&bus->children);
+ }
+}
+
+static void __init pcibios_allocate_resources(int pass)
+{
+ struct pci_dev *dev = NULL;
+ int idx, disabled;
+ u16 command;
+ struct resource *r, *pr;
+
+ for_each_pci_dev(dev) {
+ pci_read_config_word(dev, PCI_COMMAND, &command);
+ for(idx = 0; idx < 6; idx++) {
+ r = &dev->resource[idx];
+ if (r->parent) /* Already allocated */
+ continue;
+ if (!r->start) /* Address not assigned at all */
+ continue;
+ if (r->flags & IORESOURCE_IO)
+ disabled = !(command & PCI_COMMAND_IO);
+ else
+ disabled = !(command & PCI_COMMAND_MEMORY);
+ if (pass == disabled) {
+ DBG("PCI: Resource %08lx-%08lx (f=%lx, d=%d, p=%d)\n",
+ r->start, r->end, r->flags, disabled, pass);
+ pr = pci_find_parent_resource(dev, r);
+ if (!pr || request_resource(pr, r) < 0) {
+ printk(KERN_ERR "PCI: Cannot allocate resource region %d of device %s\n", idx, pci_name(dev));
+ /* We'll assign a new address later */
+ r->end -= r->start;
+ r->start = 0;
+ }
+ }
+ }
+ if (!pass) {
+ r = &dev->resource[PCI_ROM_RESOURCE];
+ if (r->flags & IORESOURCE_ROM_ENABLE) {
+ /* Turn the ROM off, leave the resource region, but keep it unregistered. */
+ u32 reg;
+ DBG("PCI: Switching off ROM of %s\n", pci_name(dev));
+ r->flags &= ~IORESOURCE_ROM_ENABLE;
+ pci_read_config_dword(dev, dev->rom_base_reg, &reg);
+ pci_write_config_dword(dev, dev->rom_base_reg, reg & ~PCI_ROM_ADDRESS_ENABLE);
+ }
+ }
+ }
+}
+
+static int __init pcibios_assign_resources(void)
+{
+ struct pci_dev *dev = NULL;
+ int idx;
+ struct resource *r;
+
+ for_each_pci_dev(dev) {
+ int class = dev->class >> 8;
+
+ /* Don't touch classless devices and host bridges */
+ if (!class || class == PCI_CLASS_BRIDGE_HOST)
+ continue;
+
+ for(idx=0; idx<6; idx++) {
+ r = &dev->resource[idx];
+
+ /*
+ * Don't touch IDE controllers and I/O ports of video cards!
+ */
+ if ((class == PCI_CLASS_STORAGE_IDE && idx < 4) ||
+ (class == PCI_CLASS_DISPLAY_VGA && (r->flags & IORESOURCE_IO)))
+ continue;
+
+ /*
+ * We shall assign a new address to this resource, either because
+ * the BIOS forgot to do so or because we have decided the old
+ * address was unusable for some reason.
+ */
+ if (!r->start && r->end)
+ pci_assign_resource(dev, idx);
+ }
+
+ if (pci_probe & PCI_ASSIGN_ROMS) {
+ r = &dev->resource[PCI_ROM_RESOURCE];
+ r->end -= r->start;
+ r->start = 0;
+ if (r->end)
+ pci_assign_resource(dev, PCI_ROM_RESOURCE);
+ }
+ }
+ return 0;
+}
+
+void __init pcibios_resource_survey(void)
+{
+ DBG("PCI: Allocating resources\n");
+ pcibios_allocate_bus_resources(&pci_root_buses);
+ pcibios_allocate_resources(0);
+ pcibios_allocate_resources(1);
+}
+
+/**
+ * called in fs_initcall (one below subsys_initcall),
+ * give a chance for motherboard reserve resources
+ */
+fs_initcall(pcibios_assign_resources);
+
+int pcibios_enable_resources(struct pci_dev *dev, int mask)
+{
+ u16 cmd, old_cmd;
+ int idx;
+ struct resource *r;
+
+ pci_read_config_word(dev, PCI_COMMAND, &cmd);
+ old_cmd = cmd;
+ for(idx=0; idx<6; idx++) {
+ /* Only set up the requested stuff */
+ if (!(mask & (1<<idx)))
+ continue;
+
+ r = &dev->resource[idx];
+ if (!r->start && r->end) {
+ printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev));
+ return -EINVAL;
+ }
+ if (r->flags & IORESOURCE_IO)
+ cmd |= PCI_COMMAND_IO;
+ if (r->flags & IORESOURCE_MEM)
+ cmd |= PCI_COMMAND_MEMORY;
+ }
+ if (dev->resource[PCI_ROM_RESOURCE].start)
+ cmd |= PCI_COMMAND_MEMORY;
+ if (cmd != old_cmd) {
+ printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd);
+ pci_write_config_word(dev, PCI_COMMAND, cmd);
+ }
+ return 0;
+}
+
+/*
+ * If we set up a device for bus mastering, we need to check the latency
+ * timer as certain crappy BIOSes forget to set it properly.
+ */
+unsigned int pcibios_max_latency = 255;
+
+void pcibios_set_master(struct pci_dev *dev)
+{
+ u8 lat;
+ pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
+ if (lat < 16)
+ lat = (64 <= pcibios_max_latency) ? 64 : pcibios_max_latency;
+ else if (lat > pcibios_max_latency)
+ lat = pcibios_max_latency;
+ else
+ return;
+ printk(KERN_DEBUG "PCI: Setting latency timer of device %s to %d\n", pci_name(dev), lat);
+ pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
+}
+
+int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
+ enum pci_mmap_state mmap_state, int write_combine)
+{
+ unsigned long prot;
+
+ /* I/O space cannot be accessed via normal processor loads and
+ * stores on this platform.
+ */
+ if (mmap_state == pci_mmap_io)
+ return -EINVAL;
+
+ /* Leave vm_pgoff as-is, the PCI space address is the physical
+ * address on this platform.
+ */
+ vma->vm_flags |= (VM_SHM | VM_LOCKED | VM_IO);
+
+ prot = pgprot_val(vma->vm_page_prot);
+ if (boot_cpu_data.x86 > 3)
+ prot |= _PAGE_PCD | _PAGE_PWT;
+ vma->vm_page_prot = __pgprot(prot);
+
+ /* Write-combine setting is ignored, it is changed via the mtrr
+ * interfaces on this platform.
+ */
+ if (direct_remap_pfn_range(vma->vm_mm, vma->vm_start, vma->vm_pgoff,
+ vma->vm_end - vma->vm_start,
+ vma->vm_page_prot, DOMID_IO))
+ return -EAGAIN;
+
+ return 0;
+}
diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/devmem.c b/linux-2.6-xen-sparse/arch/xen/kernel/devmem.c
index 456091775b..3b713f6375 100644
--- a/linux-2.6-xen-sparse/arch/xen/kernel/devmem.c
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/devmem.c
@@ -27,7 +27,7 @@
#include <asm/uaccess.h>
#include <asm/io.h>
-static inline int uncached_access(struct file *file, unsigned long addr)
+static inline int uncached_access(struct file *file)
{
if (file->f_flags & O_SYNC)
return 1;
@@ -90,10 +90,9 @@ out:
static int mmap_mem(struct file * file, struct vm_area_struct * vma)
{
- unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
int uncached;
- uncached = uncached_access(file, offset);
+ uncached = uncached_access(file);
if (uncached)
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
@@ -106,8 +105,9 @@ static int mmap_mem(struct file * file, struct vm_area_struct * vma)
if (uncached)
vma->vm_flags |= VM_IO;
- if (io_remap_page_range(vma, vma->vm_start, offset,
- vma->vm_end-vma->vm_start, vma->vm_page_prot))
+ if (direct_remap_pfn_range(vma->vm_mm, vma->vm_start, vma->vm_pgoff,
+ vma->vm_end - vma->vm_start,
+ vma->vm_page_prot, DOMID_IO))
return -EAGAIN;
return 0;
diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c
index 5926bcf99e..42508d78fd 100644
--- a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c
@@ -40,7 +40,7 @@
#include <asm/synch_bitops.h>
#include <asm-xen/xen-public/event_channel.h>
#include <asm-xen/xen-public/physdev.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm-xen/evtchn.h>
/*
diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
index 2358970468..7a8842630b 100644
--- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
@@ -10,7 +10,7 @@
#include <asm/irq.h>
#include <asm/mmu_context.h>
#include <asm-xen/evtchn.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm-xen/xen-public/dom0_ops.h>
#include <asm-xen/queues.h>
#include <asm-xen/xenbus.h>
@@ -320,20 +320,28 @@ static void __shutdown_handler(void *unused)
static void shutdown_handler(struct xenbus_watch *watch, const char *node)
{
static DECLARE_WORK(shutdown_work, __shutdown_handler, NULL);
-
char *str;
+ int err;
+ again:
+ err = xenbus_transaction_start("control");
+ if (err)
+ return;
str = (char *)xenbus_read("control", "shutdown", NULL);
- /* Ignore read errors. */
- if (IS_ERR(str))
- return;
- if (strlen(str) == 0) {
- kfree(str);
- return;
+ /* Ignore read errors and empty reads. */
+ if (XENBUS_IS_ERR_READ(str)) {
+ xenbus_transaction_end(1);
+ return;
}
xenbus_write("control", "shutdown", "", O_CREAT);
+ err = xenbus_transaction_end(0);
+ if (err == -ETIMEDOUT) {
+ kfree(str);
+ goto again;
+ }
+
if (strcmp(str, "poweroff") == 0)
shutting_down = SHUTDOWN_POWEROFF;
else if (strcmp(str, "reboot") == 0)
@@ -355,16 +363,26 @@ static void shutdown_handler(struct xenbus_watch *watch, const char *node)
static void sysrq_handler(struct xenbus_watch *watch, const char *node)
{
char sysrq_key = '\0';
-
+ int err;
+
+ again:
+ err = xenbus_transaction_start("control");
+ if (err)
+ return;
if (!xenbus_scanf("control", "sysrq", "%c", &sysrq_key)) {
printk(KERN_ERR "Unable to read sysrq code in control/sysrq\n");
- return;
+ xenbus_transaction_end(1);
+ return;
}
- xenbus_printf("control", "sysrq", "%c", '\0');
+ if (sysrq_key != '\0')
+ xenbus_printf("control", "sysrq", "%c", '\0');
- if (sysrq_key != '\0') {
+ err = xenbus_transaction_end(0);
+ if (err == -ETIMEDOUT)
+ goto again;
+ if (sysrq_key != '\0') {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
handle_sysrq(sysrq_key, NULL, NULL);
#else
diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c b/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c
index a7fe1519f6..1a1d113186 100644
--- a/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c
@@ -12,7 +12,7 @@
#include <linux/init.h>
#include <asm/io.h>
#include <asm/page.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
/* Referenced in netback.c. */
/*static*/ kmem_cache_t *skbuff_cachep;
diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/entry.S b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/entry.S
index 2898cef5d7..621a6f9f5f 100644
--- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/entry.S
+++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/entry.S
@@ -751,10 +751,10 @@ ecrit: /**** END OF CRITICAL REGION ****/
# Hypervisor uses this for application faults while it executes.
ENTRY(failsafe_callback)
addq $0x10,%rsp /* skip rcx and r11 */
-1: movl (%rsp),%ds
-2: movl 8(%rsp),%es
-3: movl 16(%rsp),%fs
-4: movl 24(%rsp),%gs
+1: mov (%rsp),%ds
+2: mov 8(%rsp),%es
+3: mov 16(%rsp),%fs
+4: mov 24(%rsp),%gs
addq $0x20,%rsp /* skip the above selectors */
SAVE_ALL
jmp error_exit
diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c
index 9b3d47b29c..cb0ffc9e51 100644
--- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c
+++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c
@@ -61,7 +61,7 @@
#include <linux/percpu.h>
#include <asm-xen/xen-public/physdev.h>
#include "setup_arch_pre.h"
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
#define PFN_PHYS(x) ((x) << PAGE_SHIFT)
#define end_pfn_map end_pfn
diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c
index 6d2e43d67e..fc8eff4402 100644
--- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c
+++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c
@@ -31,7 +31,7 @@
#include <asm/mman.h>
#include <asm/numa.h>
#ifdef CONFIG_XEN
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#endif
char x86_boot_params[BOOT_PARAM_SIZE] __initdata = {0,};
diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/pci/Makefile b/linux-2.6-xen-sparse/arch/xen/x86_64/pci/Makefile
index 25b13a3b4a..d88992e155 100644
--- a/linux-2.6-xen-sparse/arch/xen/x86_64/pci/Makefile
+++ b/linux-2.6-xen-sparse/arch/xen/x86_64/pci/Makefile
@@ -8,7 +8,7 @@ CFLAGS += -Iarch/$(XENARCH)/pci
CFLAGS += -Iarch/i386/pci
-c-i386-obj-y := i386.o
+c-xen-obj-y := i386.o
c-i386-obj-y += fixup.o
c-i386-obj-$(CONFIG_ACPI_PCI) += acpi.o
c-i386-obj-y += legacy.o common.o
diff --git a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
index 8887c69e73..521252c8ce 100644
--- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
+++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
@@ -42,7 +42,7 @@
#include <linux/highmem.h>
#include <linux/vmalloc.h>
#include <asm-xen/xen_proc.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm-xen/balloon.h>
#include <asm-xen/xen-public/memory.h>
#include <asm/pgalloc.h>
diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/common.h b/linux-2.6-xen-sparse/drivers/xen/blkback/common.h
index 784fd9a020..ab84e270b2 100644
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/common.h
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/common.h
@@ -13,7 +13,7 @@
#include <asm/setup.h>
#include <asm/pgalloc.h>
#include <asm-xen/evtchn.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm-xen/xen-public/io/blkif.h>
#include <asm-xen/xen-public/io/ring.h>
#include <asm-xen/gnttab.h>
@@ -33,7 +33,7 @@ struct vbd {
blkif_vdev_t handle; /* what the domain refers to this vbd as */
unsigned char readonly; /* Non-zero -> read-only */
unsigned char type; /* VDISK_xxx */
- blkif_pdev_t pdevice; /* phys device that this vbd maps to */
+ u32 pdevice; /* phys device that this vbd maps to */
struct block_device *bdev;
};
@@ -65,11 +65,6 @@ typedef struct blkif_st {
grant_ref_t shmem_ref;
} blkif_t;
-void blkif_create(blkif_be_create_t *create);
-void blkif_destroy(blkif_be_destroy_t *destroy);
-void blkif_connect(blkif_be_connect_t *connect);
-int blkif_disconnect(blkif_be_disconnect_t *disconnect, u8 rsp_id);
-void blkif_disconnect_complete(blkif_t *blkif);
blkif_t *alloc_blkif(domid_t domid);
void free_blkif_callback(blkif_t *blkif);
int blkif_map(blkif_t *blkif, unsigned long shared_page, unsigned int evtchn);
@@ -82,7 +77,7 @@ int blkif_map(blkif_t *blkif, unsigned long shared_page, unsigned int evtchn);
} while (0)
/* Create a vbd. */
-int vbd_create(blkif_t *blkif, blkif_vdev_t vdevice, blkif_pdev_t pdevice,
+int vbd_create(blkif_t *blkif, blkif_vdev_t vdevice, u32 pdevice,
int readonly);
void vbd_free(struct vbd *vbd);
diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c b/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c
index f3b73cdec0..4853a14cc1 100644
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c
@@ -9,7 +9,7 @@
#include "common.h"
#include <asm-xen/xenbus.h>
-static inline dev_t vbd_map_devnum(blkif_pdev_t cookie)
+static inline dev_t vbd_map_devnum(u32 cookie)
{
return MKDEV(BLKIF_MAJOR(cookie), BLKIF_MINOR(cookie));
}
@@ -33,7 +33,7 @@ unsigned long vbd_secsize(struct vbd *vbd)
}
int vbd_create(blkif_t *blkif, blkif_vdev_t handle,
- blkif_pdev_t pdevice, int readonly)
+ u32 pdevice, int readonly)
{
struct vbd *vbd;
diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c
index 17760646ab..c081aa8240 100644
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c
@@ -178,6 +178,8 @@ static void backend_changed(struct xenbus_watch *watch, const char *node)
err = vbd_create(be->blkif, handle, be->pdev, be->readonly);
if (err) {
+ blkif_put(be->blkif);
+ be->blkif = NULL;
xenbus_dev_error(dev, err, "creating vbd structure");
return;
}
diff --git a/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h b/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h
index 5d1e38564e..d1853322e9 100644
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h
@@ -45,7 +45,7 @@
#include <linux/blkdev.h>
#include <linux/major.h>
#include <linux/devfs_fs_kernel.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm-xen/xenbus.h>
#include <asm-xen/gnttab.h>
#include <asm-xen/xen-public/xen.h>
diff --git a/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h b/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h
index fb6be0e0e4..7bc92ab2b0 100644
--- a/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h
+++ b/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h
@@ -20,7 +20,7 @@
#include <asm/io.h>
#include <asm/setup.h>
#include <asm/pgalloc.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm-xen/xen-public/io/blkif.h>
#include <asm-xen/xen-public/io/ring.h>
diff --git a/linux-2.6-xen-sparse/drivers/xen/blktap/common.h b/linux-2.6-xen-sparse/drivers/xen/blktap/common.h
index 3239a17d6b..2b2d6593f8 100644
--- a/linux-2.6-xen-sparse/drivers/xen/blktap/common.h
+++ b/linux-2.6-xen-sparse/drivers/xen/blktap/common.h
@@ -13,7 +13,7 @@
#include <asm/setup.h>
#include <asm/pgalloc.h>
#include <asm-xen/evtchn.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm-xen/xen-public/io/blkif.h>
#include <asm-xen/xen-public/io/ring.h>
#include <asm-xen/gnttab.h>
@@ -35,7 +35,7 @@ struct vbd {
blkif_vdev_t handle; /* what the domain refers to this vbd as */
unsigned char readonly; /* Non-zero -> read-only */
unsigned char type; /* VDISK_xxx */
- blkif_pdev_t pdevice; /* phys device that this vbd maps to */
+ u32 pdevice; /* phys device that this vbd maps to */
struct block_device *bdev;
};
@@ -67,11 +67,6 @@ typedef struct blkif_st {
grant_ref_t shmem_ref;
} blkif_t;
-void blkif_create(blkif_be_create_t *create);
-void blkif_destroy(blkif_be_destroy_t *destroy);
-void blkif_connect(blkif_be_connect_t *connect);
-int blkif_disconnect(blkif_be_disconnect_t *disconnect, u8 rsp_id);
-void blkif_disconnect_complete(blkif_t *blkif);
blkif_t *alloc_blkif(domid_t domid);
void free_blkif_callback(blkif_t *blkif);
int blkif_map(blkif_t *blkif, unsigned long shared_page, unsigned int evtchn);
@@ -84,7 +79,7 @@ int blkif_map(blkif_t *blkif, unsigned long shared_page, unsigned int evtchn);
} while (0)
/* Create a vbd. */
-int vbd_create(blkif_t *blkif, blkif_vdev_t vdevice, blkif_pdev_t pdevice,
+int vbd_create(blkif_t *blkif, blkif_vdev_t vdevice, u32 pdevice,
int readonly);
void vbd_free(struct vbd *vbd);
diff --git a/linux-2.6-xen-sparse/drivers/xen/console/console.c b/linux-2.6-xen-sparse/drivers/xen/console/console.c
index 087891ee4d..f05d06136d 100644
--- a/linux-2.6-xen-sparse/drivers/xen/console/console.c
+++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c
@@ -51,7 +51,7 @@
#include <asm/uaccess.h>
#include <asm-xen/xen-public/xen.h>
#include <asm-xen/xen-public/event_channel.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm-xen/evtchn.h>
#include "xencons_ring.h"
diff --git a/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c b/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c
index eb205ee377..154b0c7354 100644
--- a/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c
+++ b/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c
@@ -13,7 +13,7 @@
#include <linux/mm.h>
#include <linux/slab.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm-xen/evtchn.h>
#include <linux/wait.h>
#include <linux/interrupt.h>
diff --git a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c
index 40eac7b491..2267c3c1e4 100644
--- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c
@@ -294,7 +294,7 @@ static void net_rx_action(unsigned long unused)
mcl++;
mmuext->cmd = MMUEXT_REASSIGN_PAGE;
- mmuext->mfn = old_mfn;
+ mmuext->arg1.mfn = old_mfn;
mmuext++;
#endif
mmu->ptr = ((unsigned long long)new_mfn << PAGE_SHIFT) | MMU_MACHPHYS_UPDATE;
@@ -355,7 +355,7 @@ static void net_rx_action(unsigned long unused)
#ifdef CONFIG_XEN_NETDEV_GRANT
old_mfn = 0; /* XXX Fix this so we can free_mfn() on error! */
#else
- old_mfn = mmuext[0].mfn;
+ old_mfn = mmuext[0].arg1.mfn;
#endif
atomic_set(&(skb_shinfo(skb)->dataref), 1);
skb_shinfo(skb)->nr_frags = 0;
diff --git a/linux-2.6-xen-sparse/drivers/xen/usbback/common.h b/linux-2.6-xen-sparse/drivers/xen/usbback/common.h
index 56b3bc31df..b7799ed895 100644
--- a/linux-2.6-xen-sparse/drivers/xen/usbback/common.h
+++ b/linux-2.6-xen-sparse/drivers/xen/usbback/common.h
@@ -12,7 +12,7 @@
#include <asm/io.h>
#include <asm/setup.h>
#include <asm/pgalloc.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm-xen/xen-public/io/usbif.h>
diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c
index 3626d1086e..1543959df7 100644
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c
@@ -27,7 +27,7 @@
* IN THE SOFTWARE.
*/
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm-xen/evtchn.h>
#include <linux/wait.h>
#include <linux/interrupt.h>
diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
index 47e4fba82f..f18900360b 100644
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
@@ -27,7 +27,7 @@
*/
#define DEBUG
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm-xen/xenbus.h>
#include <asm-xen/balloon.h>
#include <linux/kernel.h>
diff --git a/linux-2.6-xen-sparse/include/asm-xen/hypervisor.h b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypervisor.h
index 3c7a42723a..9d766f8c39 100644
--- a/linux-2.6-xen-sparse/include/asm-xen/hypervisor.h
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypervisor.h
@@ -36,7 +36,6 @@
#include <linux/version.h>
#include <asm-xen/xen-public/xen.h>
#include <asm-xen/xen-public/dom0_ops.h>
-#include <asm-xen/xen-public/io/domain_controller.h>
#include <asm/ptrace.h>
#include <asm/page.h>
#if defined(__i386__)
diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/mmu_context.h b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/mmu_context.h
index 914b9d2ae3..c5567bc9b3 100644
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/mmu_context.h
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/mmu_context.h
@@ -67,7 +67,7 @@ static inline void switch_mm(struct mm_struct *prev,
/* Re-load page tables: load_cr3(next->pgd) */
per_cpu(cur_pgd, cpu) = next->pgd;
op->cmd = MMUEXT_NEW_BASEPTR;
- op->mfn = pfn_to_mfn(__pa(next->pgd) >> PAGE_SHIFT);
+ op->arg1.mfn = pfn_to_mfn(__pa(next->pgd) >> PAGE_SHIFT);
op++;
/*
@@ -76,8 +76,8 @@ static inline void switch_mm(struct mm_struct *prev,
if (unlikely(prev->context.ldt != next->context.ldt)) {
/* load_LDT_nolock(&next->context, cpu) */
op->cmd = MMUEXT_SET_LDT;
- op->linear_addr = (unsigned long)next->context.ldt;
- op->nr_ents = next->context.size;
+ op->arg1.linear_addr = (unsigned long)next->context.ldt;
+ op->arg2.nr_ents = next->context.size;
op++;
}
diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h
index 4779997177..1db7c0382e 100644
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h
@@ -2,7 +2,7 @@
#define _I386_PGTABLE_H
#include <linux/config.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
/*
* The Linux memory management assumes a three-level page table setup. On
diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h
index 6c991e8058..a627fbf4fc 100644
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h
@@ -7,7 +7,7 @@
#include <asm/synch_bitops.h>
#include <asm/segment.h>
#include <asm/cpufeature.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm/smp_alt.h>
#ifdef __KERNEL__
diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypervisor.h b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypervisor.h
new file mode 100644
index 0000000000..dc3e5e5d3b
--- /dev/null
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypervisor.h
@@ -0,0 +1,2 @@
+
+#include <asm-i386/hypervisor.h>
diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mmu_context.h b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mmu_context.h
index 43512ae075..9558ddc045 100644
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mmu_context.h
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mmu_context.h
@@ -83,19 +83,19 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
/* load_cr3(next->pgd) */
per_cpu(cur_pgd, smp_processor_id()) = next->pgd;
op->cmd = MMUEXT_NEW_BASEPTR;
- op->mfn = pfn_to_mfn(__pa(next->pgd) >> PAGE_SHIFT);
+ op->arg1.mfn = pfn_to_mfn(__pa(next->pgd) >> PAGE_SHIFT);
op++;
/* xen_new_user_pt(__pa(__user_pgd(next->pgd))) */
op->cmd = MMUEXT_NEW_USER_BASEPTR;
- op->mfn = pfn_to_mfn(__pa(__user_pgd(next->pgd)) >> PAGE_SHIFT);
+ op->arg1.mfn = pfn_to_mfn(__pa(__user_pgd(next->pgd)) >> PAGE_SHIFT);
op++;
if (unlikely(next->context.ldt != prev->context.ldt)) {
/* load_LDT_nolock(&next->context, cpu) */
op->cmd = MMUEXT_SET_LDT;
- op->linear_addr = (unsigned long)next->context.ldt;
- op->nr_ents = next->context.size;
+ op->arg1.linear_addr = (unsigned long)next->context.ldt;
+ op->arg2.nr_ents = next->context.size;
op++;
}
diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h
index 86f1b4f7fa..d24c5c5299 100644
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h
@@ -12,7 +12,7 @@
#include <linux/sched.h>
#include <asm/pda.h>
#ifdef CONFIG_XEN
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
extern pud_t level3_user_pgt[512];
extern pud_t init_level4_user_pgt[];
diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h
index 518dcdf5a3..d06d1485eb 100644
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h
@@ -5,7 +5,7 @@
#include <linux/kernel.h>
#include <asm/segment.h>
#include <asm/synch_bitops.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm-xen/xen-public/arch-x86_64.h>
#ifdef __KERNEL__
diff --git a/linux-2.6-xen-sparse/include/asm-xen/evtchn.h b/linux-2.6-xen-sparse/include/asm-xen/evtchn.h
index ff522a927e..db40acaed9 100644
--- a/linux-2.6-xen-sparse/include/asm-xen/evtchn.h
+++ b/linux-2.6-xen-sparse/include/asm-xen/evtchn.h
@@ -33,7 +33,7 @@
#include <linux/config.h>
#include <linux/interrupt.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm/ptrace.h>
#include <asm/synch_bitops.h>
#include <asm-xen/xen-public/event_channel.h>
diff --git a/linux-2.6-xen-sparse/include/asm-xen/gnttab.h b/linux-2.6-xen-sparse/include/asm-xen/gnttab.h
index aef955d2d4..ce3d44a821 100644
--- a/linux-2.6-xen-sparse/include/asm-xen/gnttab.h
+++ b/linux-2.6-xen-sparse/include/asm-xen/gnttab.h
@@ -14,7 +14,7 @@
#define __ASM_GNTTAB_H__
#include <linux/config.h>
-#include <asm-xen/hypervisor.h>
+#include <asm/hypervisor.h>
#include <asm-xen/xen-public/grant_table.h>
/* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */
diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index 2fead094b0..5157a9a60a 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -22,10 +22,8 @@
#include "utils.h"
#include "io.h"
-
#include "xenctrl.h"
#include "xs.h"
-#include "xen/io/domain_controller.h"
#include <malloc.h>
#include <stdlib.h>
diff --git a/tools/console/daemon/utils.c b/tools/console/daemon/utils.c
index 3372632737..372f19e3e5 100644
--- a/tools/console/daemon/utils.c
+++ b/tools/console/daemon/utils.c
@@ -34,8 +34,6 @@
#include <string.h>
#include "xenctrl.h"
-#include "xen/io/domain_controller.h"
-
#include "utils.h"
struct xs_handle *xs;
diff --git a/tools/examples/Makefile b/tools/examples/Makefile
index 5bfa67fd9f..0a086c572c 100644
--- a/tools/examples/Makefile
+++ b/tools/examples/Makefile
@@ -25,21 +25,20 @@ XEN_SCRIPTS += block-phy
XEN_SCRIPTS += block-file
XEN_SCRIPTS += block-enbd
-XEN_BOOT_DIR = /usr/$(LIBDIR)/xen/boot
+# no 64-bit specifics in mem-map.sxp
+# so place in /usr/lib, not /usr/lib64
+XEN_BOOT_DIR = /usr/lib/xen/boot
XEN_BOOT = mem-map.sxp
XEN_HOTPLUG_DIR = /etc/hotplug
XEN_HOTPLUG_SCRIPTS = xen-backend.agent
-all:
+all:
build:
install: all install-initd install-configs install-scripts install-boot \
install-hotplug
-xmexample.vmx: xmexample.vmx.in
- sed -e 's/@@LIBDIR@@/$(LIBDIR)/' < $< > $@
-
install-initd:
[ -d $(DESTDIR)/etc/init.d ] || $(INSTALL_DIR) $(DESTDIR)/etc/init.d
$(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)/etc/init.d
@@ -80,4 +79,3 @@ install-hotplug:
done
clean:
- $(RM) xmexample.vmx
diff --git a/tools/examples/network-bridge b/tools/examples/network-bridge
index 24b3ae3a12..342a2def9d 100755
--- a/tools/examples/network-bridge
+++ b/tools/examples/network-bridge
@@ -222,27 +222,31 @@ op_stop () {
return
fi
- brctl delif ${bridge} ${netdev}
+ if ifconfig peth0 2>/dev/null | grep -q peth0 ; then
- if ifconfig veth0 2>/dev/null | grep -q veth0 ; then
- brctl delif ${bridge} vif0.0
ifconfig vif0.0 down
- mac=`ifconfig veth0 | grep HWadd | sed -e 's/.*\(..:..:..:..:..:..\).*/\1/'`
- ifconfig ${netdev} down
- ifconfig ${netdev} hw ether ${mac}
- ifconfig ${netdev} arp up
- transfer_addrs veth0 ${netdev}
- transfer_routes veth0 ${netdev}
- del_addrs veth0
- ifconfig veth0 -arp down
- ifconfig veth0 hw ether 00:00:00:00:00:00
+ mac=`ifconfig eth0 | grep HWadd | \
+ sed -e 's/.*\(..:..:..:..:..:..\).*/\1/'`
+ ifconfig ${netdev} 0.0.0.0 down
+ ifconfig ${netdev} hw ether fe:ff:ff:ff:ff:ff
+
+ ifconfig p${netdev} down
+ ifconfig p${netdev} hw ether ${mac} arp
+ brctl delif ${bridge} p${netdev}
+
+ ip link set eth0 name veth0
+ ip link set peth0 name eth0
+ ifconfig ${bridge} down
+ brctl delbr ${bridge}
+ ifup eth0
+
else
transfer_routes ${bridge} ${netdev}
fi
}
case ${OP} in
- start)
+ start)
op_start
;;
diff --git a/tools/examples/xen-backend.agent b/tools/examples/xen-backend.agent
index 91a5d0eb32..6aefea1399 100755
--- a/tools/examples/xen-backend.agent
+++ b/tools/examples/xen-backend.agent
@@ -1,3 +1,7 @@
+
+copyrev: 0000000000000000000000000000000000000000
+copy: tools/examples/backend.hotplug
+
#! /bin/sh
#ACTION=add
diff --git a/tools/examples/xmexample.vmx.in b/tools/examples/xmexample.vmx
index c45a237033..28f34462fd 100644
--- a/tools/examples/xmexample.vmx.in
+++ b/tools/examples/xmexample.vmx
@@ -6,9 +6,16 @@
# you can set the parameters for the domain on the xm command line.
#============================================================================
+import os, re
+arch = os.uname()[4]
+if re.search('64', arch):
+ arch_libdir = 'lib64'
+else:
+ arch_libdir = 'lib'
+
#----------------------------------------------------------------------------
# Kernel image file.
-kernel = "/usr/@@LIBDIR@@/xen/boot/vmxloader"
+kernel = "/usr/lib/xen/boot/vmxloader"
# The domain build function. VMX domain uses 'vmx'.
builder='vmx'
@@ -46,12 +53,11 @@ disk = [ 'file:/var/images/min-el3-i386.img,ioemu:hda,w' ]
#============================================================================
-
# New stuff
-device_model = '/usr/@@LIBDIR@@/xen/bin/qemu-dm'
+device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
# Advanced users only. Don't touch if you don't know what you're doing
-memmap = '/usr/@@LIBDIR@@/xen/boot/mem-map.sxp'
+memmap = '/usr/lib/xen/boot/mem-map.sxp'
#-----------------------------------------------------------------------------
# Disk image for
diff --git a/tools/firmware/Makefile b/tools/firmware/Makefile
index e972544eea..86918f5443 100644
--- a/tools/firmware/Makefile
+++ b/tools/firmware/Makefile
@@ -1,6 +1,8 @@
XEN_ROOT = ../..
include $(XEN_ROOT)/tools/Rules.mk
+# vmxloader is a 32-bit protected mode binary.
+# It belongs in /usr/lib, not /usr/lib64.
TARGET := vmxassist/vmxloader
INSTALL_DIR := $(DESTDIR)/usr/lib/xen/boot
diff --git a/tools/ioemu/hw/i8259.c b/tools/ioemu/hw/i8259.c
index a84e94d44a..06c39fb07c 100644
--- a/tools/ioemu/hw/i8259.c
+++ b/tools/ioemu/hw/i8259.c
@@ -128,21 +128,23 @@ static int pic_get_irq(PicState *s)
/* pic[1] is connected to pin2 of pic[0] */
#define CASCADE_IRQ 2
-static void shared_page_update()
+extern shared_iopage_t *shared_page;
+
+static void xen_update_shared_imr(void)
{
- extern shared_iopage_t *shared_page;
- uint8_t * pmask = (uint8_t *)&(shared_page->sp_global.pic_mask[0]);
- int index;
+ uint8_t *pmask = (uint8_t *)shared_page->sp_global.pic_mask;
+ int index;
index = pics[0].irq_base/8;
pmask[index] = pics[0].imr;
+
index = pics[1].irq_base/8;
+ pmask[index] = (pics[0].imr & (1 << CASCADE_IRQ)) ? 0xff : pics[1].imr;
+}
- if ( pics[0].imr & (1 << CASCADE_IRQ) ) {
- pmask[index] = 0xff;
- } else {
- pmask[index] = pics[1].imr;
- }
+static void xen_clear_shared_irr(void)
+{
+ memset(shared_page->sp_global.pic_intr, 0, INTR_LEN);
}
/* raise irq to CPU if necessary. must be called every time the active
@@ -174,7 +176,8 @@ static void pic_update_irq(void)
#endif
cpu_interrupt(cpu_single_env, CPU_INTERRUPT_HARD);
}
- shared_page_update();
+
+ xen_update_shared_imr();
}
#ifdef DEBUG_IRQ_LATENCY
@@ -283,7 +286,9 @@ static void pic_reset(void *opaque)
tmp = s->elcr_mask;
memset(s, 0, sizeof(PicState));
s->elcr_mask = tmp;
- shared_page_update();
+
+ xen_update_shared_imr();
+ xen_clear_shared_irr();
}
static void pic_ioport_write(void *opaque, uint32_t addr, uint32_t val)
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 7181518380..429641b5db 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -134,7 +134,7 @@ int xc_domain_getinfolist(int xc_handle,
int ret = 0;
dom0_op_t op;
- if(mlock(info, max_domains*sizeof(xc_domaininfo_t)) != 0)
+ if ( mlock(info, max_domains*sizeof(xc_domaininfo_t)) != 0 )
return -1;
op.cmd = DOM0_GETDOMAININFOLIST;
@@ -142,12 +142,12 @@ int xc_domain_getinfolist(int xc_handle,
op.u.getdomaininfolist.max_domains = max_domains;
op.u.getdomaininfolist.buffer = info;
- if(xc_dom0_op(xc_handle, &op) < 0)
+ if ( xc_dom0_op(xc_handle, &op) < 0 )
ret = -1;
else
ret = op.u.getdomaininfolist.num_domains;
- if(munlock(info, max_domains*sizeof(xc_domaininfo_t)) != 0)
+ if ( munlock(info, max_domains*sizeof(xc_domaininfo_t)) != 0 )
ret = -1;
return ret;
@@ -277,15 +277,18 @@ int xc_domain_memory_increase_reservation(int xc_handle,
};
err = xc_memory_op(xc_handle, XENMEM_increase_reservation, &reservation);
- if (err == nr_extents)
+ if ( err == nr_extents )
return 0;
- if (err > 0) {
- fprintf(stderr,"Failed alocation for dom %d : %ld pages order %d addr_bits %d\n",
- domid, nr_extents, extent_order, address_bits);
+ if ( err > 0 )
+ {
+ fprintf(stderr, "Failed allocation for dom %d: "
+ "%ld pages order %d addr_bits %d\n",
+ domid, nr_extents, extent_order, address_bits);
errno = ENOMEM;
err = -1;
}
+
return err;
}
@@ -304,24 +307,24 @@ int xc_domain_memory_decrease_reservation(int xc_handle,
.domid = domid
};
- if (extent_start == NULL)
+ if ( extent_start == NULL )
{
fprintf(stderr,"decrease_reservation extent_start is NULL!\n");
errno = EINVAL;
- err = -1;
- goto out;
+ return -1;
}
- err = xc_memory_op(xc_handle, XENMEM_increase_reservation, &reservation);
- if (err == nr_extents)
+ err = xc_memory_op(xc_handle, XENMEM_decrease_reservation, &reservation);
+ if ( err == nr_extents )
return 0;
- if (err > 0) {
- fprintf(stderr,"Failed de-alocation for dom %d : %ld pages order %d\n",
- domid, nr_extents, extent_order);
+ if ( err > 0 )
+ {
+ fprintf(stderr,"Failed deallocation for dom %d: %ld pages order %d\n",
+ domid, nr_extents, extent_order);
errno = EBUSY;
err = -1;
}
-out:
+
return err;
}
diff --git a/tools/libxc/xc_linux_restore.c b/tools/libxc/xc_linux_restore.c
index 90fb89ca38..7d4e43eba3 100644
--- a/tools/libxc/xc_linux_restore.c
+++ b/tools/libxc/xc_linux_restore.c
@@ -421,7 +421,7 @@ int xc_linux_restore(int xc_handle, int io_fd, u32 dom, unsigned long nr_pfns,
pin[nr_pins].cmd = MMUEXT_PIN_L1_TABLE;
else /* pfn_type[i] == (L2TAB|LPINTAB) */
pin[nr_pins].cmd = MMUEXT_PIN_L2_TABLE;
- pin[nr_pins].mfn = pfn_to_mfn_table[i];
+ pin[nr_pins].arg1.mfn = pfn_to_mfn_table[i];
if ( ++nr_pins == MAX_PIN_BATCH )
{
if ( xc_mmuext_op(xc_handle, pin, nr_pins, dom) < 0 )
diff --git a/tools/libxc/xc_linux_save.c b/tools/libxc/xc_linux_save.c
index af32db7791..a2ff16fed1 100644
--- a/tools/libxc/xc_linux_save.c
+++ b/tools/libxc/xc_linux_save.c
@@ -14,8 +14,6 @@
#include "xg_private.h"
-#include <xen/io/domain_controller.h>
-
#define BATCH_SIZE 1024 /* 1024 pages (4MB) at a time */
#define MAX_MBIT_RATE 500
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index f0852fdefc..9cfa18bceb 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -465,14 +465,14 @@ unsigned long xc_make_page_below_4G(
unsigned long new_mfn;
if ( xc_domain_memory_decrease_reservation(
- xc_handle, domid, 1, 0, &mfn) != 1 )
+ xc_handle, domid, 1, 0, &mfn) != 0 )
{
fprintf(stderr,"xc_make_page_below_4G decrease failed. mfn=%lx\n",mfn);
return 0;
}
if ( xc_domain_memory_increase_reservation(
- xc_handle, domid, 1, 0, 32, &new_mfn) != 1 )
+ xc_handle, domid, 1, 0, 32, &new_mfn) != 0 )
{
fprintf(stderr,"xc_make_page_below_4G increase failed. mfn=%lx\n",mfn);
return 0;
diff --git a/tools/libxc/xc_vmx_build.c b/tools/libxc/xc_vmx_build.c
index a2b21b735a..2efdf289a3 100644
--- a/tools/libxc/xc_vmx_build.c
+++ b/tools/libxc/xc_vmx_build.c
@@ -169,21 +169,35 @@ static int zap_mmio_range(int xc_handle, u32 dom,
l2_pgentry_t *vl2tab;
mmio_addr = mmio_range_start & PAGE_MASK;
- for (; mmio_addr < mmio_range_end; mmio_addr += PAGE_SIZE) {
+ for ( ; mmio_addr < mmio_range_end; mmio_addr += PAGE_SIZE )
+ {
vl3e = vl3tab[l3_table_offset(mmio_addr)];
- if (vl3e == 0)
+ if ( vl3e == 0 )
continue;
- vl2tab = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE,
- PROT_READ|PROT_WRITE, vl3e >> PAGE_SHIFT);
- if (vl2tab == 0) {
+
+ vl2tab = xc_map_foreign_range(
+ xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE, vl3e>>PAGE_SHIFT);
+ if ( vl2tab == NULL )
+ {
PERROR("Failed zap MMIO range");
return -1;
}
+
vl2e = vl2tab[l2_table_offset(mmio_addr)];
- if (vl2e == 0)
+ if ( vl2e == 0 )
+ {
+ munmap(vl2tab, PAGE_SIZE);
continue;
- vl1tab = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE,
- PROT_READ|PROT_WRITE, vl2e >> PAGE_SHIFT);
+ }
+
+ vl1tab = xc_map_foreign_range(
+ xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE, vl2e>>PAGE_SHIFT);
+ if ( vl1tab == NULL )
+ {
+ PERROR("Failed zap MMIO range");
+ munmap(vl2tab, PAGE_SIZE);
+ return -1;
+ }
vl1tab[l1_table_offset(mmio_addr)] = 0;
munmap(vl2tab, PAGE_SIZE);
diff --git a/tools/libxc/xg_private.c b/tools/libxc/xg_private.c
index 9b04ad8f6a..355ba1400d 100644
--- a/tools/libxc/xg_private.c
+++ b/tools/libxc/xg_private.c
@@ -65,7 +65,7 @@ int pin_table(
struct mmuext_op op;
op.cmd = type;
- op.mfn = mfn;
+ op.arg1.mfn = mfn;
if ( xc_mmuext_op(xc_handle, &op, 1, dom) < 0 )
return 1;
diff --git a/tools/python/xen/lowlevel/xs/xs.c b/tools/python/xen/lowlevel/xs/xs.c
index deb2365ec6..cc3459e0b8 100644
--- a/tools/python/xen/lowlevel/xs/xs.c
+++ b/tools/python/xen/lowlevel/xs/xs.c
@@ -74,6 +74,7 @@ static inline PyObject *pyvalue_str(char *val) {
" path [string]: xenstore path\n" \
"\n" \
"Returns: [string] data read.\n" \
+ " None if key doesn't exist.\n" \
"Raises RuntimeError on error.\n" \
"\n"
@@ -97,7 +98,11 @@ static PyObject *xspy_read(PyObject *self, PyObject *args, PyObject *kwds)
xsval = xs_read(xh, path, &xsval_n);
Py_END_ALLOW_THREADS
if (!xsval) {
- PyErr_SetFromErrno(PyExc_RuntimeError);
+ if (errno == ENOENT) {
+ Py_INCREF(Py_None);
+ val = Py_None;
+ } else
+ PyErr_SetFromErrno(PyExc_RuntimeError);
goto exit;
}
val = PyString_FromStringAndSize(xsval, xsval_n);
@@ -160,6 +165,7 @@ static PyObject *xspy_write(PyObject *self, PyObject *args, PyObject *kwds)
" path [string]: path to list.\n" \
"\n" \
"Returns: [string array] list of subdirectory names.\n" \
+ " None if key doesn't exist.\n" \
"Raises RuntimeError on error.\n" \
"\n"
@@ -183,12 +189,17 @@ static PyObject *xspy_ls(PyObject *self, PyObject *args, PyObject *kwds)
xsval = xs_directory(xh, path, &xsval_n);
Py_END_ALLOW_THREADS
if (!xsval) {
- PyErr_SetFromErrno(PyExc_RuntimeError);
- goto exit;
+ if (errno == ENOENT) {
+ Py_INCREF(Py_None);
+ val = Py_None;
+ } else
+ PyErr_SetFromErrno(PyExc_RuntimeError);
+ goto exit;
}
val = PyList_New(xsval_n);
for (i = 0; i < xsval_n; i++)
PyList_SetItem(val, i, PyString_FromString(xsval[i]));
+ free(xsval);
exit:
return val;
}
@@ -253,7 +264,7 @@ static PyObject *xspy_rm(PyObject *self, PyObject *args, PyObject *kwds)
Py_BEGIN_ALLOW_THREADS
xsval = xs_rm(xh, path);
Py_END_ALLOW_THREADS
- if (!xsval) {
+ if (!xsval && errno != ENOENT) {
PyErr_SetFromErrno(PyExc_RuntimeError);
goto exit;
}
diff --git a/tools/python/xen/xend/XendCheckpoint.py b/tools/python/xen/xend/XendCheckpoint.py
index 345f83979d..4a890c7bba 100644
--- a/tools/python/xen/xend/XendCheckpoint.py
+++ b/tools/python/xen/xend/XendCheckpoint.py
@@ -13,6 +13,7 @@ from string import join
from struct import pack, unpack, calcsize
from xen.util.xpopen import xPopen3
import xen.lowlevel.xc; xc = xen.lowlevel.xc.new()
+from xen.xend.xenstore.xsutil import IntroduceDomain
from XendError import XendError
from XendLogging import log
@@ -48,7 +49,7 @@ def save(xd, fd, dominfo, live):
# simply uses the defaults compiled into libxenguest; see the comments
# and/or code in xc_linux_save() for more information.
cmd = [PATH_XC_SAVE, str(xc.handle()), str(fd),
- str(dominfo.id), "0", "0", str(int(live)) ]
+ str(dominfo.domid), "0", "0", str(int(live)) ]
log.info("[xc_save] " + join(cmd))
child = xPopen3(cmd, True, -1, [fd, xc.handle()])
@@ -68,18 +69,10 @@ def save(xd, fd, dominfo, live):
if fd == child.fromchild.fileno():
l = child.fromchild.readline()
if l.rstrip() == "suspend":
- log.info("suspending %d" % dominfo.id)
- xd.domain_shutdown(dominfo.id, reason='suspend')
+ log.info("suspending %d" % dominfo.domid)
+ xd.domain_shutdown(dominfo.domid, reason='suspend')
dominfo.state_wait("suspended")
- log.info("suspend %d done" % dominfo.id)
- if dominfo.store_channel:
- try:
- dominfo.db.releaseDomain(dominfo.id)
- except Exception, ex:
- log.warning(
- "error in domain release on xenstore: %s",
- ex)
- pass
+ log.info("suspend %d done" % dominfo.domid)
child.tochild.write("done\n")
child.tochild.flush()
if filter(lambda (fd, event): event & select.POLLHUP, r):
@@ -90,12 +83,8 @@ def save(xd, fd, dominfo, live):
if child.wait() != 0:
raise XendError("xc_save failed: %s" % lasterr)
- if dominfo.store_channel:
- dominfo.store_channel.close()
- dominfo.db['store_channel'].delete()
- dominfo.db.saveDB(save=True)
- dominfo.store_channel = None
- xd.domain_destroy(dominfo.id)
+ dominfo.setStoreChannel(None)
+ xd.domain_destroy(dominfo.domid)
return None
def restore(xd, fd):
@@ -137,7 +126,7 @@ def restore(xd, fd):
console_evtchn = 0
cmd = [PATH_XC_RESTORE, str(xc.handle()), str(fd),
- str(dominfo.id), str(nr_pfns),
+ str(dominfo.domid), str(nr_pfns),
str(store_evtchn), str(console_evtchn)]
log.info("[xc_restore] " + join(cmd))
child = xPopen3(cmd, True, -1, [fd, xc.handle()])
@@ -163,16 +152,15 @@ def restore(xd, fd):
m = re.match(r"^(store-mfn) (\d+)\n$", l)
if m:
if dominfo.store_channel:
- dominfo.store_mfn = int(m.group(2))
+ dominfo.setStoreRef(int(m.group(2)))
if dominfo.store_mfn >= 0:
- dominfo.db.introduceDomain(dominfo.id,
- dominfo.store_mfn,
- dominfo.store_channel)
- dominfo.exportToDB(save=True, sync=True)
+ IntroduceDomain(dominfo.domid,
+ dominfo.store_mfn,
+ dominfo.store_channel.port1,
+ dominfo.path)
m = re.match(r"^(console-mfn) (\d+)\n$", l)
if m:
- dominfo.console_mfn = int(m.group(2))
- dominfo.exportToDB(save=True, sync=True)
+ dominfo.setConsoleRef(int(m.group(2)))
try:
l = child.fromchild.readline()
except:
diff --git a/tools/python/xen/xend/XendDomain.py b/tools/python/xen/xend/XendDomain.py
index 114714e892..010f9df080 100644
--- a/tools/python/xen/xend/XendDomain.py
+++ b/tools/python/xen/xend/XendDomain.py
@@ -130,8 +130,11 @@ class XendDomain:
doms = self.xen_domains()
self.dbmap.readDB()
for domdb in self.dbmap.values():
+ if not domdb.has_key("xend"):
+ continue
+ db = domdb.addChild("xend")
try:
- domid = int(domdb.id)
+ domid = int(domdb["domid"].getData())
except:
domid = None
# XXX if domid in self.domains, then something went wrong
@@ -139,7 +142,8 @@ class XendDomain:
domdb.delete()
elif domid in doms:
try:
- self._new_domain(domdb, doms[domid])
+ self._new_domain(domdb["uuid"].getData(), domid, db,
+ doms[domid])
except Exception, ex:
log.exception("Error recreating domain info: id=%d", domid)
self._delete_domain(domid)
@@ -155,15 +159,15 @@ class XendDomain:
def close(self):
pass
- def _new_domain(self, db, info):
+ def _new_domain(self, uuid, domid, db, info):
"""Create a domain entry from saved info.
@param db: saved info from the db
@param info: domain info from xen
@return: domain
"""
- dominfo = XendDomainInfo.recreate(db, info)
- self.domains[dominfo.id] = dominfo
+ dominfo = XendDomainInfo.recreate(uuid, domid, db, info)
+ self.domains[dominfo.domid] = dominfo
return dominfo
def _add_domain(self, info, notify=True):
@@ -174,15 +178,15 @@ class XendDomain:
"""
# Remove entries under the wrong id.
for i, d in self.domains.items():
- if i != d.id:
+ if i != d.domid:
del self.domains[i]
self.dbmap.delete(d.uuid)
- if info.id in self.domains:
+ if info.domid in self.domains:
notify = False
- self.domains[info.id] = info
+ self.domains[info.domid] = info
info.exportToDB(save=True)
if notify:
- eserver.inject('xend.domain.create', [info.name, info.id])
+ eserver.inject('xend.domain.create', [info.name, info.domid])
def _delete_domain(self, id, notify=True):
"""Remove a domain from the tables.
@@ -201,11 +205,14 @@ class XendDomain:
info.cleanup()
info.delete()
if notify:
- eserver.inject('xend.domain.died', [info.name, info.id])
+ eserver.inject('xend.domain.died', [info.name, info.domid])
# XXX this should not be needed
for domdb in self.dbmap.values():
+ if not domdb.has_key("xend"):
+ continue
+ db = domdb.addChild("xend")
try:
- domid = int(domdb.id)
+ domid = int(domdb["domid"].getData())
except:
domid = None
if (domid is None) or (domid == id):
@@ -261,13 +268,13 @@ class XendDomain:
# Update entries for existing domains.
do_domain_restarts = False
for d in self.domains.values():
- info = doms.get(d.id)
+ info = doms.get(d.domid)
if info:
d.update(info)
elif d.restart_pending():
do_domain_restarts = True
else:
- self._delete_domain(d.id)
+ self._delete_domain(d.domid)
if cleanup and do_domain_restarts:
scheduler.now(self.domain_restarts)
@@ -298,20 +305,20 @@ class XendDomain:
@param dominfo: domain object
"""
- log.info("Restarting domain: name=%s id=%s", dominfo.name, dominfo.id)
+ log.info("Restarting domain: name=%s id=%s", dominfo.name, dominfo.domid)
eserver.inject("xend.domain.restart",
- [dominfo.name, dominfo.id, "begin"])
+ [dominfo.name, dominfo.domid, "begin"])
try:
dominfo.restart()
- log.info('Restarted domain name=%s id=%s', dominfo.name, dominfo.id)
+ log.info('Restarted domain name=%s id=%s', dominfo.name, dominfo.domid)
eserver.inject("xend.domain.restart",
- [dominfo.name, dominfo.id, "success"])
- self.domain_unpause(dominfo.id)
+ [dominfo.name, dominfo.domid, "success"])
+ self.domain_unpause(dominfo.domid)
except Exception, ex:
log.exception("Exception restarting domain: name=%s id=%s",
- dominfo.name, dominfo.id)
+ dominfo.name, dominfo.domid)
eserver.inject("xend.domain.restart",
- [dominfo.name, dominfo.id, "fail"])
+ [dominfo.name, dominfo.domid, "fail"])
return dominfo
def domain_configure(self, vmconfig):
@@ -355,12 +362,12 @@ class XendDomain:
log.info(
"Creating entry for unknown domain: id=%d uuid=%s",
id, uuid)
- db = self.dbmap.addChild(uuid)
- dominfo = XendDomainInfo.recreate(db, info)
- dominfo.setdom(id)
+ db = self.dbmap.addChild("%s/xend" % uuid)
+ dominfo = XendDomainInfo.recreate(uuid, id, db, info)
self._add_domain(dominfo)
return dominfo
except Exception, ex:
+ raise
log.exception("Error creating domain info: id=%d", id)
return None
@@ -383,9 +390,9 @@ class XendDomain:
@param id: domain id
"""
dominfo = self.domain_lookup(id)
- eserver.inject('xend.domain.unpause', [dominfo.name, dominfo.id])
+ eserver.inject('xend.domain.unpause', [dominfo.name, dominfo.domid])
try:
- return xc.domain_unpause(dom=dominfo.id)
+ return xc.domain_unpause(dom=dominfo.domid)
except Exception, ex:
raise XendError(str(ex))
@@ -395,9 +402,9 @@ class XendDomain:
@param id: domain id
"""
dominfo = self.domain_lookup(id)
- eserver.inject('xend.domain.pause', [dominfo.name, dominfo.id])
+ eserver.inject('xend.domain.pause', [dominfo.name, dominfo.domid])
try:
- return xc.domain_pause(dom=dominfo.id)
+ return xc.domain_pause(dom=dominfo.domid)
except Exception, ex:
raise XendError(str(ex))
@@ -413,8 +420,8 @@ class XendDomain:
@param reason: shutdown type: poweroff, reboot, suspend, halt
"""
dominfo = self.domain_lookup(id)
- self.domain_restart_schedule(dominfo.id, reason, force=True)
- eserver.inject('xend.domain.shutdown', [dominfo.name, dominfo.id, reason])
+ self.domain_restart_schedule(dominfo.domid, reason, force=True)
+ eserver.inject('xend.domain.shutdown', [dominfo.name, dominfo.domid, reason])
if reason == 'halt':
reason = 'poweroff'
val = dominfo.shutdown(reason)
@@ -438,7 +445,7 @@ class XendDomain:
if not dominfo.shutdown_pending:
# domain doesn't need shutdown
continue
- id = dominfo.id
+ id = dominfo.domid
left = dominfo.shutdown_time_left(SHUTDOWN_TIMEOUT)
if left <= 0:
# Shutdown expired - destroy domain.
@@ -469,15 +476,15 @@ class XendDomain:
restart = (force and reason == 'reboot') or dominfo.restart_needed(reason)
if restart:
log.info('Scheduling restart for domain: name=%s id=%s',
- dominfo.name, dominfo.id)
+ dominfo.name, dominfo.domid)
eserver.inject("xend.domain.restart",
- [dominfo.name, dominfo.id, "schedule"])
+ [dominfo.name, dominfo.domid, "schedule"])
dominfo.restarting()
else:
log.info('Cancelling restart for domain: name=%s id=%s',
- dominfo.name, dominfo.id)
+ dominfo.name, dominfo.domid)
eserver.inject("xend.domain.restart",
- [dominfo.name, dominfo.id, "cancel"])
+ [dominfo.name, dominfo.domid, "cancel"])
dominfo.restart_cancel()
def domain_restarts(self):
@@ -487,8 +494,8 @@ class XendDomain:
for dominfo in self.domains.values():
if not dominfo.restart_pending():
continue
- print 'domain_restarts>', dominfo.name, dominfo.id
- info = doms.get(dominfo.id)
+ print 'domain_restarts>', dominfo.name, dominfo.domid
+ info = doms.get(dominfo.domid)
if info:
# Don't execute restart for domains still running.
print 'domain_restarts> still runnning: ', dominfo.name
@@ -505,7 +512,7 @@ class XendDomain:
try:
dominfo = self.domain_lookup(id)
log.info('Destroying domain: name=%s', dominfo.name)
- eserver.inject('xend.domain.destroy', [dominfo.name, dominfo.id])
+ eserver.inject('xend.domain.destroy', [dominfo.name, dominfo.domid])
val = dominfo.destroy()
except:
#todo
@@ -580,7 +587,7 @@ class XendDomain:
"""
dominfo = self.domain_lookup(id)
try:
- return xc.domain_pincpu(dominfo.id, vcpu, cpumap)
+ return xc.domain_pincpu(dominfo.domid, vcpu, cpumap)
except Exception, ex:
raise XendError(str(ex))
@@ -589,7 +596,7 @@ class XendDomain:
"""
dominfo = self.domain_lookup(id)
try:
- return xc.bvtsched_domain_set(dom=dominfo.id, mcuadv=mcuadv,
+ return xc.bvtsched_domain_set(dom=dominfo.domid, mcuadv=mcuadv,
warpback=warpback, warpvalue=warpvalue,
warpl=warpl, warpu=warpu)
except Exception, ex:
@@ -600,7 +607,7 @@ class XendDomain:
"""
dominfo = self.domain_lookup(id)
try:
- return xc.bvtsched_domain_get(dominfo.id)
+ return xc.bvtsched_domain_get(dominfo.domid)
except Exception, ex:
raise XendError(str(ex))
@@ -610,7 +617,7 @@ class XendDomain:
"""
dominfo = self.domain_lookup(id)
try:
- return xc.sedf_domain_set(dominfo.id, period, slice, latency, extratime, weight)
+ return xc.sedf_domain_set(dominfo.domid, period, slice, latency, extratime, weight)
except Exception, ex:
raise XendError(str(ex))
@@ -619,7 +626,7 @@ class XendDomain:
"""
dominfo = self.domain_lookup(id)
try:
- return xc.sedf_domain_get(dominfo.id)
+ return xc.sedf_domain_get(dominfo.domid)
except Exception, ex:
raise XendError(str(ex))
@@ -667,7 +674,7 @@ class XendDomain:
@param type: device type
"""
dominfo = self.domain_lookup(id)
- val = dominfo.device_destroy(type, devid)
+ val = dominfo.device_delete(type, devid)
dominfo.exportToDB()
return val
@@ -709,7 +716,7 @@ class XendDomain:
"""
dominfo = self.domain_lookup(id)
try:
- return xc.shadow_control(dominfo.id, op)
+ return xc.shadow_control(dominfo.domid, op)
except Exception, ex:
raise XendError(str(ex))
@@ -723,7 +730,7 @@ class XendDomain:
dominfo = self.domain_lookup(id)
maxmem = int(mem) * 1024
try:
- return xc.domain_setmaxmem(dominfo.id, maxmem_kb = maxmem)
+ return xc.domain_setmaxmem(dominfo.domid, maxmem_kb = maxmem)
except Exception, ex:
raise XendError(str(ex))
@@ -735,7 +742,7 @@ class XendDomain:
@return: 0 on success, -1 on error
"""
dominfo = self.domain_lookup(id)
- return dominfo.mem_target_set(mem)
+ return dominfo.setMemoryTarget(mem * (1 << 20))
def domain_vcpu_hotplug(self, id, vcpu, state):
"""Enable or disable VCPU vcpu in DOM id
@@ -755,12 +762,12 @@ class XendDomain:
@param id: domain
"""
dominfo = self.domain_lookup(id)
- corefile = "/var/xen/dump/%s.%s.core"% (dominfo.name, dominfo.id)
+ corefile = "/var/xen/dump/%s.%s.core"% (dominfo.name, dominfo.domid)
try:
- xc.domain_dumpcore(dom=dominfo.id, corefile=corefile)
+ xc.domain_dumpcore(dom=dominfo.domid, corefile=corefile)
except Exception, ex:
log.warning("Dumpcore failed, id=%s name=%s: %s",
- dominfo.id, dominfo.name, ex)
+ dominfo.domid, dominfo.name, ex)
def instance():
"""Singleton constructor. Use this instead of the class constructor.
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index dd6be87a98..05edb93be2 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -27,6 +27,7 @@ import string, re
import os
import time
import threading
+import errno
import xen.lowlevel.xc; xc = xen.lowlevel.xc.new()
from xen.util.ip import check_subnet, get_current_ipgw
@@ -48,6 +49,7 @@ from xen.xend.XendRoot import get_component
from xen.xend.uuid import getUuid
from xen.xend.xenstore import DBVar, XenNode, DBMap
from xen.xend.xenstore.xstransact import xstransact
+from xen.xend.xenstore.xsutil import IntroduceDomain
"""Shutdown code for poweroff."""
DOMAIN_POWEROFF = 0
@@ -128,7 +130,7 @@ class XendDomainInfo:
@raise: VmError for invalid configuration
"""
uuid = getUuid()
- db = parentdb.addChild(uuid)
+ db = parentdb.addChild("%s/xend" % uuid)
path = parentdb.getPath()
vm = cls(uuid, path, db)
vm.construct(config)
@@ -138,23 +140,26 @@ class XendDomainInfo:
create = classmethod(create)
- def recreate(cls, db, info):
+ def recreate(cls, uuid, domid, db, info):
"""Create the VM object for an existing domain.
@param db: domain db
@param info: domain info from xc
"""
- dom = info['dom']
- path = "/".join(db.getPath().split("/")[0:-1])
- vm = cls(db.getName(), path, db)
- vm.setdom(dom)
- db.readDB()
+ path = "/".join(db.getPath().split("/")[0:-2])
+ vm = cls(uuid, path, db)
+ vm.setDomid(domid)
+ vm.name, vm.start_time = vm.gatherVm(("name", str),
+ ("start-time", float))
+ try:
+ db.readDB()
+ except: pass
vm.importFromDB()
config = vm.config
log.debug('info=' + str(info))
log.debug('config=' + prettyprintstring(config))
- vm.memory = info['mem_kb']/1024
+ vm.memory = info['mem_kb'] / 1024
vm.target = info['mem_kb'] * 1024
if config:
@@ -164,7 +169,7 @@ class XendDomainInfo:
finally:
vm.recreate = False
else:
- vm.setName("Domain-%d" % dom)
+ vm.setName("Domain-%d" % domid)
vm.exportToDB(save=True)
return vm
@@ -180,13 +185,13 @@ class XendDomainInfo:
"""
if not uuid:
uuid = getUuid()
- db = parentdb.addChild(uuid)
+ db = parentdb.addChild("%s/xend" % uuid)
path = parentdb.getPath()
vm = cls(uuid, path, db)
ssidref = int(sxp.child_value(config, 'ssidref'))
log.debug('restoring with ssidref='+str(ssidref))
id = xc.domain_create(ssidref = ssidref)
- vm.setdom(id)
+ vm.setDomid(id)
vm.clear_shutdown()
try:
vm.restore = True
@@ -199,32 +204,26 @@ class XendDomainInfo:
restore = classmethod(restore)
__exports__ = [
- DBVar('id', ty='int'),
- DBVar('name', ty='str'),
- DBVar('uuid', ty='str'),
DBVar('config', ty='sxpr'),
- DBVar('start_time', ty='float'),
DBVar('state', ty='str'),
- DBVar('store_mfn', ty='long'),
- DBVar('console_mfn', ty='long', path="console/ring-ref"),
DBVar('restart_mode', ty='str'),
DBVar('restart_state', ty='str'),
DBVar('restart_time', ty='float'),
DBVar('restart_count', ty='int'),
- DBVar('target', ty='long', path="memory/target"),
DBVar('device_model_pid', ty='int'),
]
def __init__(self, uuid, path, db):
self.uuid = uuid
self.path = path + "/" + uuid
+
self.db = db
self.recreate = 0
self.restore = 0
self.config = None
- self.id = None
+ self.domid = None
self.cpu_weight = 1
self.start_time = None
self.name = None
@@ -260,10 +259,42 @@ class XendDomainInfo:
self.restart_count = 0
self.vcpus = 1
- self.vcpusdb = {}
self.bootloader = None
self.device_model_pid = 0
+ self.writeVm("uuid", self.uuid)
+ self.storeDom("vm", self.path)
+
+ def readVm(self, *args):
+ return xstransact.Read(self.path, *args)
+
+ def writeVm(self, *args):
+ return xstransact.Write(self.path, *args)
+
+ def removeVm(self, *args):
+ return xstransact.Remove(self.path, *args)
+
+ def gatherVm(self, *args):
+ return xstransact.Gather(self.path, *args)
+
+ def storeVm(self, *args):
+ return xstransact.Store(self.path, *args)
+
+ def readDom(self, *args):
+ return xstransact.Read(self.path, *args)
+
+ def writeDom(self, *args):
+ return xstransact.Write(self.path, *args)
+
+ def removeDom(self, *args):
+ return xstransact.Remove(self.path, *args)
+
+ def gatherDom(self, *args):
+ return xstransact.Gather(self.path, *args)
+
+ def storeDom(self, *args):
+ return xstransact.Store(self.path, *args)
+
def setDB(self, db):
self.db = db
@@ -271,50 +302,56 @@ class XendDomainInfo:
self.db.saveDB(save=save, sync=sync)
def exportToDB(self, save=False, sync=False):
- if self.store_channel:
- self.store_channel.saveToDB(self.db.addChild("store_channel"),
- save=save)
- if self.console_channel:
- self.db['console/port'] = "%i" % self.console_channel.port1
if self.image:
self.image.exportToDB(save=save, sync=sync)
self.db.exportToDB(self, fields=self.__exports__, save=save, sync=sync)
def importFromDB(self):
self.db.importFromDB(self, fields=self.__exports__)
- self.store_channel = self.eventChannelOld("store_channel")
+ self.store_channel = self.eventChannel("store/port")
- def setdom(self, dom):
+ def setDomid(self, domid):
"""Set the domain id.
@param dom: domain id
"""
- self.id = int(dom)
- #self.db.id = self.id
+ self.domid = domid
+ self.storeDom("domid", self.domid)
def getDomain(self):
- return self.id
+ return self.domid
def setName(self, name):
self.name = name
- self.db.name = self.name
+ self.storeVm("name", name)
def getName(self):
return self.name
- def getStoreChannel(self):
- return self.store_channel
+ def setStoreRef(self, ref):
+ self.store_mfn = ref
+ self.storeDom("store/ring-ref", ref)
+
+ def setStoreChannel(self, channel):
+ if self.store_channel and self.store_channel != channel:
+ self.store_channel.close()
+ self.store_channel = channel
+ self.storeDom("store/port", channel.port1)
- def getConsoleChannel(self):
- return self.console_channel
+ def setConsoleRef(self, ref):
+ self.console_mfn = ref
+ self.storeDom("console/ring-ref", ref)
+
+ def setMemoryTarget(self, target):
+ self.memory_target = target
+ self.storeDom("memory/target", target)
def update(self, info=None):
"""Update with info from xc.domain_getinfo().
"""
- self.info = info or dom_get(self.id)
+ self.info = info or dom_get(self.domid)
self.memory = self.info['mem_kb'] / 1024
self.ssidref = self.info['ssidref']
- self.target = self.info['mem_kb'] * 1024
def state_set(self, state):
self.state_updated.acquire()
@@ -332,7 +369,7 @@ class XendDomainInfo:
def __str__(self):
s = "<domain"
- s += " id=" + str(self.id)
+ s += " id=" + str(self.domid)
s += " name=" + self.name
s += " memory=" + str(self.memory)
s += " ssidref=" + str(self.ssidref)
@@ -373,7 +410,7 @@ class XendDomainInfo:
frontpath = "%s/device/%s/%d" % (self.path, type, devnum)
front = { 'backend' : backpath,
- 'backend-id' : "%i" % backdom.id,
+ 'backend-id' : "%i" % backdom.domid,
'virtual-device' : "%i" % devnum }
xstransact.Write(frontpath, front)
@@ -382,7 +419,7 @@ class XendDomainInfo:
back = { 'type' : type,
'params' : params,
'frontend' : frontpath,
- 'frontend-id' : "%i" % self.id }
+ 'frontend-id' : "%i" % self.domid }
xstransact.Write(backpath, back)
return
@@ -415,7 +452,7 @@ class XendDomainInfo:
frontpath = "%s/device/%s/%d" % (self.path, type, devnum)
front = { 'backend' : backpath,
- 'backend-id' : "%i" % backdom.id,
+ 'backend-id' : "%i" % backdom.domid,
'handle' : "%i" % devnum,
'mac' : mac }
xstransact.Write(frontpath, front)
@@ -425,7 +462,7 @@ class XendDomainInfo:
'mac' : mac,
'bridge' : bridge,
'frontend' : frontpath,
- 'frontend-id' : "%i" % self.id,
+ 'frontend-id' : "%i" % self.domid,
'handle' : "%i" % devnum }
if ipaddr:
back['ip'] = ' '.join(ipaddr)
@@ -444,13 +481,13 @@ class XendDomainInfo:
frontpath = "%s/device/%s/%d" % (self.path, type, devnum)
front = { 'backend' : backpath,
- 'backend-id' : "%i" % backdom.id,
+ 'backend-id' : "%i" % backdom.domid,
'handle' : "%i" % devnum }
xstransact.Write(frontpath, front)
back = { 'instance' : "%i" % devnum,
'frontend' : frontpath,
- 'frontend-id' : "%i" % self.id }
+ 'frontend-id' : "%i" % self.domid }
xstransact.Write(backpath, back)
return
@@ -485,7 +522,7 @@ class XendDomainInfo:
def sxpr(self):
sxpr = ['domain',
- ['id', self.id],
+ ['domid', self.domid],
['name', self.name],
['memory', self.memory],
['ssidref', self.ssidref],
@@ -582,7 +619,7 @@ class XendDomainInfo:
return
if dominfo.is_terminated():
return
- if not self.id or (dominfo.id != self.id):
+ if not self.domid or (dominfo.domid != self.domid):
raise VmError('vm name clash: ' + name)
def construct(self, config):
@@ -630,11 +667,11 @@ class XendDomainInfo:
self.memory = int(sxp.child_value(config, 'memory'))
if self.memory is None:
raise VmError('missing memory size')
- self.target = self.memory * (1 << 20)
+ self.setMemoryTarget(self.memory * (1 << 20))
self.ssidref = int(sxp.child_value(config, 'ssidref'))
cpu = sxp.child_value(config, 'cpu')
- if self.recreate and self.id and cpu is not None and int(cpu) >= 0:
- xc.domain_pincpu(self.id, 0, 1<<int(cpu))
+ if self.recreate and self.domid and cpu is not None and int(cpu) >= 0:
+ xc.domain_pincpu(self.domid, 0, 1<<int(cpu))
try:
image = sxp.child_value(self.config, 'image')
vcpus = sxp.child_value(image, 'vcpus')
@@ -643,15 +680,11 @@ class XendDomainInfo:
except:
raise VmError('invalid vcpus value')
- def exportVCPUSToDB(self, vcpus):
- for v in range(0,vcpus):
- path = "/cpu/%d"%(v)
- if not self.vcpusdb.has_key(path):
- self.vcpusdb[path] = self.db.addChild(path)
- db = self.vcpusdb[path]
- log.debug("writing key availability=online to path %s in store"%(path))
- db['availability'] = "online"
- db.saveDB(save=True)
+ def configure_vcpus(self, vcpus):
+ d = {}
+ for v in range(0, vcpus):
+ d["cpu/%d/availability" % v] = "online"
+ self.writeVm(d)
def init_image(self):
"""Create boot image handler for the domain.
@@ -668,18 +701,17 @@ class XendDomainInfo:
self.image.createImage()
self.exportToDB()
if self.store_channel and self.store_mfn >= 0:
- self.db.introduceDomain(self.id,
- self.store_mfn,
- self.store_channel)
+ IntroduceDomain(self.domid, self.store_mfn,
+ self.store_channel.port1, self.path)
# get the configured value of vcpus and update store
- self.exportVCPUSToDB(self.vcpus)
+ self.configure_vcpus(self.vcpus)
def delete(self):
"""Delete the vm's db.
"""
- if dom_get(self.id):
+ if dom_get(self.domid):
return
- self.id = None
+ self.domid = None
self.saveToDB(sync=True)
try:
# Todo: eventually will have to wait for devices to signal
@@ -695,10 +727,10 @@ class XendDomainInfo:
The domain will not finally go away unless all vm
devices have been released.
"""
- if self.id is None:
+ if self.domid is None:
return
try:
- xc.domain_destroy(dom=self.id)
+ xc.domain_destroy(dom=self.domid)
except Exception, err:
log.exception("Domain destroy failed: %s", self.name)
@@ -708,16 +740,7 @@ class XendDomainInfo:
self.state = STATE_VM_TERMINATED
self.release_devices()
if self.store_channel:
- try:
- self.store_channel.close()
- self.store_channel = None
- except:
- pass
- try:
- self.db.releaseDomain(self.id)
- except Exception, ex:
- log.warning("error in domain release on xenstore: %s", ex)
- pass
+ self.setStoreChannel(None)
if self.console_channel:
# notify processes using this cosole?
try:
@@ -765,7 +788,7 @@ class XendDomainInfo:
def show(self):
"""Print virtual machine info.
"""
- print "[VM dom=%d name=%s memory=%d ssidref=%d" % (self.id, self.name, self.memory, self.ssidref)
+ print "[VM dom=%d name=%s memory=%d ssidref=%d" % (self.domid, self.name, self.memory, self.ssidref)
print "image:"
sxp.show(self.image)
print "]"
@@ -777,46 +800,37 @@ class XendDomainInfo:
return
if self.start_time is None:
self.start_time = time.time()
+ self.storeVm(("start-time", self.start_time))
try:
cpu = int(sxp.child_value(self.config, 'cpu', '-1'))
except:
raise VmError('invalid cpu')
- id = self.image.initDomain(self.id, self.memory, self.ssidref, cpu, self.cpu_weight)
+ id = self.image.initDomain(self.domid, self.memory, self.ssidref, cpu, self.cpu_weight)
log.debug('init_domain> Created domain=%d name=%s memory=%d',
id, self.name, self.memory)
- self.setdom(id)
+ self.setDomid(id)
- def eventChannelOld(self, key):
- """Create an event channel to the domain.
- If saved info is available recreate the channel.
-
- @param key db key for the saved data (if any)
- """
- db = self.db.addChild(key)
- return EventChannel.restoreFromDB(db, 0, self.id)
-
- def eventChannel(self, path=None, key=None):
+ def eventChannel(self, path=None):
"""Create an event channel to the domain.
@param path under which port is stored in db
"""
port = 0
- try:
- if path and key:
- if path:
- db = self.db.addChild(path)
- else:
- db = self.db
- port = int(db[key].getData())
- except: pass
- return EventChannel.interdomain(0, self.id, port1=port, port2=0)
+ if path:
+ try:
+ port = int(self.readDom(path))
+ except:
+ # if anything goes wrong, assume the port was not yet set
+ pass
+ ret = EventChannel.interdomain(0, self.domid, port1=port, port2=0)
+ self.storeDom(path, ret.port1)
+ return ret
def create_channel(self):
"""Create the channels to the domain.
"""
- self.store_channel = self.eventChannelOld("store_channel")
- self.console_channel = self.eventChannel("console", "port")
-
+ self.store_channel = self.eventChannel("store/port")
+ self.console_channel = self.eventChannel("console/port")
def create_configured_devices(self):
devices = sxp.children(self.config, 'device')
@@ -1046,50 +1060,30 @@ class XendDomainInfo:
log.warning("Unknown config field %s", field_name)
index[field_name] = field_index + 1
- def mem_target_set(self, target):
- """Set domain memory target in bytes.
- """
- if target:
- self.target = target * (1 << 20)
- # Commit to XenStore immediately
- self.exportToDB()
-
def vcpu_hotplug(self, vcpu, state):
"""Disable or enable VCPU in domain.
"""
- db = ""
- try:
- db = self.vcpusdb['/cpu/%d'%(vcpu)]
- except:
- log.error("Invalid VCPU")
+ if vcpu > self.vcpus:
+ log.error("Invalid VCPU %d" % vcpu)
return
-
- if self.store_channel:
- if int(state) == 0:
- db['availability'] = "offline"
- else:
- db['availability'] = "online"
-
- db.saveDB(save=True)
+ if int(state) == 0:
+ availability = "offline"
+ else:
+ availability = "online"
+ self.storeVm("cpu/%d/availability" % vcpu, availability)
def shutdown(self, reason):
if not reason in shutdown_reasons.values():
raise XendError('invalid reason:' + reason)
- db = self.db.addChild("/control");
- db['shutdown'] = reason;
- db.saveDB(save=True);
+ self.storeVm("control/shutdown", reason)
if not reason in ['suspend']:
self.shutdown_pending = {'start':time.time(), 'reason':reason}
def clear_shutdown(self):
- db = self.db.addChild("/control")
- db['shutdown'] = ""
- db.saveDB(save=True)
+ self.removeVm("control/shutdown")
def send_sysrq(self, key=0):
- db = self.db.addChild("/control");
- db['sysrq'] = '%c' % key;
- db.saveDB(save=True);
+ self.storeVm("control/sysrq", '%c' % key)
def shutdown_time_left(self, timeout):
if not self.shutdown_pending:
@@ -1098,14 +1092,22 @@ class XendDomainInfo:
def dom0_init_store(self):
if not self.store_channel:
- self.store_channel = self.eventChannelOld("store_channel")
- self.store_mfn = xc.init_store(self.store_channel.port2)
- if self.store_mfn >= 0:
- self.db.introduceDomain(self.id, self.store_mfn,
- self.store_channel)
- self.exportToDB(save=True, sync=True)
- # get run-time value of vcpus and update store
- self.exportVCPUSToDB(dom_get(self.id)['vcpus'])
+ self.store_channel = self.eventChannel("store/port")
+ if not self.store_channel:
+ return
+ ref = xc.init_store(self.store_channel.port2)
+ if ref and ref >= 0:
+ self.setStoreRef(ref)
+ try:
+ IntroduceDomain(self.domid, ref, self.store_channel.port1,
+ self.path)
+ except RuntimeError, ex:
+ if ex.args[0] == errno.EISCONN:
+ pass
+ else:
+ raise
+ # get run-time value of vcpus and update store
+ self.configure_vcpus(dom_get(self.domid)['vcpus'])
def vm_field_ignore(_, _1, _2, _3):
@@ -1126,7 +1128,7 @@ def vm_field_maxmem(vm, _1, val, _2):
maxmem = int(maxmem)
except:
raise VmError("invalid maxmem: " + str(maxmem))
- xc.domain_setmaxmem(vm.id, maxmem_kb = maxmem * 1024)
+ xc.domain_setmaxmem(vm.domid, maxmem_kb = maxmem * 1024)
#============================================================================
diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py
index e03d544082..63e22c34d7 100644
--- a/tools/python/xen/xend/image.py
+++ b/tools/python/xen/xend/image.py
@@ -23,6 +23,7 @@ from xen.xend import sxp
from xen.xend.XendError import VmError
from xen.xend.XendLogging import log
from xen.xend.xenstore import DBVar
+from xen.xend.xenstore.xstransact import xstransact
from xen.xend.server import channel
@@ -154,7 +155,6 @@ class ImageHandler:
if dom <= 0:
raise VmError('Creating domain failed: name=%s' % self.vm.name)
log.debug("initDomain: cpu=%d mem_kb=%d ssidref=%d dom=%d", cpu, mem_kb, ssidref, dom)
- # xc.domain_setuuid(dom, uuid)
xc.domain_setcpuweight(dom, cpu_weight)
xc.domain_setmaxmem(dom, mem_kb)
@@ -240,6 +240,12 @@ class ImageHandler:
"""Extra cleanup on domain destroy (define in subclass if needed)."""
pass
+ def set_vminfo(self, d):
+ if d.has_key('store_mfn'):
+ self.vm.setStoreRef(d.get('store_mfn'))
+ if d.has_key('console_mfn'):
+ self.vm.setConsoleRef(d.get('console_mfn'))
+
addImageHandlerClass = ImageHandler.addImageHandlerClass
class LinuxImageHandler(ImageHandler):
@@ -274,8 +280,7 @@ class LinuxImageHandler(ImageHandler):
flags = self.flags,
vcpus = self.vm.vcpus)
if isinstance(ret, dict):
- self.vm.store_mfn = ret.get('store_mfn')
- self.vm.console_mfn = ret.get('console_mfn')
+ self.set_vminfo(ret)
return 0
return ret
@@ -318,7 +323,7 @@ class VmxImageHandler(ImageHandler):
flags = self.flags,
vcpus = self.vm.vcpus)
if isinstance(ret, dict):
- self.vm.store_mfn = ret.get('store_mfn')
+ self.set_vminfo(ret)
return 0
return ret
diff --git a/tools/python/xen/xend/server/SrvDomain.py b/tools/python/xen/xend/server/SrvDomain.py
index 84e767793f..7e3a86f79b 100644
--- a/tools/python/xen/xend/server/SrvDomain.py
+++ b/tools/python/xen/xend/server/SrvDomain.py
@@ -41,21 +41,21 @@ class SrvDomain(SrvDir):
fn = FormFn(self.xd.domain_configure,
[['dom', 'int'],
['config', 'sxpr']])
- return fn(req.args, {'dom': self.dom.id})
+ return fn(req.args, {'dom': self.dom.domid})
def op_unpause(self, op, req):
- val = self.xd.domain_unpause(self.dom.id)
+ val = self.xd.domain_unpause(self.dom.domid)
return val
def op_pause(self, op, req):
- val = self.xd.domain_pause(self.dom.id)
+ val = self.xd.domain_pause(self.dom.domid)
return val
def op_shutdown(self, op, req):
fn = FormFn(self.xd.domain_shutdown,
[['dom', 'int'],
['reason', 'str']])
- val = fn(req.args, {'dom': self.dom.id})
+ val = fn(req.args, {'dom': self.dom.domid})
req.setResponseCode(http.ACCEPTED)
req.setHeader("Location", "%s/.." % req.prePathURL())
return val
@@ -64,7 +64,7 @@ class SrvDomain(SrvDir):
fn = FormFn(self.xd.domain_sysrq,
[['dom', 'int'],
['key', 'int']])
- val = fn(req.args, {'dom' : self.dom.id})
+ val = fn(req.args, {'dom' : self.dom.domid})
req.setResponseCode(http.ACCEPTED)
req.setHeader("Location", "%s/.." % req.prePathURL())
return val
@@ -73,7 +73,7 @@ class SrvDomain(SrvDir):
fn = FormFn(self.xd.domain_destroy,
[['dom', 'int'],
['reason', 'str']])
- val = fn(req.args, {'dom': self.dom.id})
+ val = fn(req.args, {'dom': self.dom.domid})
req.setHeader("Location", "%s/.." % req.prePathURL())
return val
@@ -84,7 +84,7 @@ class SrvDomain(SrvDir):
fn = FormFn(self.xd.domain_save,
[['dom', 'int'],
['file', 'str']])
- val = fn(req.args, {'dom': self.dom.id})
+ val = fn(req.args, {'dom': self.dom.domid})
return 0
def op_migrate(self, op, req):
@@ -96,14 +96,14 @@ class SrvDomain(SrvDir):
['destination', 'str'],
['live', 'int'],
['resource', 'int']])
- return fn(req.args, {'dom': self.dom.id})
+ return fn(req.args, {'dom': self.dom.domid})
def op_pincpu(self, op, req):
fn = FormFn(self.xd.domain_pincpu,
[['dom', 'int'],
['vcpu', 'int'],
['cpumap', 'int']])
- val = fn(req.args, {'dom': self.dom.id})
+ val = fn(req.args, {'dom': self.dom.domid})
return val
def op_cpu_bvt_set(self, op, req):
@@ -114,7 +114,7 @@ class SrvDomain(SrvDir):
['warpvalue', 'int'],
['warpl', 'long'],
['warpu', 'long']])
- val = fn(req.args, {'dom': self.dom.id})
+ val = fn(req.args, {'dom': self.dom.domid})
return val
@@ -126,28 +126,28 @@ class SrvDomain(SrvDir):
['latency', 'int'],
['extratime', 'int'],
['weight', 'int']])
- val = fn(req.args, {'dom': self.dom.id})
+ val = fn(req.args, {'dom': self.dom.domid})
return val
def op_maxmem_set(self, op, req):
fn = FormFn(self.xd.domain_maxmem_set,
[['dom', 'int'],
['memory', 'int']])
- val = fn(req.args, {'dom': self.dom.id})
+ val = fn(req.args, {'dom': self.dom.domid})
return val
def op_mem_target_set(self, op, req):
fn = FormFn(self.xd.domain_mem_target_set,
[['dom', 'int'],
['target', 'int']])
- val = fn(req.args, {'dom': self.dom.id})
+ val = fn(req.args, {'dom': self.dom.domid})
return val
def op_devices(self, op, req):
fn = FormFn(self.xd.domain_devtype_ls,
[['dom', 'int'],
['type', 'str']])
- val = fn(req.args, {'dom': self.dom.id})
+ val = fn(req.args, {'dom': self.dom.domid})
return val
def op_device(self, op, req):
@@ -155,7 +155,7 @@ class SrvDomain(SrvDir):
[['dom', 'int'],
['type', 'str'],
['idx', 'int']])
- val = fn(req.args, {'dom': self.dom.id})
+ val = fn(req.args, {'dom': self.dom.domid})
if val:
return val.sxpr()
else:
@@ -165,7 +165,7 @@ class SrvDomain(SrvDir):
fn = FormFn(self.xd.domain_device_create,
[['dom', 'int'],
['config', 'sxpr']])
- val = fn(req.args, {'dom': self.dom.id})
+ val = fn(req.args, {'dom': self.dom.domid})
return val
def op_device_refresh(self, op, req):
@@ -173,7 +173,7 @@ class SrvDomain(SrvDir):
[['dom', 'int'],
['type', 'str'],
['idx', 'str']])
- val = fn(req.args, {'dom': self.dom.id})
+ val = fn(req.args, {'dom': self.dom.domid})
return val
def op_device_destroy(self, op, req):
@@ -181,7 +181,7 @@ class SrvDomain(SrvDir):
[['dom', 'int'],
['type', 'str'],
['idx', 'str']])
- val = fn(req.args, {'dom': self.dom.id})
+ val = fn(req.args, {'dom': self.dom.domid})
return val
def op_device_configure(self, op, req):
@@ -189,7 +189,7 @@ class SrvDomain(SrvDir):
[['dom', 'int'],
['config', 'sxpr'],
['idx', 'str']])
- val = fn(req.args, {'dom': self.dom.id})
+ val = fn(req.args, {'dom': self.dom.domid})
return val
def op_vif_limit_set(self, op, req):
@@ -198,7 +198,7 @@ class SrvDomain(SrvDir):
['vif', 'int'],
['credit', 'int'],
['period', 'int']])
- val = fn(req.args, {'dom': self.dom.id})
+ val = fn(req.args, {'dom': self.dom.domid})
return val
def op_vcpu_hotplug(self, op, req):
@@ -206,7 +206,7 @@ class SrvDomain(SrvDir):
[['dom', 'int'],
['vcpu', 'int'],
['state', 'int']])
- val = fn(req.args, {'dom': self.dom.id})
+ val = fn(req.args, {'dom': self.dom.domid})
return val
def render_POST(self, req):
diff --git a/tools/python/xen/xend/server/SrvDomainDir.py b/tools/python/xen/xend/server/SrvDomainDir.py
index 2b5f873fd3..78066b2f40 100644
--- a/tools/python/xen/xend/server/SrvDomainDir.py
+++ b/tools/python/xen/xend/server/SrvDomainDir.py
@@ -154,7 +154,7 @@ class SrvDomainDir(SrvDir):
for d in domains:
req.write('<li><a href="%s%s"> Domain %s</a>'
% (url, d.name, d.name))
- req.write('id=%s' % d.id)
+ req.write('id=%s' % d.domid)
req.write('memory=%d'% d.memory)
req.write('ssidref=%d'% d.ssidref)
req.write('</li>')
diff --git a/tools/python/xen/xend/server/blkif.py b/tools/python/xen/xend/server/blkif.py
index 5492caa0d4..d142c9afb4 100755
--- a/tools/python/xen/xend/server/blkif.py
+++ b/tools/python/xen/xend/server/blkif.py
@@ -123,7 +123,7 @@ class BlkDev(Dev):
def init(self, recreate=False, reboot=False):
self.frontendDomain = self.getDomain()
backend = self.getBackend()
- self.backendId = backend.id
+ self.backendId = backend.domid
def configure(self, config, change=False, recreate=False):
if change:
@@ -146,7 +146,7 @@ class BlkDev(Dev):
try:
xd = get_component('xen.xend.XendDomain')
- self.backendDomain = xd.domain_lookup_by_name(sxp.child_value(config, 'backend', '0')).id
+ self.backendDomain = xd.domain_lookup_by_name(sxp.child_value(config, 'backend', '0')).domid
except:
raise XendError('invalid backend domain')
diff --git a/tools/python/xen/xend/server/netif.py b/tools/python/xen/xend/server/netif.py
index 4d201f3cda..acb7967c53 100755
--- a/tools/python/xen/xend/server/netif.py
+++ b/tools/python/xen/xend/server/netif.py
@@ -180,7 +180,7 @@ class NetDev(Dev):
else:
#todo: Code below will fail on xend restart when backend is not domain 0.
xd = get_component('xen.xend.XendDomain')
- self.backendDomain = xd.domain_lookup_by_name(sxp.child_value(config, 'backend', '0')).id
+ self.backendDomain = xd.domain_lookup_by_name(sxp.child_value(config, 'backend', '0')).domid
except:
raise XendError('invalid backend domain')
return self.config
@@ -206,7 +206,7 @@ class NetDev(Dev):
mtu = self._get_config_mtu(config)
xd = get_component('xen.xend.XendDomain')
- backendDomain = xd.domain_lookup_by_name(sxp.child_value(config, 'backend', '0')).id
+ backendDomain = xd.domain_lookup_by_name(sxp.child_value(config, 'backend', '0')).domid
if (mac is not None) and (mac != self.mac):
raise XendError("cannot change mac")
diff --git a/tools/python/xen/xend/xenstore/xsnode.py b/tools/python/xen/xend/xenstore/xsnode.py
index 125383974d..e08e346ae9 100644
--- a/tools/python/xen/xend/xenstore/xsnode.py
+++ b/tools/python/xen/xend/xenstore/xsnode.py
@@ -365,18 +365,6 @@ class XenStore:
finally:
self.watchThread = None
- def introduceDomain(self, dom, page, evtchn, path):
- try:
- self.getxs().introduce_domain(dom, page, evtchn.port1, path)
- except RuntimeError, ex:
- if ex.args[0] == errno.EISCONN:
- return None
- else:
- raise
-
- def releaseDomain(self, dom):
- self.getxs().release_domain(dom)
-
def getXenStore():
global xenstore
try:
@@ -461,12 +449,6 @@ class XenNode:
def ls(self):
return self.store.ls(self.path)
- def introduceDomain(self, dom, page, evtchn, path):
- self.store.introduceDomain(dom, page, evtchn, path)
-
- def releaseDomain(self, dom):
- self.store.releaseDomain(dom)
-
def watch(self, fn, path=""):
"""Watch a path for changes. The path is relative
to the node and defaults to the node itself.
diff --git a/tools/python/xen/xend/xenstore/xsobj.py b/tools/python/xen/xend/xenstore/xsobj.py
index 3a85d2674a..9e58534c39 100644
--- a/tools/python/xen/xend/xenstore/xsobj.py
+++ b/tools/python/xen/xend/xenstore/xsobj.py
@@ -319,30 +319,6 @@ class DBMap(dict):
def getPath(self):
return self.__db__ and self.__db__.relPath()
- def introduceDomain(self, dom, page, evtchn, path=None):
- db = self.__db__
- if path is None:
- path = db.relPath()
- log.info("DBMap>introduceDomain> %d %d %s %s" %(dom, page, evtchn, path))
- try:
- db.introduceDomain(dom, page, evtchn, path)
- except Exception, ex:
- import traceback
- traceback.print_exc()
- log.info("DBMap>introduceDomain> %s" %ex)
- pass # todo: don't ignore
-
- def releaseDomain(self, dom):
- db = self.__db__
- log.info("DBMap>releaseDomain> %d" %dom)
- try:
- db.releaseDomain(dom)
- except Exception, ex:
- import traceback
- traceback.print_exc()
- log.info("DBMap>releaseDomain> %s" %ex)
- pass # todo: don't ignore
-
def watch(self, fn, path=""):
return self.__db__.watch(fn, path=path)
@@ -509,9 +485,11 @@ class DBMap(dict):
if self.__db__ is None:
return
self.__data__ = self.__db__.getData()
- for k in self.__db__.ls():
- n = self.addChild(k)
- n.readDB()
+ l = self.__db__.ls()
+ if l:
+ for k in l:
+ n = self.addChild(k)
+ n.readDB()
self.__dirty__ = False
def readChildDB(self, k):
diff --git a/tools/python/xen/xend/xenstore/xstransact.py b/tools/python/xen/xend/xenstore/xstransact.py
index 0b8d8612a1..62dfc49627 100644
--- a/tools/python/xen/xend/xenstore/xstransact.py
+++ b/tools/python/xen/xend/xenstore/xstransact.py
@@ -7,14 +7,7 @@
import errno
import threading
from xen.lowlevel import xs
-
-handles = {}
-
-# XXX need to g/c handles from dead threads
-def xshandle():
- if not handles.has_key(threading.currentThread()):
- handles[threading.currentThread()] = xs.open()
- return handles[threading.currentThread()]
+from xen.xend.xenstore.xsutil import xshandle
class xstransact:
@@ -43,8 +36,6 @@ class xstransact:
return xshandle().transaction_end(False)
def abort(self):
- if not self.in_transaction:
- raise RuntimeError
self.in_transaction = False
return xshandle().transaction_end(True)
@@ -100,7 +91,10 @@ class xstransact:
def _list(self, key):
path = "%s/%s" % (self.path, key)
- return map(lambda x: key + "/" + x, xshandle().ls(path))
+ l = xshandle().ls(path)
+ if l:
+ return map(lambda x: key + "/" + x, l)
+ return []
def list(self, *args):
if len(args) == 0:
@@ -110,6 +104,45 @@ class xstransact:
ret.extend(self._list(key))
return ret
+ def gather(self, *args):
+ if len(args) and type(args[0]) != tuple:
+ args = args,
+ ret = []
+ for tup in args:
+ if len(tup) == 2:
+ (key, fn) = tup
+ defval = None
+ else:
+ (key, fn, defval) = tup
+ try:
+ val = fn(self._read(key))
+ except TypeError:
+ val = defval
+ ret.append(val)
+ if len(ret) == 1:
+ return ret[0]
+ return ret
+
+ def store(self, *args):
+ if len(args) and type(args[0]) != tuple:
+ args = args,
+ for tup in args:
+ if len(tup) == 2:
+ (key, val) = tup
+ try:
+ fmt = { str : "%s",
+ int : "%i",
+ float : "%f",
+ type(None) : None }[type(val)]
+ except KeyError:
+ raise TypeError
+ else:
+ (key, val, fmt) = tup
+ if val is None:
+ self._remove(key)
+ else:
+ self._write(key, fmt % val)
+
def Read(cls, path, *args):
while True:
@@ -119,8 +152,13 @@ class xstransact:
t.commit()
return v
except RuntimeError, ex:
+ t.abort()
if ex.args[0] == errno.ETIMEDOUT:
pass
+ else:
+ raise
+ except:
+ t.abort()
raise
Read = classmethod(Read)
@@ -133,13 +171,18 @@ class xstransact:
t.commit()
return
except RuntimeError, ex:
+ t.abort()
if ex.args[0] == errno.ETIMEDOUT:
pass
+ else:
+ raise
+ except:
+ t.abort()
raise
Write = classmethod(Write)
- def Remove(cls, *args):
+ def Remove(cls, path, *args):
while True:
try:
t = cls(path)
@@ -147,8 +190,13 @@ class xstransact:
t.commit()
return
except RuntimeError, ex:
+ t.abort()
if ex.args[0] == errno.ETIMEDOUT:
pass
+ else:
+ raise
+ except:
+ t.abort()
raise
Remove = classmethod(Remove)
@@ -161,8 +209,51 @@ class xstransact:
t.commit()
return v
except RuntimeError, ex:
+ t.abort()
if ex.args[0] == errno.ETIMEDOUT:
pass
+ else:
+ raise
+ except:
+ t.abort()
raise
List = classmethod(List)
+
+ def Gather(cls, path, *args):
+ while True:
+ try:
+ t = cls(path)
+ v = t.gather(*args)
+ t.commit()
+ return v
+ except RuntimeError, ex:
+ t.abort()
+ if ex.args[0] == errno.ETIMEDOUT:
+ pass
+ else:
+ raise
+ except:
+ t.abort()
+ raise
+
+ Gather = classmethod(Gather)
+
+ def Store(cls, path, *args):
+ while True:
+ try:
+ t = cls(path)
+ v = t.store(*args)
+ t.commit()
+ return v
+ except RuntimeError, ex:
+ t.abort()
+ if ex.args[0] == errno.ETIMEDOUT:
+ pass
+ else:
+ raise
+ except:
+ t.abort()
+ raise
+
+ Store = classmethod(Store)
diff --git a/tools/python/xen/xend/xenstore/xsutil.py b/tools/python/xen/xend/xenstore/xsutil.py
new file mode 100644
index 0000000000..1dca916dd8
--- /dev/null
+++ b/tools/python/xen/xend/xenstore/xsutil.py
@@ -0,0 +1,20 @@
+# Copyright (C) 2005 Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
+
+# This file is subject to the terms and conditions of the GNU General
+# Public License. See the file "COPYING" in the main directory of
+# this archive for more details.
+
+import threading
+from xen.lowlevel import xs
+
+handles = {}
+
+# XXX need to g/c handles from dead threads
+def xshandle():
+ if not handles.has_key(threading.currentThread()):
+ handles[threading.currentThread()] = xs.open()
+ return handles[threading.currentThread()]
+
+
+def IntroduceDomain(domid, page, port, path):
+ return xshandle().introduce_domain(domid, page, port, path)
diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py
index 6fdfedd3a3..482db15b89 100644
--- a/tools/python/xen/xm/create.py
+++ b/tools/python/xen/xm/create.py
@@ -750,7 +750,7 @@ def make_domain(opts, config):
server.xend_domain_destroy(dom)
opts.err("Failed to unpause domain %s" % dom)
opts.info("Started domain %s" % (dom))
- return int(sxp.child_value(dominfo, 'id'))
+ return int(sxp.child_value(dominfo, 'domid'))
def get_dom0_alloc():
"""Return current allocation memory of dom0 (in MB). Return 0 on error"""
diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py
index b031081fe1..cae59fedfe 100644
--- a/tools/python/xen/xm/main.py
+++ b/tools/python/xen/xm/main.py
@@ -64,7 +64,6 @@ xm full list of subcommands:
Domain Commands:
console <DomId> attach to console of DomId
cpus-list <DomId> <VCpu> get the list of cpus for a VCPU
- cpus-set <DomId> <VCpu> <CPUS> set which cpus a VCPU can use.
create <ConfigFile> create a domain
destroy <DomId> terminate a domain immediately
domid <DomName> convert a domain name to a domain id
@@ -83,6 +82,7 @@ xm full list of subcommands:
vcpu-enable <DomId> <VCPU> disable VCPU in a domain
vcpu-disable <DomId> <VCPU> enable VCPU in a domain
vcpu-list <DomId> get the list of VCPUs for a domain
+ vcpu-pin <DomId> <VCpu> <CPUS> set which cpus a VCPU can use.
Xen Host Commands:
dmesg [--clear] read or clear Xen's message buffer
@@ -91,14 +91,15 @@ xm full list of subcommands:
top monitor system and domains in real-time
Scheduler Commands:
- bvt <options> set BVT scheduler parameters
- bvt_ctxallow <Allow> set the BVT scheduler context switch allowance
- sedf <options> set simple EDF parameters
+ sched-bvt <options> set BVT scheduler parameters
+ sched-bvt-ctxallow <Allow>
+ Set the BVT scheduler context switch allowance
+ sched-sedf <options> set simple EDF parameters
Virtual Device Commands:
- block-create <DomId> <BackDev> <FrontDev> <Mode> [BackDomId]
+ block-attach <DomId> <BackDev> <FrontDev> <Mode> [BackDomId]
Create a new virtual block device
- block-destroy <DomId> <DevId> Destroy a domain's virtual block device
+ block-detach <DomId> <DevId> Destroy a domain's virtual block device
block-list <DomId> List virtual block devices for a domain
block-refresh <DomId> <DevId> Refresh a virtual block device for a domain
network-limit <DomId> <Vif> <Credit> <Period>
@@ -172,8 +173,7 @@ def xm_create(args):
from xen.xm import create
# ugly hack because the opt parser apparently wants
# the subcommand name just to throw it away!
- args.insert(0,"bogus")
- create.main(args)
+ create.main(["bogus"] + args)
def xm_save(args):
arg_check(args,2,"save")
@@ -192,17 +192,16 @@ def xm_restore(args):
from xen.xend.XendClient import server
info = server.xend_domain_restore(savefile)
PrettyPrint.prettyprint(info)
- id = sxp.child_value(info, 'id')
+ id = sxp.child_value(info, 'domid')
if id is not None:
- server.xend_domain_unpause(id)
+ server.xend_domain_unpause(domid)
def xm_migrate(args):
# TODO: arg_check
from xen.xm import migrate
# ugly hack because the opt parser apparently wants
# the subcommand name just to throw it away!
- args.insert(0,"bogus")
- migrate.main(args)
+ migrate.main(["bogus"] + args)
def xm_list(args):
use_long = 0
@@ -242,7 +241,7 @@ def xm_list(args):
def parse_doms_info(info):
dominfo = {}
- dominfo['dom'] = int(sxp.child_value(info, 'id', '-1'))
+ dominfo['dom'] = int(sxp.child_value(info, 'domid', '-1'))
dominfo['name'] = sxp.child_value(info, 'name', '??')
dominfo['mem'] = int(sxp.child_value(info, 'memory', '0'))
dominfo['cpu'] = str(sxp.child_value(info, 'cpu', '0'))
@@ -265,7 +264,7 @@ def parse_doms_info(info):
for cpu in vcpu_to_cpu:
vcpuinfo = {}
vcpuinfo['name'] = sxp.child_value(info, 'name', '??')
- vcpuinfo['dom'] = int(sxp.child_value(info, 'id', '-1'))
+ vcpuinfo['dom'] = int(sxp.child_value(info, 'domid', '-1'))
vcpuinfo['vcpu'] = int(count)
vcpuinfo['cpu'] = int(cpu)
vcpuinfo['cpumap'] = int(cpumap[count])&mask
@@ -289,8 +288,7 @@ def xm_show_vcpus(domsinfo):
vcpuinfo)
def xm_vcpu_list(args):
- args.insert(0,"-v")
- xm_list(args)
+ xm_list(["-v"] + args)
def xm_destroy(args):
arg_check(args,1,"destroy")
@@ -298,33 +296,28 @@ def xm_destroy(args):
from xen.xm import destroy
# ugly hack because the opt parser apparently wants
# the subcommand name just to throw it away!
- args.insert(0,"bogus")
- destroy.main(args)
+ destroy.main(["bogus"] + args)
def xm_reboot(args):
arg_check(args,1,"reboot")
+ from xen.xm import shutdown
# ugly hack because the opt parser apparently wants
# the subcommand name just to throw it away!
- args.insert(0,"bogus")
- args.insert(2,"-R")
- from xen.xm import shutdown
- shutdown.main(args)
+ shutdown.main(["bogus", "-R"] + args)
def xm_shutdown(args):
arg_check(args,1,"shutdown")
+ from xen.xm import shutdown
# ugly hack because the opt parser apparently wants
# the subcommand name just to throw it away!
- args.insert(0,"bogus")
- from xen.xm import shutdown
- shutdown.main(args)
+ shutdown.main(["bogus"] + args)
def xm_sysrq(args):
from xen.xm import sysrq
# ugly hack because the opt parser apparently wants
# the subcommand name just to throw it away!
- args.insert(0,"bogus")
- sysrq.main(args)
+ sysrq.main(["bogus"] + args)
def xm_pause(args):
arg_check(args, 1, "pause")
@@ -358,8 +351,8 @@ def cpu_make_map(cpulist):
return cpumap
-def xm_cpus_set(args):
- arg_check(args, 3, "cpus-set")
+def xm_vcpu_pin(args):
+ arg_check(args, 3, "vcpu-pin")
dom = args[0]
vcpu = int(args[1])
@@ -395,7 +388,7 @@ def xm_vcpu_enable(args):
from xen.xend.XendClient import server
dom = server.xend_domain(name)
- id = sxp.child_value(dom, 'id')
+ id = sxp.child_value(dom, 'domid')
server.xend_domain_vcpu_hotplug(id, vcpu, 1)
def xm_vcpu_disable(args):
@@ -406,7 +399,7 @@ def xm_vcpu_disable(args):
from xen.xend.XendClient import server
dom = server.xend_domain(name)
- id = sxp.child_value(dom, 'id')
+ id = sxp.child_value(dom, 'domid')
server.xend_domain_vcpu_hotplug(id, vcpu, 0)
def xm_domid(args):
@@ -414,7 +407,7 @@ def xm_domid(args):
from xen.xend.XendClient import server
dom = server.xend_domain(name)
- print sxp.child_value(dom, 'id')
+ print sxp.child_value(dom, 'domid')
def xm_domname(args):
name = args[0]
@@ -423,22 +416,22 @@ def xm_domname(args):
dom = server.xend_domain(name)
print sxp.child_value(dom, 'name')
-def xm_bvt(args):
- arg_check(args, 6, "bvt")
+def xm_sched_bvt(args):
+ arg_check(args, 6, "sched-bvt")
dom = args[0]
v = map(long, args[1:6])
from xen.xend.XendClient import server
server.xend_domain_cpu_bvt_set(dom, *v)
-def xm_bvt_ctxallow(args):
- arg_check(args, 1, "bvt_ctxallow")
+def xm_sched_bvt_ctxallow(args):
+ arg_check(args, 1, "sched-bvt-ctxallow")
slice = int(args[0])
from xen.xend.XendClient import server
server.xend_node_cpu_bvt_slice_set(slice)
-def xm_sedf(args):
- arg_check(args, 6, "sedf")
+def xm_sched_sedf(args):
+ arg_check(args, 6, "sched-sedf")
dom = args[0]
v = map(int, args[1:6])
@@ -462,7 +455,7 @@ def xm_console(args):
dom = args[0]
from xen.xend.XendClient import server
info = server.xend_domain(dom)
- domid = int(sxp.child_value(info, 'id', '-1'))
+ domid = int(sxp.child_value(info, 'domid', '-1'))
cmd = "/usr/libexec/xen/xenconsole %d" % domid
os.execvp('/usr/libexec/xen/xenconsole', cmd.split())
console = sxp.child(info, "console")
@@ -482,10 +475,11 @@ its contents if the [-c|--clear] flag is specified.
fn=set_true, default=0,
use="Clear the contents of the Xen message buffer.")
# Work around for gopts
- args.insert(0,"bogus")
- gopts.parse(args)
- if not (1 <= len(args) <= 2):
- err('Invalid arguments: ' + str(args))
+ myargs = args
+ myargs.insert(0, "bogus")
+ gopts.parse(myargs)
+ if not (1 <= len(myargs) <= 2):
+ err('Invalid arguments: ' + str(myargs))
from xen.xend.XendClient import server
if not gopts.vals.clear:
@@ -512,6 +506,14 @@ def xm_network_list(args):
sxp.show(x)
print
+def xm_network_attach(args):
+
+ print "Not implemented"
+
+def xm_network_detach(args):
+
+ print "Not implemented"
+
def xm_block_list(args):
arg_check(args,1,"block-list")
dom = args[0]
@@ -520,11 +522,14 @@ def xm_block_list(args):
sxp.show(x)
print
-def xm_block_create(args):
+def xm_block_attach(args):
n = len(args)
+ if n == 0:
+ usage("block-attach")
+
if n < 4 or n > 5:
err("%s: Invalid argument(s)" % args[0])
- usage("block-create")
+ usage("block-attach")
dom = args[0]
vbd = ['vbd',
@@ -546,8 +551,8 @@ def xm_block_refresh(args):
from xen.xend.XendClient import server
server.xend_domain_device_refresh(dom, 'vbd', dev)
-def xm_block_destroy(args):
- arg_check(args,2,"block-destroy")
+def xm_block_detach(args):
+ arg_check(args,2,"block-detach")
dom = args[0]
dev = args[1]
@@ -615,7 +620,7 @@ commands = {
"mem-max": xm_mem_max,
"mem-set": xm_mem_set,
# cpu commands
- "cpus-set": xm_cpus_set,
+ "vcpu-pin": xm_vcpu_pin,
# "cpus-list": xm_cpus_list,
"vcpu-enable": xm_vcpu_enable,
"vcpu-disable": xm_vcpu_disable,
@@ -631,17 +636,19 @@ commands = {
"info": xm_info,
"log": xm_log,
# scheduler
- "bvt": xm_bvt,
- "bvt_ctxallow": xm_bvt_ctxallow,
- "sedf": xm_sedf,
+ "sched-bvt": xm_sched_bvt,
+ "sched-bvt-ctxallow": xm_sched_bvt_ctxallow,
+ "sched-sedf": xm_sched_sedf,
# block
- "block-create": xm_block_create,
- "block-destroy": xm_block_destroy,
+ "block-attach": xm_block_attach,
+ "block-detach": xm_block_detach,
"block-list": xm_block_list,
"block-refresh": xm_block_refresh,
# network
"network-limit": xm_network_limit,
"network-list": xm_network_list,
+ "network-attach": xm_network_attach,
+ "network-detach": xm_network_detach,
# vnet
"vnet-list": xm_vnet_list,
"vnet-create": xm_vnet_create,
@@ -719,8 +726,6 @@ def main(argv=sys.argv):
sys.exit(1)
except XendError, ex:
if len(args) > 0:
- if args[0] == "bogus":
- args.remove("bogus")
handle_xend_error(argv[1], args[0], ex)
else:
print "Unexpected error:", sys.exc_info()[0]
diff --git a/tools/xenstore/testsuite/16block-watch-crash.test b/tools/xenstore/testsuite/16block-watch-crash.test
new file mode 100644
index 0000000000..564f6d31ed
--- /dev/null
+++ b/tools/xenstore/testsuite/16block-watch-crash.test
@@ -0,0 +1,13 @@
+# Test case where blocked connection gets sent watch.
+
+mkdir /test
+watch /test token
+1 start /test
+# This will block on above
+noackwrite /test/entry create contents
+1 write /test/entry2 create contents
+1 commit
+readack
+expect /test/entry2:token
+waitwatch
+ackwatch token
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index bce4d17e8d..564b7dce38 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -50,7 +50,6 @@
#include "xenstored_transaction.h"
#include "xenstored_domain.h"
#include "xenctrl.h"
-#include "xen/io/domain_controller.h"
static bool verbose;
LIST_HEAD(connections);
diff --git a/tools/xenstore/xenstored_watch.c b/tools/xenstore/xenstored_watch.c
index e40318ee2f..a543f8a495 100644
--- a/tools/xenstore/xenstored_watch.c
+++ b/tools/xenstore/xenstored_watch.c
@@ -144,7 +144,7 @@ void fire_watches(struct connection *conn, const char *node, bool recurse)
else
continue;
/* If connection not doing anything, queue this. */
- if (!i->out)
+ if (i->state == OK)
queue_next_event(i);
}
}
diff --git a/tools/xenstore/xs_test.c b/tools/xenstore/xs_test.c
index 58445b9f25..6f4d0d5bc4 100644
--- a/tools/xenstore/xs_test.c
+++ b/tools/xenstore/xs_test.c
@@ -398,12 +398,16 @@ static void do_noackwrite(unsigned int handle,
static void do_readack(unsigned int handle)
{
enum xsd_sockmsg_type type;
- char *ret;
-
- ret = read_reply(handles[handle]->fd, &type, NULL);
- if (!ret)
- failed(handle);
- free(ret);
+ char *ret = NULL;
+
+ /* Watches can have fired before reply comes: daemon detects
+ * and re-transmits, so we can ignore this. */
+ do {
+ free(ret);
+ ret = read_reply(handles[handle]->fd, &type, NULL);
+ if (!ret)
+ failed(handle);
+ } while (type == XS_WATCH_EVENT);
}
static void do_setid(unsigned int handle, char *id)
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 1bb0e7ba8c..c0887f960c 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -1659,7 +1659,7 @@ int do_mmuext_op(
{
struct mmuext_op op;
int rc = 0, i = 0, okay, cpu = smp_processor_id();
- unsigned long type, done = 0;
+ unsigned long mfn, type, done = 0;
struct pfn_info *page;
struct vcpu *v = current;
struct domain *d = v->domain, *e;
@@ -1706,7 +1706,8 @@ int do_mmuext_op(
}
okay = 1;
- page = &frame_table[op.mfn];
+ mfn = op.arg1.mfn;
+ page = &frame_table[mfn];
switch ( op.cmd )
{
@@ -1717,17 +1718,17 @@ int do_mmuext_op(
if ( shadow_mode_refcounts(FOREIGNDOM) )
type = PGT_writable_page;
- okay = get_page_and_type_from_pagenr(op.mfn, type, FOREIGNDOM);
+ okay = get_page_and_type_from_pagenr(mfn, type, FOREIGNDOM);
if ( unlikely(!okay) )
{
- MEM_LOG("Error while pinning mfn %lx", op.mfn);
+ MEM_LOG("Error while pinning mfn %lx", mfn);
break;
}
if ( unlikely(test_and_set_bit(_PGT_pinned,
&page->u.inuse.type_info)) )
{
- MEM_LOG("Mfn %lx already pinned", op.mfn);
+ MEM_LOG("Mfn %lx already pinned", mfn);
put_page_and_type(page);
okay = 0;
break;
@@ -1750,10 +1751,10 @@ int do_mmuext_op(
goto pin_page;
case MMUEXT_UNPIN_TABLE:
- if ( unlikely(!(okay = get_page_from_pagenr(op.mfn, FOREIGNDOM))) )
+ if ( unlikely(!(okay = get_page_from_pagenr(mfn, FOREIGNDOM))) )
{
MEM_LOG("Mfn %lx bad domain (dom=%p)",
- op.mfn, page_get_owner(page));
+ mfn, page_get_owner(page));
}
else if ( likely(test_and_clear_bit(_PGT_pinned,
&page->u.inuse.type_info)) )
@@ -1765,28 +1766,28 @@ int do_mmuext_op(
{
okay = 0;
put_page(page);
- MEM_LOG("Mfn %lx not pinned", op.mfn);
+ MEM_LOG("Mfn %lx not pinned", mfn);
}
break;
case MMUEXT_NEW_BASEPTR:
- okay = new_guest_cr3(op.mfn);
+ okay = new_guest_cr3(mfn);
percpu_info[cpu].deferred_ops &= ~DOP_FLUSH_TLB;
break;
#ifdef __x86_64__
case MMUEXT_NEW_USER_BASEPTR:
okay = get_page_and_type_from_pagenr(
- op.mfn, PGT_root_page_table, d);
+ mfn, PGT_root_page_table, d);
if ( unlikely(!okay) )
{
- MEM_LOG("Error while installing new mfn %lx", op.mfn);
+ MEM_LOG("Error while installing new mfn %lx", mfn);
}
else
{
unsigned long old_mfn =
pagetable_get_pfn(v->arch.guest_table_user);
- v->arch.guest_table_user = mk_pagetable(op.mfn << PAGE_SHIFT);
+ v->arch.guest_table_user = mk_pagetable(mfn << PAGE_SHIFT);
if ( old_mfn != 0 )
put_page_and_type(&frame_table[old_mfn]);
}
@@ -1799,8 +1800,8 @@ int do_mmuext_op(
case MMUEXT_INVLPG_LOCAL:
if ( shadow_mode_enabled(d) )
- shadow_invlpg(v, op.linear_addr);
- local_flush_tlb_one(op.linear_addr);
+ shadow_invlpg(v, op.arg1.linear_addr);
+ local_flush_tlb_one(op.arg1.linear_addr);
break;
case MMUEXT_TLB_FLUSH_MULTI:
@@ -1808,7 +1809,7 @@ int do_mmuext_op(
{
unsigned long vmask;
cpumask_t pmask;
- if ( unlikely(get_user(vmask, (unsigned long *)op.vcpumask)) )
+ if ( unlikely(get_user(vmask, (unsigned long *)op.arg2.vcpumask)) )
{
okay = 0;
break;
@@ -1818,7 +1819,7 @@ int do_mmuext_op(
if ( op.cmd == MMUEXT_TLB_FLUSH_MULTI )
flush_tlb_mask(pmask);
else
- flush_tlb_one_mask(pmask, op.linear_addr);
+ flush_tlb_one_mask(pmask, op.arg1.linear_addr);
break;
}
@@ -1827,7 +1828,7 @@ int do_mmuext_op(
break;
case MMUEXT_INVLPG_ALL:
- flush_tlb_one_mask(d->cpumask, op.linear_addr);
+ flush_tlb_one_mask(d->cpumask, op.arg1.linear_addr);
break;
case MMUEXT_FLUSH_CACHE:
@@ -1852,8 +1853,8 @@ int do_mmuext_op(
break;
}
- unsigned long ptr = op.linear_addr;
- unsigned long ents = op.nr_ents;
+ unsigned long ptr = op.arg1.linear_addr;
+ unsigned long ents = op.arg2.nr_ents;
if ( ((ptr & (PAGE_SIZE-1)) != 0) ||
(ents > 8192) ||
!array_access_ok(ptr, ents, LDT_ENTRY_SIZE) )
@@ -1886,7 +1887,7 @@ int do_mmuext_op(
e = percpu_info[cpu].foreign;
if ( unlikely(e == NULL) )
{
- MEM_LOG("No FOREIGNDOM to reassign mfn %lx to", op.mfn);
+ MEM_LOG("No FOREIGNDOM to reassign mfn %lx to", mfn);
okay = 0;
break;
}
@@ -1919,7 +1920,7 @@ int do_mmuext_op(
{
MEM_LOG("Transferee has no reservation headroom (%d,%d), or "
"page is in Xen heap (%lx), or dom is dying (%ld).",
- e->tot_pages, e->max_pages, op.mfn, e->domain_flags);
+ e->tot_pages, e->max_pages, mfn, e->domain_flags);
okay = 0;
goto reassign_fail;
}
diff --git a/xen/arch/x86/vmx.c b/xen/arch/x86/vmx.c
index 62e36d9cf0..c6705b15f0 100644
--- a/xen/arch/x86/vmx.c
+++ b/xen/arch/x86/vmx.c
@@ -1021,7 +1021,7 @@ static int vmx_set_cr0(unsigned long value)
* CR0: We don't want to lose PE and PG.
*/
paging_enabled = vmx_paging_enabled(d);
- __vmwrite(GUEST_CR0, (value | X86_CR0_PE | X86_CR0_PG));
+ __vmwrite(GUEST_CR0, value | X86_CR0_PE | X86_CR0_PG | X86_CR0_NE);
__vmwrite(CR0_READ_SHADOW, value);
VMX_DBG_LOG(DBG_LEVEL_VMMU, "Update CR0 value = %lx\n", value);
diff --git a/xen/arch/x86/vmx_intercept.c b/xen/arch/x86/vmx_intercept.c
index b329254b36..1f1494c425 100644
--- a/xen/arch/x86/vmx_intercept.c
+++ b/xen/arch/x86/vmx_intercept.c
@@ -227,6 +227,7 @@ void vmx_hooks_assist(struct vcpu *d)
u64 *intr = &(sp->sp_global.pic_intr[0]);
struct vmx_virpit_t *vpit = &(d->domain->arch.vmx_platform.vmx_pit);
int rw_mode, reinit = 0;
+ int oldvec = 0;
/* load init count*/
if (p->state == STATE_IORESP_HOOK) {
@@ -235,6 +236,7 @@ void vmx_hooks_assist(struct vcpu *d)
VMX_DBG_LOG(DBG_LEVEL_1, "VMX_PIT: guest reset PIT with channel %lx!\n", (unsigned long) ((p->u.data >> 24) & 0x3) );
rem_ac_timer(&(vpit->pit_timer));
reinit = 1;
+ oldvec = vpit->vector;
}
else
init_ac_timer(&vpit->pit_timer, pit_timer_fn, vpit, d->processor);
@@ -250,6 +252,12 @@ void vmx_hooks_assist(struct vcpu *d)
vpit->period = 1000000;
}
vpit->vector = ((p->u.data >> 16) & 0xFF);
+
+ if( reinit && oldvec != vpit->vector){
+ clear_bit(oldvec, intr);
+ vpit->pending_intr_nr = 0;
+ }
+
vpit->channel = ((p->u.data >> 24) & 0x3);
vpit->first_injected = 0;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index ff9373d60f..77e0055e8c 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -211,11 +211,12 @@ void vcpu_sleep_sync(struct vcpu *v)
/*
* We can be sure that the VCPU is finally descheduled after the running
- * flag is cleared and the scheduler lock is released.
+ * flag is cleared and the scheduler lock is released. We also check that
+ * the domain continues to be unrunnable, in case someone else wakes it.
*/
- while ( test_bit(_VCPUF_running, &v->vcpu_flags)
- && !domain_runnable(v)
- && spin_is_locked(&schedule_data[v->processor].schedule_lock) )
+ while ( !domain_runnable(v) &&
+ (test_bit(_VCPUF_running, &v->vcpu_flags) ||
+ spin_is_locked(&schedule_data[v->processor].schedule_lock)) )
cpu_relax();
sync_vcpu_execstate(v);
diff --git a/xen/include/public/arch-x86_64.h b/xen/include/public/arch-x86_64.h
index 3cb8a2a785..04eae96852 100644
--- a/xen/include/public/arch-x86_64.h
+++ b/xen/include/public/arch-x86_64.h
@@ -124,30 +124,38 @@ typedef struct trap_info {
unsigned long address; /* code offset */
} trap_info_t;
+#ifdef __GNUC__
+/* Anonymous union includes both 32- and 64-bit names (e.g., eax/rax). */
+#define __DECL_REG(name) union { u64 r ## name, e ## name; }
+#else
+/* Non-gcc sources must always use the proper 64-bit name (e.g., rax). */
+#define __DECL_REG(name) u64 r ## name
+#endif
+
typedef struct cpu_user_regs {
u64 r15;
u64 r14;
u64 r13;
u64 r12;
- union { u64 rbp, ebp; };
- union { u64 rbx, ebx; };
+ __DECL_REG(bp);
+ __DECL_REG(bx);
u64 r11;
u64 r10;
u64 r9;
u64 r8;
- union { u64 rax, eax; };
- union { u64 rcx, ecx; };
- union { u64 rdx, edx; };
- union { u64 rsi, esi; };
- union { u64 rdi, edi; };
+ __DECL_REG(ax);
+ __DECL_REG(cx);
+ __DECL_REG(dx);
+ __DECL_REG(si);
+ __DECL_REG(di);
u32 error_code; /* private */
u32 entry_vector; /* private */
- union { u64 rip, eip; };
+ __DECL_REG(ip);
u16 cs, _pad0[1];
u8 saved_upcall_mask;
u8 _pad1[3];
- union { u64 rflags, eflags; };
- union { u64 rsp, esp; };
+ __DECL_REG(flags);
+ __DECL_REG(sp);
u16 ss, _pad2[3];
u16 es, _pad3[3];
u16 ds, _pad4[3];
@@ -155,6 +163,8 @@ typedef struct cpu_user_regs {
u16 gs, _pad6[3]; /* Non-zero => takes precedence over gs_base_user. */
} cpu_user_regs_t;
+#undef __DECL_REG
+
typedef u64 tsc_timestamp_t; /* RDTSC timestamp */
/*
diff --git a/xen/include/public/io/domain_controller.h b/xen/include/public/io/domain_controller.h
deleted file mode 100644
index c681af8d05..0000000000
--- a/xen/include/public/io/domain_controller.h
+++ /dev/null
@@ -1,787 +0,0 @@
-/******************************************************************************
- * domain_controller.h
- *
- * Interface to server controller (e.g., 'xend'). This header file defines the
- * interface that is shared with guest OSes.
- *
- * Copyright (c) 2004, K A Fraser
- */
-
-#ifndef __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__
-#define __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__
-
-#include "ring.h"
-
-/*
- * CONTROLLER MESSAGING INTERFACE.
- */
-
-typedef struct control_msg {
- u8 type; /* 0: echoed in response */
- u8 subtype; /* 1: echoed in response */
- u8 id; /* 2: echoed in response */
- u8 length; /* 3: number of bytes in 'msg' */
- u8 msg[60]; /* 4: type-specific message data */
-} control_msg_t; /* 64 bytes */
-
-/* These are used by the control message deferred ring. */
-#define CONTROL_RING_SIZE 8
-typedef u32 CONTROL_RING_IDX;
-#define MASK_CONTROL_IDX(_i) ((_i)&(CONTROL_RING_SIZE-1))
-
-/*
- * Generate control ring structures and types.
- *
- * CONTROL_RING_MEM is currently an 8-slot ring of ctrl_msg_t structs and
- * two 32-bit counters: (64 * 8) + (2 * 4) = 520
- */
-#define CONTROL_RING_MEM 520
-DEFINE_RING_TYPES(ctrl, control_msg_t, control_msg_t);
-
-typedef struct control_if {
- union {
- ctrl_sring_t tx_ring; /* guest -> controller */
- char __x[CONTROL_RING_MEM];
- };
- union {
- ctrl_sring_t rx_ring; /* controller -> guest */
- char __y[CONTROL_RING_MEM];
- };
-} control_if_t;
-
-/*
- * Top-level command types.
- */
-#define CMSG_CONSOLE 0 /* Console */
-#define CMSG_BLKIF_BE 1 /* Block-device backend */
-#define CMSG_BLKIF_FE 2 /* Block-device frontend */
-#define CMSG_NETIF_BE 3 /* Network-device backend */
-#define CMSG_NETIF_FE 4 /* Network-device frontend */
-#define CMSG_SHUTDOWN 6 /* Shutdown messages */
-#define CMSG_MEM_REQUEST 7 /* Memory reservation reqs */
-#define CMSG_USBIF_BE 8 /* USB controller backend */
-#define CMSG_USBIF_FE 9 /* USB controller frontend */
-#define CMSG_VCPU_HOTPLUG 10 /* Hotplug VCPU messages */
-#define CMSG_DEBUG 11 /* PDB backend */
-
-/******************************************************************************
- * CONSOLE DEFINITIONS
- */
-
-/*
- * Subtypes for console messages.
- */
-#define CMSG_CONSOLE_DATA 0
-
-
-/******************************************************************************
- * BLOCK-INTERFACE FRONTEND DEFINITIONS
- */
-
-/* Messages from domain controller to guest. */
-#define CMSG_BLKIF_FE_INTERFACE_STATUS 0
-
-/* Messages from guest to domain controller. */
-#define CMSG_BLKIF_FE_DRIVER_STATUS 32
-#define CMSG_BLKIF_FE_INTERFACE_CONNECT 33
-#define CMSG_BLKIF_FE_INTERFACE_DISCONNECT 34
-#define CMSG_BLKIF_FE_INTERFACE_QUERY 35
-
-#ifndef blkif_vdev_t
-#define blkif_vdev_t u16
-#endif
-#define blkif_pdev_t u32
-
-/*
- * CMSG_BLKIF_FE_INTERFACE_STATUS:
- * Notify a guest about a status change on one of its block interfaces.
- * If the interface is DESTROYED or DOWN then the interface is disconnected:
- * 1. The shared-memory frame is available for reuse.
- * 2. Any unacknowledged messages pending on the interface were dropped.
- */
-#define BLKIF_INTERFACE_STATUS_CLOSED 0 /* Interface doesn't exist. */
-#define BLKIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
-#define BLKIF_INTERFACE_STATUS_CONNECTED 2 /* Exists and is connected. */
-#define BLKIF_INTERFACE_STATUS_CHANGED 3 /* A device has been added or removed. */
-typedef struct blkif_fe_interface_status {
- u32 handle;
- u32 status;
- u16 evtchn; /* (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
- domid_t domid; /* status != BLKIF_INTERFACE_STATUS_DESTROYED */
-} blkif_fe_interface_status_t;
-
-/*
- * CMSG_BLKIF_FE_DRIVER_STATUS:
- * Notify the domain controller that the front-end driver is DOWN or UP.
- * When the driver goes DOWN then the controller will send no more
- * status-change notifications.
- * If the driver goes DOWN while interfaces are still UP, the domain
- * will automatically take the interfaces DOWN.
- *
- * NB. The controller should not send an INTERFACE_STATUS_CHANGED message
- * for interfaces that are active when it receives an UP notification. We
- * expect that the frontend driver will query those interfaces itself.
- */
-#define BLKIF_DRIVER_STATUS_DOWN 0
-#define BLKIF_DRIVER_STATUS_UP 1
-typedef struct blkif_fe_driver_status {
- /* IN */
- u32 status; /* BLKIF_DRIVER_STATUS_??? */
- /* OUT */
- /* Driver should query interfaces [0..max_handle]. */
- u32 max_handle;
-} blkif_fe_driver_status_t;
-
-/*
- * CMSG_BLKIF_FE_INTERFACE_CONNECT:
- * If successful, the domain controller will acknowledge with a
- * STATUS_CONNECTED message.
- */
-typedef struct blkif_fe_interface_connect {
- u32 handle;
- unsigned long shmem_frame;
- int shmem_ref;
-} blkif_fe_interface_connect_t;
-
-/*
- * CMSG_BLKIF_FE_INTERFACE_DISCONNECT:
- * If successful, the domain controller will acknowledge with a
- * STATUS_DISCONNECTED message.
- */
-typedef struct blkif_fe_interface_disconnect {
- u32 handle;
-} blkif_fe_interface_disconnect_t;
-
-/*
- * CMSG_BLKIF_FE_INTERFACE_QUERY:
- */
-typedef struct blkif_fe_interface_query {
- /* IN */
- u32 handle;
- /* OUT */
- u32 status;
- u16 evtchn; /* (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
- domid_t domid; /* status != BLKIF_INTERFACE_STATUS_DESTROYED */
-} blkif_fe_interface_query_t;
-
-
-/******************************************************************************
- * BLOCK-INTERFACE BACKEND DEFINITIONS
- */
-
-/* Messages from domain controller. */
-#define CMSG_BLKIF_BE_CREATE 0 /* Create a new block-device interface. */
-#define CMSG_BLKIF_BE_DESTROY 1 /* Destroy a block-device interface. */
-#define CMSG_BLKIF_BE_CONNECT 2 /* Connect i/f to remote driver. */
-#define CMSG_BLKIF_BE_DISCONNECT 3 /* Disconnect i/f from remote driver. */
-#define CMSG_BLKIF_BE_VBD_CREATE 4 /* Create a new VBD for an interface. */
-#define CMSG_BLKIF_BE_VBD_DESTROY 5 /* Delete a VBD from an interface. */
-
-/* Messages to domain controller. */
-#define CMSG_BLKIF_BE_DRIVER_STATUS 32
-
-/*
- * Message request/response definitions for block-device messages.
- */
-
-/* Non-specific 'okay' return. */
-#define BLKIF_BE_STATUS_OKAY 0
-/* Non-specific 'error' return. */
-#define BLKIF_BE_STATUS_ERROR 1
-/* The following are specific error returns. */
-#define BLKIF_BE_STATUS_INTERFACE_EXISTS 2
-#define BLKIF_BE_STATUS_INTERFACE_NOT_FOUND 3
-#define BLKIF_BE_STATUS_INTERFACE_CONNECTED 4
-#define BLKIF_BE_STATUS_VBD_EXISTS 5
-#define BLKIF_BE_STATUS_VBD_NOT_FOUND 6
-#define BLKIF_BE_STATUS_OUT_OF_MEMORY 7
-#define BLKIF_BE_STATUS_PHYSDEV_NOT_FOUND 8
-#define BLKIF_BE_STATUS_MAPPING_ERROR 9
-
-/* This macro can be used to create an array of descriptive error strings. */
-#define BLKIF_BE_STATUS_ERRORS { \
- "Okay", \
- "Non-specific error", \
- "Interface already exists", \
- "Interface not found", \
- "Interface is still connected", \
- "VBD already exists", \
- "VBD not found", \
- "Out of memory", \
- "Extent not found for VBD", \
- "Could not map domain memory" }
-
-/*
- * CMSG_BLKIF_BE_CREATE:
- * When the driver sends a successful response then the interface is fully
- * created. The controller will send a DOWN notification to the front-end
- * driver.
- */
-typedef struct blkif_be_create {
- /* IN */
- domid_t domid; /* Domain attached to new interface. */
- u32 blkif_handle; /* Domain-specific interface handle. */
- /* OUT */
- u32 status;
-} blkif_be_create_t;
-
-/*
- * CMSG_BLKIF_BE_DESTROY:
- * When the driver sends a successful response then the interface is fully
- * torn down. The controller will send a DESTROYED notification to the
- * front-end driver.
- */
-typedef struct blkif_be_destroy {
- /* IN */
- domid_t domid; /* Identify interface to be destroyed. */
- u32 blkif_handle; /* ...ditto... */
- /* OUT */
- u32 status;
-} blkif_be_destroy_t;
-
-/*
- * CMSG_BLKIF_BE_CONNECT:
- * When the driver sends a successful response then the interface is fully
- * connected. The controller will send a CONNECTED notification to the
- * front-end driver.
- */
-typedef struct blkif_be_connect {
- /* IN */
- domid_t domid; /* Domain attached to new interface. */
- u32 blkif_handle; /* Domain-specific interface handle. */
- unsigned long shmem_frame;/* Page cont. shared comms window. */
- int shmem_ref; /* Grant table reference. */
- u32 evtchn; /* Event channel for notifications. */
- /* OUT */
- u32 status;
-} blkif_be_connect_t;
-
-/*
- * CMSG_BLKIF_BE_DISCONNECT:
- * When the driver sends a successful response then the interface is fully
- * disconnected. The controller will send a DOWN notification to the front-end
- * driver.
- */
-typedef struct blkif_be_disconnect {
- /* IN */
- domid_t domid; /* Domain attached to new interface. */
- u32 blkif_handle; /* Domain-specific interface handle. */
- /* OUT */
- u32 status;
-} blkif_be_disconnect_t;
-
-/* CMSG_BLKIF_BE_VBD_CREATE */
-typedef struct blkif_be_vbd_create {
- /* IN */
- domid_t domid; /* Identify blkdev interface. */
- u32 blkif_handle; /* ...ditto... */
- blkif_pdev_t pdevice;
- u32 dev_handle; /* Extended device id field. */
- blkif_vdev_t vdevice; /* Interface-specific id for this VBD. */
- u16 readonly; /* Non-zero -> VBD isn't writable. */
- /* OUT */
- u32 status;
-} blkif_be_vbd_create_t;
-
-/* CMSG_BLKIF_BE_VBD_DESTROY */
-typedef struct blkif_be_vbd_destroy {
- /* IN */
- domid_t domid; /* Identify blkdev interface. */
- u32 blkif_handle; /* ...ditto... */
- blkif_vdev_t vdevice; /* Interface-specific id of the VBD. */
- /* OUT */
- u32 status;
-} blkif_be_vbd_destroy_t;
-
-/*
- * CMSG_BLKIF_BE_DRIVER_STATUS:
- * Notify the domain controller that the back-end driver is DOWN or UP.
- * If the driver goes DOWN while interfaces are still UP, the controller
- * will automatically send DOWN notifications.
- */
-typedef struct blkif_be_driver_status {
- u32 status; /* BLKIF_DRIVER_STATUS_??? */
-} blkif_be_driver_status_t;
-
-
-/******************************************************************************
- * NETWORK-INTERFACE FRONTEND DEFINITIONS
- */
-
-/* Messages from domain controller to guest. */
-#define CMSG_NETIF_FE_INTERFACE_STATUS 0
-
-/* Messages from guest to domain controller. */
-#define CMSG_NETIF_FE_DRIVER_STATUS 32
-#define CMSG_NETIF_FE_INTERFACE_CONNECT 33
-#define CMSG_NETIF_FE_INTERFACE_DISCONNECT 34
-#define CMSG_NETIF_FE_INTERFACE_QUERY 35
-
-/*
- * CMSG_NETIF_FE_INTERFACE_STATUS:
- * Notify a guest about a status change on one of its network interfaces.
- * If the interface is CLOSED or DOWN then the interface is disconnected:
- * 1. The shared-memory frame is available for reuse.
- * 2. Any unacknowledged messgaes pending on the interface were dropped.
- */
-#define NETIF_INTERFACE_STATUS_CLOSED 0 /* Interface doesn't exist. */
-#define NETIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
-#define NETIF_INTERFACE_STATUS_CONNECTED 2 /* Exists and is connected. */
-#define NETIF_INTERFACE_STATUS_CHANGED 3 /* A device has been added or removed. */
-typedef struct netif_fe_interface_status {
- u32 handle;
- u32 status;
- u16 evtchn; /* status == NETIF_INTERFACE_STATUS_CONNECTED */
- u8 mac[6]; /* status == NETIF_INTERFACE_STATUS_CONNECTED */
- domid_t domid; /* status != NETIF_INTERFACE_STATUS_DESTROYED */
-} netif_fe_interface_status_t;
-
-/*
- * CMSG_NETIF_FE_DRIVER_STATUS:
- * Notify the domain controller that the front-end driver is DOWN or UP.
- * When the driver goes DOWN then the controller will send no more
- * status-change notifications.
- * If the driver goes DOWN while interfaces are still UP, the domain
- * will automatically take the interfaces DOWN.
- *
- * NB. The controller should not send an INTERFACE_STATUS message
- * for interfaces that are active when it receives an UP notification. We
- * expect that the frontend driver will query those interfaces itself.
- */
-#define NETIF_DRIVER_STATUS_DOWN 0
-#define NETIF_DRIVER_STATUS_UP 1
-typedef struct netif_fe_driver_status {
- /* IN */
- u32 status; /* NETIF_DRIVER_STATUS_??? */
- /* OUT */
- /* Driver should query interfaces [0..max_handle]. */
- u32 max_handle;
-} netif_fe_driver_status_t;
-
-/*
- * CMSG_NETIF_FE_INTERFACE_CONNECT:
- * If successful, the domain controller will acknowledge with a
- * STATUS_CONNECTED message.
- */
-typedef struct netif_fe_interface_connect {
- u32 handle;
- unsigned long tx_shmem_frame;
- int tx_shmem_ref;
- unsigned long rx_shmem_frame;
- int rx_shmem_ref;
-} netif_fe_interface_connect_t;
-
-/*
- * CMSG_NETIF_FE_INTERFACE_DISCONNECT:
- * If successful, the domain controller will acknowledge with a
- * STATUS_DISCONNECTED message.
- */
-typedef struct netif_fe_interface_disconnect {
- u32 handle;
-} netif_fe_interface_disconnect_t;
-
-/*
- * CMSG_NETIF_FE_INTERFACE_QUERY:
- */
-typedef struct netif_fe_interface_query {
- /* IN */
- u32 handle;
- /* OUT */
- u32 status;
- u16 evtchn; /* status == NETIF_INTERFACE_STATUS_CONNECTED */
- u8 mac[6]; /* status == NETIF_INTERFACE_STATUS_CONNECTED */
- domid_t domid; /* status != NETIF_INTERFACE_STATUS_DESTROYED */
-} netif_fe_interface_query_t;
-
-
-/******************************************************************************
- * NETWORK-INTERFACE BACKEND DEFINITIONS
- */
-
-/* Messages from domain controller. */
-#define CMSG_NETIF_BE_CREATE 0 /* Create a new net-device interface. */
-#define CMSG_NETIF_BE_DESTROY 1 /* Destroy a net-device interface. */
-#define CMSG_NETIF_BE_CONNECT 2 /* Connect i/f to remote driver. */
-#define CMSG_NETIF_BE_DISCONNECT 3 /* Disconnect i/f from remote driver. */
-#define CMSG_NETIF_BE_CREDITLIMIT 4 /* Limit i/f to a given credit limit. */
-
-/* Messages to domain controller. */
-#define CMSG_NETIF_BE_DRIVER_STATUS 32
-
-/*
- * Message request/response definitions for net-device messages.
- */
-
-/* Non-specific 'okay' return. */
-#define NETIF_BE_STATUS_OKAY 0
-/* Non-specific 'error' return. */
-#define NETIF_BE_STATUS_ERROR 1
-/* The following are specific error returns. */
-#define NETIF_BE_STATUS_INTERFACE_EXISTS 2
-#define NETIF_BE_STATUS_INTERFACE_NOT_FOUND 3
-#define NETIF_BE_STATUS_INTERFACE_CONNECTED 4
-#define NETIF_BE_STATUS_OUT_OF_MEMORY 5
-#define NETIF_BE_STATUS_MAPPING_ERROR 6
-
-/* This macro can be used to create an array of descriptive error strings. */
-#define NETIF_BE_STATUS_ERRORS { \
- "Okay", \
- "Non-specific error", \
- "Interface already exists", \
- "Interface not found", \
- "Interface is still connected", \
- "Out of memory", \
- "Could not map domain memory" }
-
-/*
- * CMSG_NETIF_BE_CREATE:
- * When the driver sends a successful response then the interface is fully
- * created. The controller will send a DOWN notification to the front-end
- * driver.
- */
-typedef struct netif_be_create {
- /* IN */
- domid_t domid; /* Domain attached to new interface. */
- u32 netif_handle; /* Domain-specific interface handle. */
- u8 mac[6];
- u8 be_mac[6];
- /* OUT */
- u32 status;
-} netif_be_create_t;
-
-/*
- * CMSG_NETIF_BE_DESTROY:
- * When the driver sends a successful response then the interface is fully
- * torn down. The controller will send a DESTROYED notification to the
- * front-end driver.
- */
-typedef struct netif_be_destroy {
- /* IN */
- domid_t domid; /* Identify interface to be destroyed. */
- u32 netif_handle; /* ...ditto... */
- /* OUT */
- u32 status;
-} netif_be_destroy_t;
-
-/*
- * CMSG_NETIF_BE_CREDITLIMIT:
- * Limit a virtual interface to "credit_bytes" bytes per "period_usec"
- * microseconds.
- */
-typedef struct netif_be_creditlimit {
- /* IN */
- domid_t domid; /* Domain attached to new interface. */
- u32 netif_handle; /* Domain-specific interface handle. */
- u32 credit_bytes; /* Vifs credit of bytes per period. */
- u32 period_usec; /* Credit replenishment period. */
- /* OUT */
- u32 status;
-} netif_be_creditlimit_t;
-
-/*
- * CMSG_NETIF_BE_CONNECT:
- * When the driver sends a successful response then the interface is fully
- * connected. The controller will send a CONNECTED notification to the
- * front-end driver.
- */
-typedef struct netif_be_connect {
- /* IN */
- domid_t domid; /* Domain attached to new interface. */
- u32 netif_handle; /* Domain-specific interface handle. */
- unsigned long tx_shmem_frame;/* Page cont. tx shared comms window. */
- int tx_shmem_ref; /* Grant reference for above */
- unsigned long rx_shmem_frame;/* Page cont. rx shared comms window. */
- int rx_shmem_ref; /* Grant reference for above */
- u16 evtchn; /* Event channel for notifications. */
- /* OUT */
- u32 status;
-} netif_be_connect_t;
-
-/*
- * CMSG_NETIF_BE_DISCONNECT:
- * When the driver sends a successful response then the interface is fully
- * disconnected. The controller will send a DOWN notification to the front-end
- * driver.
- */
-typedef struct netif_be_disconnect {
- /* IN */
- domid_t domid; /* Domain attached to new interface. */
- u32 netif_handle; /* Domain-specific interface handle. */
- /* OUT */
- u32 status;
-} netif_be_disconnect_t;
-
-/*
- * CMSG_NETIF_BE_DRIVER_STATUS:
- * Notify the domain controller that the back-end driver is DOWN or UP.
- * If the driver goes DOWN while interfaces are still UP, the domain
- * will automatically send DOWN notifications.
- */
-typedef struct netif_be_driver_status {
- u32 status; /* NETIF_DRIVER_STATUS_??? */
-} netif_be_driver_status_t;
-
-
-
-/******************************************************************************
- * USB-INTERFACE FRONTEND DEFINITIONS
- */
-
-/* Messages from domain controller to guest. */
-#define CMSG_USBIF_FE_INTERFACE_STATUS_CHANGED 0
-
-/* Messages from guest to domain controller. */
-#define CMSG_USBIF_FE_DRIVER_STATUS_CHANGED 32
-#define CMSG_USBIF_FE_INTERFACE_CONNECT 33
-#define CMSG_USBIF_FE_INTERFACE_DISCONNECT 34
-/*
- * CMSG_USBIF_FE_INTERFACE_STATUS_CHANGED:
- * Notify a guest about a status change on one of its block interfaces.
- * If the interface is DESTROYED or DOWN then the interface is disconnected:
- * 1. The shared-memory frame is available for reuse.
- * 2. Any unacknowledged messages pending on the interface were dropped.
- */
-#define USBIF_INTERFACE_STATUS_DESTROYED 0 /* Interface doesn't exist. */
-#define USBIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
-#define USBIF_INTERFACE_STATUS_CONNECTED 2 /* Exists and is connected. */
-typedef struct usbif_fe_interface_status_changed {
- u32 status;
- u16 evtchn; /* (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
- domid_t domid; /* status != BLKIF_INTERFACE_STATUS_DESTROYED */
- u32 bandwidth;
- u32 num_ports;
-} usbif_fe_interface_status_changed_t;
-
-/*
- * CMSG_USBIF_FE_DRIVER_STATUS_CHANGED:
- * Notify the domain controller that the front-end driver is DOWN or UP.
- * When the driver goes DOWN then the controller will send no more
- * status-change notifications.
- * If the driver goes DOWN while interfaces are still UP, the domain
- * will automatically take the interfaces DOWN.
- *
- * NB. The controller should not send an INTERFACE_STATUS_CHANGED message
- * for interfaces that are active when it receives an UP notification. We
- * expect that the frontend driver will query those interfaces itself.
- */
-#define USBIF_DRIVER_STATUS_DOWN 0
-#define USBIF_DRIVER_STATUS_UP 1
-typedef struct usbif_fe_driver_status_changed {
- /* IN */
- u32 status; /* USBIF_DRIVER_STATUS_??? */
-} usbif_fe_driver_status_changed_t;
-
-/*
- * CMSG_USBIF_FE_INTERFACE_CONNECT:
- * If successful, the domain controller will acknowledge with a
- * STATUS_CONNECTED message.
- */
-typedef struct usbif_fe_interface_connect {
- unsigned long shmem_frame;
-} usbif_fe_interface_connect_t;
-
-/*
- * CMSG_USBIF_FE_INTERFACE_DISCONNECT:
- * If successful, the domain controller will acknowledge with a
- * STATUS_DISCONNECTED message.
- */
-typedef struct usbif_fe_interface_disconnect {
- int dummy; /* make struct non-empty */
-} usbif_fe_interface_disconnect_t;
-
-
-/******************************************************************************
- * USB-INTERFACE BACKEND DEFINITIONS
- */
-
-/* Messages from domain controller. */
-#define CMSG_USBIF_BE_CREATE 0 /* Create a new block-device interface. */
-#define CMSG_USBIF_BE_DESTROY 1 /* Destroy a block-device interface. */
-#define CMSG_USBIF_BE_CONNECT 2 /* Connect i/f to remote driver. */
-#define CMSG_USBIF_BE_DISCONNECT 3 /* Disconnect i/f from remote driver. */
-#define CMSG_USBIF_BE_CLAIM_PORT 4 /* Claim host port for a domain. */
-#define CMSG_USBIF_BE_RELEASE_PORT 5 /* Release host port. */
-/* Messages to domain controller. */
-#define CMSG_USBIF_BE_DRIVER_STATUS_CHANGED 32
-
-/* Non-specific 'okay' return. */
-#define USBIF_BE_STATUS_OKAY 0
-/* Non-specific 'error' return. */
-#define USBIF_BE_STATUS_ERROR 1
-/* The following are specific error returns. */
-#define USBIF_BE_STATUS_INTERFACE_EXISTS 2
-#define USBIF_BE_STATUS_INTERFACE_NOT_FOUND 3
-#define USBIF_BE_STATUS_INTERFACE_CONNECTED 4
-#define USBIF_BE_STATUS_OUT_OF_MEMORY 7
-#define USBIF_BE_STATUS_MAPPING_ERROR 9
-
-/* This macro can be used to create an array of descriptive error strings. */
-#define USBIF_BE_STATUS_ERRORS { \
- "Okay", \
- "Non-specific error", \
- "Interface already exists", \
- "Interface not found", \
- "Interface is still connected", \
- "Out of memory", \
- "Could not map domain memory" }
-
-/*
- * CMSG_USBIF_BE_CREATE:
- * When the driver sends a successful response then the interface is fully
- * created. The controller will send a DOWN notification to the front-end
- * driver.
- */
-typedef struct usbif_be_create {
- /* IN */
- domid_t domid; /* Domain attached to new interface. */
- /* OUT */
- u32 status;
-} usbif_be_create_t;
-
-/*
- * CMSG_USBIF_BE_DESTROY:
- * When the driver sends a successful response then the interface is fully
- * torn down. The controller will send a DESTROYED notification to the
- * front-end driver.
- */
-typedef struct usbif_be_destroy {
- /* IN */
- domid_t domid; /* Identify interface to be destroyed. */
- /* OUT */
- u32 status;
-} usbif_be_destroy_t;
-
-/*
- * CMSG_USBIF_BE_CONNECT:
- * When the driver sends a successful response then the interface is fully
- * connected. The controller will send a CONNECTED notification to the
- * front-end driver.
- */
-typedef struct usbif_be_connect {
- /* IN */
- domid_t domid; /* Domain attached to new interface. */
- unsigned long shmem_frame;/* Page cont. shared comms window. */
- u32 evtchn; /* Event channel for notifications. */
- u32 bandwidth; /* Bandwidth allocated for isoch / int - us
- * per 1ms frame (ie between 0 and 900 or 800
- * depending on USB version). */
- /* OUT */
- u32 status;
-} usbif_be_connect_t;
-
-/*
- * CMSG_USBIF_BE_DISCONNECT:
- * When the driver sends a successful response then the interface is fully
- * disconnected. The controller will send a DOWN notification to the front-end
- * driver.
- */
-typedef struct usbif_be_disconnect {
- /* IN */
- domid_t domid; /* Domain attached to new interface. */
- /* OUT */
- u32 status;
-} usbif_be_disconnect_t;
-
-/*
- * CMSG_USBIF_BE_DRIVER_STATUS_CHANGED:
- * Notify the domain controller that the back-end driver is DOWN or UP.
- * If the driver goes DOWN while interfaces are still UP, the controller
- * will automatically send DOWN notifications.
- */
-typedef struct usbif_be_driver_status_changed {
- u32 status; /* USBIF_DRIVER_STATUS_??? */
-} usbif_be_driver_status_changed_t;
-
-#define USB_PATH_LEN 16
-
-/*
- * CMSG_USBIF_BE_CLAIM_PORT:
- * Instruct the backend driver to claim any device plugged into the specified
- * host port and to allow the specified domain to control that port.
- */
-typedef struct usbif_be_claim_port {
- /* IN */
- domid_t domid; /* which domain */
- u32 usbif_port; /* port on the virtual root hub */
- u32 status; /* status of operation */
- char path[USB_PATH_LEN]; /* Currently specified in the Linux style - may need to be
- * converted to some OS-independent format at some stage. */
-} usbif_be_claim_port_t;
-
-/*
- * CMSG_USBIF_BE_RELEASE_PORT:
- * Instruct the backend driver to release any device plugged into the specified
- * host port.
- */
-typedef struct usbif_be_release_port {
- char path[USB_PATH_LEN];
-} usbif_be_release_port_t;
-
-/******************************************************************************
- * SHUTDOWN DEFINITIONS
- */
-
-/*
- * Subtypes for shutdown messages.
- */
-#define CMSG_SHUTDOWN_POWEROFF 0 /* Clean shutdown (SHUTDOWN_poweroff). */
-#define CMSG_SHUTDOWN_REBOOT 1 /* Clean shutdown (SHUTDOWN_reboot). */
-#define CMSG_SHUTDOWN_SUSPEND 2 /* Create suspend info, then */
- /* SHUTDOWN_suspend. */
-#define CMSG_SHUTDOWN_SYSRQ 3
-
-typedef struct shutdown_sysrq {
- char key; /* sysrq key */
-} shutdown_sysrq_t;
-
-/******************************************************************************
- * VCPU HOTPLUG CONTROLS
- */
-
-/*
- * Subtypes for shutdown messages.
- */
-#define CMSG_VCPU_HOTPLUG_OFF 0 /* turn vcpu off */
-#define CMSG_VCPU_HOTPLUG_ON 1 /* turn vcpu on */
-
-/*
- * CMSG_VCPU_HOTPLUG:
- * Indicate which vcpu's state should change
- */
-typedef struct vcpu_hotplug {
- u32 vcpu; /* VCPU's whose state will change */
- u32 status; /* Return code indicates success or failure. */
-} vcpu_hotplug_t;
-
-/******************************************************************************
- * MEMORY CONTROLS
- */
-
-#define CMSG_MEM_REQUEST_SET 0 /* Request a domain to set its mem footprint. */
-
-/*
- * CMSG_MEM_REQUEST:
- * Request that the domain change its memory reservation.
- */
-typedef struct mem_request {
- /* OUT */
- u32 target; /* Target memory reservation in pages. */
- /* IN */
- u32 status; /* Return code indicates success or failure. */
-} mem_request_t;
-
-
-/******************************************************************************
- * PDB INTERFACE DEFINITIONS
- */
-
-#define CMSG_DEBUG_CONNECTION_STATUS 0
-typedef struct pdb_Connection {
-#define PDB_CONNECTION_STATUS_UP 1
-#define PDB_CONNECTION_STATUS_DOWN 2
- u32 status;
- unsigned long ring; /* status: UP */
- u32 evtchn; /* status: UP */
-} pdb_connection_t, *pdb_connection_p;
-
-#endif /* __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__ */
diff --git a/xen/include/public/io/ring.h b/xen/include/public/io/ring.h
index 68970f0399..710aabfa2a 100644
--- a/xen/include/public/io/ring.h
+++ b/xen/include/public/io/ring.h
@@ -87,7 +87,7 @@ struct __name##_back_ring { \
/* Syntactic sugar */ \
typedef struct __name##_sring __name##_sring_t; \
typedef struct __name##_front_ring __name##_front_ring_t; \
-typedef struct __name##_back_ring __name##_back_ring_t;
+typedef struct __name##_back_ring __name##_back_ring_t
/*
* Macros for manipulating rings.
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index 7a6dc1bb37..d891566a4e 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -174,13 +174,13 @@ struct mmuext_op {
unsigned long mfn;
/* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */
unsigned long linear_addr;
- };
+ } arg1;
union {
/* SET_LDT */
unsigned int nr_ents;
/* TLB_FLUSH_MULTI, INVLPG_MULTI */
void *vcpumask;
- };
+ } arg2;
};
#endif