diff --git a/19614-x86-emul-lldt-ltr.patch b/19614-x86-emul-lldt-ltr.patch deleted file mode 100644 index bf7e8da..0000000 --- a/19614-x86-emul-lldt-ltr.patch +++ /dev/null @@ -1,106 +0,0 @@ -# HG changeset patch -# User Keir Fraser -# Date 1250693891 -3600 -# Node ID bea861fb0f20671d41e467557bfdffb67b42f5e7 -# Parent aa9f0b39c021f9c6e2c5cdb225564dd554a727f5 -x86_emulate: Emulate LLDT and LTR instructions. - -Signed-off-by: Keir Fraser -xen-unstable changeset: 19614:e421fd04e150 -xen-unstable date: Tue May 19 02:09:36 2009 +0100 - -Index: xen-3.4.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/x86_emulate/x86_emulate.c -+++ xen-3.4.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c -@@ -172,7 +172,7 @@ static uint8_t opcode_table[256] = { - - static uint8_t twobyte_table[256] = { - /* 0x00 - 0x07 */ -- 0, ImplicitOps|ModRM, 0, 0, 0, 0, ImplicitOps, 0, -+ SrcMem16|ModRM, ImplicitOps|ModRM, 0, 0, 0, 0, ImplicitOps, 0, - /* 0x08 - 0x0F */ - ImplicitOps, ImplicitOps, 0, 0, 0, ImplicitOps|ModRM, 0, 0, - /* 0x10 - 0x17 */ -@@ -971,8 +971,8 @@ protmode_load_seg( - struct { uint32_t a, b; } desc; - unsigned long val; - uint8_t dpl, rpl, cpl; -- uint32_t new_desc_b; -- int rc, fault_type = EXC_TS; -+ uint32_t new_desc_b, a_flag = 0x100; -+ int rc, fault_type = EXC_GP; - - /* NULL selector? */ - if ( (sel & 0xfffc) == 0 ) -@@ -983,8 +983,8 @@ protmode_load_seg( - return ops->write_segment(seg, &segr, ctxt); - } - -- /* LDT descriptor must be in the GDT. */ -- if ( (seg == x86_seg_ldtr) && (sel & 4) ) -+ /* System segment descriptors must reside in the GDT. */ -+ if ( !is_x86_user_segment(seg) && (sel & 4) ) - goto raise_exn; - - if ( (rc = ops->read_segment(x86_seg_ss, &ss, ctxt)) || -@@ -1013,8 +1013,8 @@ protmode_load_seg( - goto raise_exn; - } - -- /* LDT descriptor is a system segment. All others are code/data. */ -- if ( (desc.b & (1u<<12)) == ((seg == x86_seg_ldtr) << 12) ) -+ /* System segments must have the system flag (S) set. */ -+ if ( (desc.b & (1u<<12)) == (!is_x86_user_segment(seg) << 12) ) - goto raise_exn; - - dpl = (desc.b >> 13) & 3; -@@ -1043,6 +1043,12 @@ protmode_load_seg( - if ( (desc.b & (15u<<8)) != (2u<<8) ) - goto raise_exn; - goto skip_accessed_flag; -+ case x86_seg_tr: -+ /* Available TSS system segment? */ -+ if ( (desc.b & (15u<<8)) != (9u<<8) ) -+ goto raise_exn; -+ a_flag = 0x200; /* busy flag */ -+ break; - default: - /* Readable code or data segment? */ - if ( (desc.b & (5u<<9)) == (4u<<9) ) -@@ -1055,8 +1061,8 @@ protmode_load_seg( - } - - /* Ensure Accessed flag is set. */ -- new_desc_b = desc.b | 0x100; -- rc = ((desc.b & 0x100) ? X86EMUL_OKAY : -+ new_desc_b = desc.b | a_flag; -+ rc = ((desc.b & a_flag) ? X86EMUL_OKAY : - ops->cmpxchg( - x86_seg_none, desctab.base + (sel & 0xfff8) + 4, - &desc.b, &new_desc_b, 4, ctxt)); -@@ -1066,7 +1072,7 @@ protmode_load_seg( - return rc; - - /* Force the Accessed flag in our local copy. */ -- desc.b |= 0x100; -+ desc.b |= a_flag; - - skip_accessed_flag: - segr.base = (((desc.b << 0) & 0xff000000u) | -@@ -3440,6 +3446,15 @@ x86_emulate( - twobyte_insn: - switch ( b ) - { -+ case 0x00: /* Grp6 */ -+ fail_if((modrm_reg & 6) != 2); -+ generate_exception_if(!in_protmode(ctxt, ops), EXC_UD, -1); -+ generate_exception_if(!mode_ring0(), EXC_GP, 0); -+ if ( (rc = load_seg((modrm_reg & 1) ? x86_seg_tr : x86_seg_ldtr, -+ src.val, ctxt, ops)) != 0 ) -+ goto done; -+ break; -+ - case 0x01: /* Grp7 */ { - struct segment_register reg; - unsigned long base, limit, cr0, cr0w; diff --git a/20013-xend-memleak.patch b/20013-xend-memleak.patch deleted file mode 100644 index 1036da6..0000000 --- a/20013-xend-memleak.patch +++ /dev/null @@ -1,39 +0,0 @@ -# HG changeset patch -# User Keir Fraser -# Date 1249470279 -3600 -# Node ID e41d42ef4cd2968cd480063a3c82d91c38cb8c7d -# Parent 3242351f9c6766fe4fbc27d969b1b84a9926cbda -xend: fix memory leak resulting in long garbage collector runs - -In the method xen.xend.XendStateStore.XendStateStore.load_state and -xen.xend.XendStateStore.XendStateStore.save_state the minidom objects -used to load/save the current state of a device type, can't be freed -by the python garbage collector after all references to the top node -are cleared, because of cyclic references between the DOM nodes. So -memory usage of xend increases after calling these methods. To solve -this problem, the unlink() method must be called for a minidom object -before the last reference to the top node is cleared (see python -docs). This breaks the cyclic references, so the garbage collector can -free these objects. - -Signed-off-by: juergen.gross@ts.fujitsu.com - -Index: xen-3.4.1-testing/tools/python/xen/xend/XendStateStore.py -=================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendStateStore.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendStateStore.py -@@ -147,6 +147,7 @@ class XendStateStore: - cls_dict[val_name] = bool(int(val_text)) - state[uuid] = cls_dict - -+ dom.unlink() - return state - - def save_state(self, cls, state): -@@ -226,5 +227,5 @@ class XendStateStore: - node.appendChild(val_node) - - open(xml_path, 'w').write(doc.toprettyxml()) -- -+ doc.unlink() - diff --git a/20031-x86-pmode-load-seg-retry.patch b/20031-x86-pmode-load-seg-retry.patch deleted file mode 100644 index 4fa9cb8..0000000 --- a/20031-x86-pmode-load-seg-retry.patch +++ /dev/null @@ -1,161 +0,0 @@ -# HG changeset patch -# User Keir Fraser -# Date 1250693923 -3600 -# Node ID 44d852862374dff2e734070ac60399f6875f6cd5 -# Parent bea861fb0f20671d41e467557bfdffb67b42f5e7 -x86_emulate: Remove cmpxchg retry loop from protmode_load_seg(). - -It is safer to retry in a loop via the caller. - -Signed-off-by: Keir Fraser -xen-unstable changeset: 20031:34bdb5a29963 -xen-unstable date: Thu Aug 06 09:54:22 2009 +0100 - -Index: xen-3.4.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/x86_emulate/x86_emulate.c -+++ xen-3.4.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c -@@ -996,79 +996,75 @@ protmode_load_seg( - if ( ((sel & 0xfff8) + 7) > desctab.limit ) - goto raise_exn; - -- do { -- if ( (rc = read_ulong(x86_seg_none, desctab.base + (sel & 0xfff8), -- &val, 4, ctxt, ops)) ) -- return rc; -- desc.a = val; -- if ( (rc = read_ulong(x86_seg_none, desctab.base + (sel & 0xfff8) + 4, -- &val, 4, ctxt, ops)) ) -- return rc; -- desc.b = val; -+ if ( (rc = read_ulong(x86_seg_none, desctab.base + (sel & 0xfff8), -+ &val, 4, ctxt, ops)) ) -+ return rc; -+ desc.a = val; -+ if ( (rc = read_ulong(x86_seg_none, desctab.base + (sel & 0xfff8) + 4, -+ &val, 4, ctxt, ops)) ) -+ return rc; -+ desc.b = val; - -- /* Segment present in memory? */ -- if ( !(desc.b & (1u<<15)) ) -- { -- fault_type = EXC_NP; -- goto raise_exn; -- } -+ /* Segment present in memory? */ -+ if ( !(desc.b & (1u<<15)) ) -+ { -+ fault_type = EXC_NP; -+ goto raise_exn; -+ } - -- /* System segments must have the system flag (S) set. */ -- if ( (desc.b & (1u<<12)) == (!is_x86_user_segment(seg) << 12) ) -- goto raise_exn; -+ /* System segments must have the system flag (S) set. */ -+ if ( (desc.b & (1u<<12)) == (!is_x86_user_segment(seg) << 12) ) -+ goto raise_exn; - -- dpl = (desc.b >> 13) & 3; -- rpl = sel & 3; -- cpl = ss.attr.fields.dpl; -- -- switch ( seg ) -- { -- case x86_seg_cs: -- /* Code segment? */ -- if ( !(desc.b & (1u<<11)) ) -- goto raise_exn; -- /* Non-conforming segment: check DPL against RPL. */ -- if ( ((desc.b & (6u<<9)) != (6u<<9)) && (dpl != rpl) ) -- goto raise_exn; -- break; -- case x86_seg_ss: -- /* Writable data segment? */ -- if ( (desc.b & (5u<<9)) != (1u<<9) ) -- goto raise_exn; -- if ( (dpl != cpl) || (dpl != rpl) ) -- goto raise_exn; -- break; -- case x86_seg_ldtr: -- /* LDT system segment? */ -- if ( (desc.b & (15u<<8)) != (2u<<8) ) -- goto raise_exn; -- goto skip_accessed_flag; -- case x86_seg_tr: -- /* Available TSS system segment? */ -- if ( (desc.b & (15u<<8)) != (9u<<8) ) -- goto raise_exn; -- a_flag = 0x200; /* busy flag */ -- break; -- default: -- /* Readable code or data segment? */ -- if ( (desc.b & (5u<<9)) == (4u<<9) ) -- goto raise_exn; -- /* Non-conforming segment: check DPL against RPL and CPL. */ -- if ( ((desc.b & (6u<<9)) != (6u<<9)) && -- ((dpl < cpl) || (dpl < rpl)) ) -- goto raise_exn; -- break; -- } -+ dpl = (desc.b >> 13) & 3; -+ rpl = sel & 3; -+ cpl = ss.attr.fields.dpl; - -- /* Ensure Accessed flag is set. */ -- new_desc_b = desc.b | a_flag; -- rc = ((desc.b & a_flag) ? X86EMUL_OKAY : -- ops->cmpxchg( -- x86_seg_none, desctab.base + (sel & 0xfff8) + 4, -- &desc.b, &new_desc_b, 4, ctxt)); -- } while ( rc == X86EMUL_CMPXCHG_FAILED ); -+ switch ( seg ) -+ { -+ case x86_seg_cs: -+ /* Code segment? */ -+ if ( !(desc.b & (1u<<11)) ) -+ goto raise_exn; -+ /* Non-conforming segment: check DPL against RPL. */ -+ if ( ((desc.b & (6u<<9)) != (6u<<9)) && (dpl != rpl) ) -+ goto raise_exn; -+ break; -+ case x86_seg_ss: -+ /* Writable data segment? */ -+ if ( (desc.b & (5u<<9)) != (1u<<9) ) -+ goto raise_exn; -+ if ( (dpl != cpl) || (dpl != rpl) ) -+ goto raise_exn; -+ break; -+ case x86_seg_ldtr: -+ /* LDT system segment? */ -+ if ( (desc.b & (15u<<8)) != (2u<<8) ) -+ goto raise_exn; -+ goto skip_accessed_flag; -+ case x86_seg_tr: -+ /* Available TSS system segment? */ -+ if ( (desc.b & (15u<<8)) != (9u<<8) ) -+ goto raise_exn; -+ a_flag = 0x200; /* busy flag */ -+ break; -+ default: -+ /* Readable code or data segment? */ -+ if ( (desc.b & (5u<<9)) == (4u<<9) ) -+ goto raise_exn; -+ /* Non-conforming segment: check DPL against RPL and CPL. */ -+ if ( ((desc.b & (6u<<9)) != (6u<<9)) && -+ ((dpl < cpl) || (dpl < rpl)) ) -+ goto raise_exn; -+ break; -+ } - -- if ( rc ) -+ /* Ensure Accessed flag is set. */ -+ new_desc_b = desc.b | a_flag; -+ if ( !(desc.b & a_flag) && -+ ((rc = ops->cmpxchg( -+ x86_seg_none, desctab.base + (sel & 0xfff8) + 4, -+ &desc.b, &new_desc_b, 4, ctxt)) != 0) ) - return rc; - - /* Force the Accessed flag in our local copy. */ diff --git a/20035-x86-load-sreg-adjust.patch b/20035-x86-load-sreg-adjust.patch deleted file mode 100644 index b19dcd2..0000000 --- a/20035-x86-load-sreg-adjust.patch +++ /dev/null @@ -1,35 +0,0 @@ -# HG changeset patch -# User Keir Fraser -# Date 1250694095 -3600 -# Node ID 090e394202d0bb0089abc5e5276ed7fda283567d -# Parent daf1ff2c7dbd59b2ab31e6427be58ffdc14e10fd -x86_emulate: Fixes for 'mov rm16,sreg' - -1. Memory reads should be 16 bits only -2. Attempt to load %cs should result in #UD - -Signed-off-by: Keir Fraser -xen-unstable changeset: 20035:3fe64f43944f -xen-unstable date: Fri Aug 07 10:53:22 2009 +0100 - -Index: xen-3.4.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/x86_emulate/x86_emulate.c -+++ xen-3.4.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c -@@ -113,7 +113,7 @@ static uint8_t opcode_table[256] = { - ByteOp|DstMem|SrcReg|ModRM|Mov, DstMem|SrcReg|ModRM|Mov, - ByteOp|DstReg|SrcMem|ModRM|Mov, DstReg|SrcMem|ModRM|Mov, - DstMem|SrcReg|ModRM|Mov, DstReg|SrcNone|ModRM, -- DstReg|SrcMem|ModRM|Mov, DstMem|SrcNone|ModRM|Mov, -+ DstReg|SrcMem16|ModRM|Mov, DstMem|SrcNone|ModRM|Mov, - /* 0x90 - 0x97 */ - ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps, - ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps, -@@ -2008,6 +2008,7 @@ x86_emulate( - case 0x8e: /* mov r/m,Sreg */ { - enum x86_segment seg = decode_segment(modrm_reg); - generate_exception_if(seg == decode_segment_failed, EXC_UD, -1); -+ generate_exception_if(seg == x86_seg_cs, EXC_UD, -1); - if ( (rc = load_seg(seg, (uint16_t)src.val, ctxt, ops)) != 0 ) - goto done; - if ( seg == x86_seg_ss ) diff --git a/20059-vmx-nmi-handling.patch b/20059-vmx-nmi-handling.patch deleted file mode 100644 index db4e5cc..0000000 --- a/20059-vmx-nmi-handling.patch +++ /dev/null @@ -1,77 +0,0 @@ -# HG changeset patch -# User Keir Fraser -# Date 1250696034 -3600 -# Node ID 4af92eee8be497964912cda863c956691b3a3f89 -# Parent 2d6c4cc6a2a9e48218fe31d443f8937a3a88bf3f -VMX: issue an NMI rather than just calling the NMI handler -when the VMEXIT code indicates that an NMI has been raised. -Otherwise we might hit a real NMI while in the handler. - -Signed-off-by: Tim Deegan -xen-unstable changeset: 20059:76a65bf2aa4d -xen-unstable date: Fri Aug 14 10:58:32 2009 +0100 - -Index: xen-3.4.1-testing/xen/arch/x86/hvm/vmx/vmx.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/hvm/vmx/vmx.c -+++ xen-3.4.1-testing/xen/arch/x86/hvm/vmx/vmx.c -@@ -936,8 +936,6 @@ static void vmx_set_tsc_offset(struct vc - vmx_vmcs_exit(v); - } - --void do_nmi(struct cpu_user_regs *); -- - static void vmx_init_hypercall_page(struct domain *d, void *hypercall_page) - { - char *p; -@@ -2416,7 +2414,7 @@ asmlinkage void vmx_vmexit_handler(struc - (X86_EVENTTYPE_NMI << 8) ) - goto exit_and_crash; - HVMTRACE_0D(NMI); -- do_nmi(regs); /* Real NMI, vector 2: normal processing. */ -+ self_nmi(); /* Real NMI, vector 2: normal processing. */ - break; - case TRAP_machine_check: - HVMTRACE_0D(MCE); -Index: xen-3.4.1-testing/xen/arch/x86/nmi.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/nmi.c -+++ xen-3.4.1-testing/xen/arch/x86/nmi.c -@@ -441,18 +441,21 @@ void nmi_watchdog_tick(struct cpu_user_r - * 8-3 and 8-4 in IA32 Reference Manual Volume 3. We send the IPI to - * our own APIC ID explicitly which is valid. - */ --static void do_nmi_trigger(unsigned char key) -+void self_nmi(void) - { - u32 id = get_apic_id(); -- -- printk("Triggering NMI on APIC ID %x\n", id); -- - local_irq_disable(); - apic_wait_icr_idle(); - apic_icr_write(APIC_DM_NMI | APIC_DEST_PHYSICAL, id); - local_irq_enable(); - } - -+static void do_nmi_trigger(unsigned char key) -+{ -+ printk("Triggering NMI on APIC ID %x\n", get_apic_id()); -+ self_nmi(); -+} -+ - static void do_nmi_stats(unsigned char key) - { - int i; -Index: xen-3.4.1-testing/xen/include/asm-x86/apic.h -=================================================================== ---- xen-3.4.1-testing.orig/xen/include/asm-x86/apic.h -+++ xen-3.4.1-testing/xen/include/asm-x86/apic.h -@@ -196,6 +196,7 @@ extern void setup_secondary_APIC_clock ( - extern void setup_apic_nmi_watchdog (void); - extern int reserve_lapic_nmi(void); - extern void release_lapic_nmi(void); -+extern void self_nmi(void); - extern void disable_timer_nmi_watchdog(void); - extern void enable_timer_nmi_watchdog(void); - extern void nmi_watchdog_tick (struct cpu_user_regs *regs); diff --git a/20077-x86-runstate-cswitch-out.patch b/20077-x86-runstate-cswitch-out.patch deleted file mode 100644 index 94819c1..0000000 --- a/20077-x86-runstate-cswitch-out.patch +++ /dev/null @@ -1,95 +0,0 @@ -# HG changeset patch -# User Keir Fraser -# Date 1250683301 -3600 -# Node ID 456b4ec002443227f6d97f79b213dc4b2d281f9e -# Parent 2b8b6ee95c939089a0a7182286c9a21f0acce8fe -x86: extend runstate area updates - -In order to give guests a hint at whether their vCPU-s are currently -scheduled (so they can e.g. adapt their behavior in spin loops), -update -the run state area (if registered) also when de-scheduling a vCPU. - -Also fix an oversight in the compat mode implementation of -VCPUOP_register_runstate_memory_area. - -Signed-off-by: Jan Beulich - -Index: xen-3.4.1-testing/xen/arch/x86/domain.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/domain.c -+++ xen-3.4.1-testing/xen/arch/x86/domain.c -@@ -1219,6 +1219,26 @@ static void paravirt_ctxt_switch_to(stru - } - } - -+/* Update per-VCPU guest runstate shared memory area (if registered). */ -+static void update_runstate_area(struct vcpu *v) -+{ -+ if ( guest_handle_is_null(runstate_guest(v)) ) -+ return; -+ -+#ifdef CONFIG_COMPAT -+ if ( is_pv_32on64_domain(v->domain) ) -+ { -+ struct compat_vcpu_runstate_info info; -+ -+ XLAT_vcpu_runstate_info(&info, &v->runstate); -+ __copy_to_guest(v->runstate_guest.compat, &info, 1); -+ return; -+ } -+#endif -+ -+ __copy_to_guest(runstate_guest(v), &v->runstate, 1); -+} -+ - static inline int need_full_gdt(struct vcpu *v) - { - return (!is_hvm_vcpu(v) && !is_idle_vcpu(v)); -@@ -1311,6 +1331,9 @@ void context_switch(struct vcpu *prev, s - flush_tlb_mask(dirty_mask); - } - -+ if (prev != next) -+ update_runstate_area(prev); -+ - if ( is_hvm_vcpu(prev) && !list_empty(&prev->arch.hvm_vcpu.tm_list) ) - pt_save_timer(prev); - -@@ -1350,21 +1373,8 @@ void context_switch(struct vcpu *prev, s - - context_saved(prev); - -- /* Update per-VCPU guest runstate shared memory area (if registered). */ -- if ( !guest_handle_is_null(runstate_guest(next)) ) -- { -- if ( !is_pv_32on64_domain(next->domain) ) -- __copy_to_guest(runstate_guest(next), &next->runstate, 1); --#ifdef CONFIG_COMPAT -- else -- { -- struct compat_vcpu_runstate_info info; -- -- XLAT_vcpu_runstate_info(&info, &next->runstate); -- __copy_to_guest(next->runstate_guest.compat, &info, 1); -- } --#endif -- } -+ if (prev != next) -+ update_runstate_area(next); - - schedule_tail(next); - BUG(); -Index: xen-3.4.1-testing/xen/arch/x86/x86_64/domain.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/x86_64/domain.c -+++ xen-3.4.1-testing/xen/arch/x86/x86_64/domain.c -@@ -56,7 +56,7 @@ arch_compat_vcpu_op( - struct vcpu_runstate_info runstate; - - vcpu_runstate_get(v, &runstate); -- XLAT_vcpu_runstate_info(&info, &v->runstate); -+ XLAT_vcpu_runstate_info(&info, &runstate); - } - __copy_to_guest(v->runstate_guest.compat, &info, 1); - diff --git a/20078-x86_64-branch-emulation.patch b/20078-x86_64-branch-emulation.patch deleted file mode 100644 index 939c351..0000000 --- a/20078-x86_64-branch-emulation.patch +++ /dev/null @@ -1,137 +0,0 @@ -# HG changeset patch -# User Keir Fraser -# Date 1250696281 -3600 -# Node ID 68ea3be8b6c14d6de5d7c87fc00e27a596d2a00d -# Parent ca4db4ff9101f51d89a3de9e756b8a2f90a2baf2 -x86-64: adjust emulation of control transfers - -While Intel and AMD implementations differ in various respects when -it comes to non-default operand sizes of control transfer instructions -and segment register loads (lfs, lgs, lss), it seems to make senss to -(a) match their behavior if they agree and (b) prefer the more -permissive behavior if they don't agree: - -- honor operand size overrides on near brances (AMD does, Intel - doesn't) -- honor operand size overrides on far branches (both Intel and AMD do) -- honor REX.W on far branches (Intel does, AMD doesn't except on far - returns) -- honor REX.W on lfs, lgs, and lss (Intel does, AMD doesn't) - -Also, do not permit emulation of pushing/popping segment registers -other than fs and gs as well as that of les and lds (the latter are -particularly important due to the re-use of the respective opcodes as -VEX prefixes in AVX). - -Signed-off-by: Jan Beulich -xen-unstable changeset: 20078:429ef4f4fe37 -xen-unstable date: Wed Aug 19 13:02:04 2009 +0100 - -Index: xen-3.4.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/x86_emulate/x86_emulate.c -+++ xen-3.4.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c -@@ -561,9 +561,10 @@ do { - do { \ - int _rel = (int)(rel); \ - _regs.eip += _rel; \ -- if ( !mode_64bit() ) \ -- _regs.eip = ((op_bytes == 2) \ -- ? (uint16_t)_regs.eip : (uint32_t)_regs.eip); \ -+ if ( op_bytes == 2 ) \ -+ _regs.eip = (uint16_t)_regs.eip; \ -+ else if ( !mode_64bit() ) \ -+ _regs.eip = (uint32_t)_regs.eip; \ - } while (0) - - struct fpu_insn_ctxt { -@@ -1614,6 +1615,7 @@ x86_emulate( - struct segment_register reg; - src.val = x86_seg_es; - push_seg: -+ generate_exception_if(mode_64bit() && !twobyte, EXC_UD, -1); - fail_if(ops->read_segment == NULL); - if ( (rc = ops->read_segment(src.val, ®, ctxt)) != 0 ) - return rc; -@@ -1629,6 +1631,7 @@ x86_emulate( - case 0x07: /* pop %%es */ - src.val = x86_seg_es; - pop_seg: -+ generate_exception_if(mode_64bit() && !twobyte, EXC_UD, -1); - fail_if(ops->write_segment == NULL); - /* 64-bit mode: POP defaults to a 64-bit operand. */ - if ( mode_64bit() && (op_bytes == 4) ) -@@ -2074,8 +2077,8 @@ x86_emulate( - uint16_t sel; - uint32_t eip; - -- fail_if(ops->read_segment == NULL); - generate_exception_if(mode_64bit(), EXC_UD, -1); -+ fail_if(ops->read_segment == NULL); - - eip = insn_fetch_bytes(op_bytes); - sel = insn_fetch_type(uint16_t); -@@ -2293,7 +2296,7 @@ x86_emulate( - case 0xc2: /* ret imm16 (near) */ - case 0xc3: /* ret (near) */ { - int offset = (b == 0xc2) ? insn_fetch_type(uint16_t) : 0; -- op_bytes = mode_64bit() ? 8 : op_bytes; -+ op_bytes = ((op_bytes == 4) && mode_64bit()) ? 8 : op_bytes; - if ( (rc = read_ulong(x86_seg_ss, sp_post_inc(op_bytes + offset), - &dst.val, op_bytes, ctxt, ops)) != 0 ) - goto done; -@@ -2305,6 +2308,7 @@ x86_emulate( - unsigned long sel; - dst.val = x86_seg_es; - les: /* dst.val identifies the segment */ -+ generate_exception_if(mode_64bit() && !twobyte, EXC_UD, -1); - generate_exception_if(src.type != OP_MEM, EXC_UD, -1); - if ( (rc = read_ulong(src.mem.seg, src.mem.off + src.bytes, - &sel, 2, ctxt, ops)) != 0 ) -@@ -2379,7 +2383,6 @@ x86_emulate( - case 0xca: /* ret imm16 (far) */ - case 0xcb: /* ret (far) */ { - int offset = (b == 0xca) ? insn_fetch_type(uint16_t) : 0; -- op_bytes = mode_64bit() ? 8 : op_bytes; - if ( (rc = read_ulong(x86_seg_ss, sp_post_inc(op_bytes), - &dst.val, op_bytes, ctxt, ops)) || - (rc = read_ulong(x86_seg_ss, sp_post_inc(op_bytes + offset), -@@ -3032,17 +3035,17 @@ x86_emulate( - } - - case 0xe8: /* call (near) */ { -- int rel = (((op_bytes == 2) && !mode_64bit()) -+ int rel = ((op_bytes == 2) - ? (int32_t)insn_fetch_type(int16_t) - : insn_fetch_type(int32_t)); -- op_bytes = mode_64bit() ? 8 : op_bytes; -+ op_bytes = ((op_bytes == 4) && mode_64bit()) ? 8 : op_bytes; - src.val = _regs.eip; - jmp_rel(rel); - goto push; - } - - case 0xe9: /* jmp (near) */ { -- int rel = (((op_bytes == 2) && !mode_64bit()) -+ int rel = ((op_bytes == 2) - ? (int32_t)insn_fetch_type(int16_t) - : insn_fetch_type(int32_t)); - jmp_rel(rel); -@@ -3330,7 +3333,7 @@ x86_emulate( - break; - case 2: /* call (near) */ - case 4: /* jmp (near) */ -- if ( (dst.bytes != 8) && mode_64bit() ) -+ if ( (dst.bytes == 4) && mode_64bit() ) - { - dst.bytes = op_bytes = 8; - if ( dst.type == OP_REG ) -@@ -3683,7 +3686,7 @@ x86_emulate( - } - - case 0x80 ... 0x8f: /* jcc (near) */ { -- int rel = (((op_bytes == 2) && !mode_64bit()) -+ int rel = ((op_bytes == 2) - ? (int32_t)insn_fetch_type(int16_t) - : insn_fetch_type(int32_t)); - if ( test_cc(b, _regs.eflags) ) diff --git a/20099-pygrub-security.patch b/20099-pygrub-security.patch deleted file mode 100644 index 6ec02f3..0000000 --- a/20099-pygrub-security.patch +++ /dev/null @@ -1,142 +0,0 @@ -# HG changeset patch -# User Keir Fraser -# Date 1250781436 -3600 -# Node ID 8f783adc0ee34808cdd296cccd92f99018f76017 -# Parent 4b30cfb855299922244938fde4f88f4e5bb5df34 -pygrub: Add password support - -It basically checks for the presence of password line in grub.conf -of the guest image and if this line is present, it supports both clear -text and md5 versions of the password. Editing the grub entries and -command-line are disabled when some password is set in domain's -grub.conf file but the password was not entered yet. Also, new option -to press 'p' in interactive pygrub has been added to allow entering -the grub password. It's been tested on x86_64 with PV guests and was -working fine. Also, the countdown has been stopped after key was -pressed, ie. the user is probably editing the boot configuration. - -Signed-off-by: Michal Novotny - -Index: xen-3.4.1-testing/tools/pygrub/src/GrubConf.py -=================================================================== ---- xen-3.4.1-testing.orig/tools/pygrub/src/GrubConf.py -+++ xen-3.4.1-testing/tools/pygrub/src/GrubConf.py -@@ -157,6 +157,7 @@ class GrubConfigFile(object): - self.images = [] - self.timeout = -1 - self._default = 0 -+ self.passwordAccess = True - - if fn is not None: - self.parse() -@@ -196,6 +197,7 @@ class GrubConfigFile(object): - if self.commands.has_key(com): - if self.commands[com] is not None: - setattr(self, self.commands[com], arg.strip()) -+ #print "%s = %s => %s" % (com, self.commands[com], arg.strip() ) - else: - logging.info("Ignored directive %s" %(com,)) - else: -@@ -204,6 +206,37 @@ class GrubConfigFile(object): - if len(img) > 0: - self.add_image(GrubImage(img)) - -+ if self.hasPassword(): -+ self.setPasswordAccess(False) -+ -+ def hasPasswordAccess(self): -+ return self.passwordAccess -+ -+ def setPasswordAccess(self, val): -+ self.passwordAccess = val -+ -+ def hasPassword(self): -+ try: -+ getattr(self, self.commands['password']) -+ return True -+ except KeyError, e: -+ return False -+ -+ def checkPassword(self, password): -+ try: -+ pwd = getattr(self, self.commands['password']).split() -+ if pwd[0] == '--md5': -+ import crypt -+ if crypt.crypt(password, pwd[1]) == pwd[1]: -+ return True -+ -+ if pwd[0] == password: -+ return True -+ -+ return False -+ except: -+ return True -+ - def set(self, line): - (com, arg) = grub_exact_split(line, 2) - if self.commands.has_key(com): -Index: xen-3.4.1-testing/tools/pygrub/src/pygrub -=================================================================== ---- xen-3.4.1-testing.orig/tools/pygrub/src/pygrub -+++ xen-3.4.1-testing/tools/pygrub/src/pygrub -@@ -418,7 +418,14 @@ class Grub: - self.text_win.addstr(0, 0, "Use the U and D keys to select which entry is highlighted.") - self.text_win.addstr(1, 0, "Press enter to boot the selected OS. 'e' to edit the") - self.text_win.addstr(2, 0, "commands before booting, 'a' to modify the kernel arguments ") -- self.text_win.addstr(3, 0, "before booting, or 'c' for a command line.") -+ -+ # if grub has password defined we allow option to enter password -+ if not self.cf.hasPassword(): -+ self.text_win.addstr(3, 0, "before booting, or 'c' for a command line.") -+ else: -+ self.text_win.addstr(3, 0, "before booting, or 'c' for a command line. You can also") -+ self.text_win.addstr(4, 0, "press 'p' to enter password for modifications...") -+ - self.text_win.addch(0, 8, curses.ACS_UARROW) - self.text_win.addch(0, 14, curses.ACS_DARROW) - (y, x) = self.text_win.getmaxyx() -@@ -457,9 +464,19 @@ class Grub: - - # handle keypresses - if c == ord('c'): -+ # we disallow access without password specified -+ if not self.cf.hasPasswordAccess(): -+ self.text_win.addstr(6, 8, "You have to enter GRUB password first") -+ break -+ - self.command_line_mode() - break - elif c == ord('a'): -+ # we disallow access without password specified -+ if not self.cf.hasPasswordAccess(): -+ self.text_win.addstr(6, 8, "You have to enter GRUB password first") -+ break -+ - # find the kernel line, edit it and then boot - img = self.cf.images[self.selected_image] - for line in img.lines: -@@ -471,9 +488,24 @@ class Grub: - break - break - elif c == ord('e'): -+ # we disallow access without password specified -+ if not self.cf.hasPasswordAccess(): -+ self.text_win.addstr(6, 8, "You have to enter GRUB password first") -+ break -+ - img = self.cf.images[self.selected_image] - self.edit_entry(img) - break -+ elif c == ord('p') and self.cf.hasPassword(): -+ self.text_win.addstr(6, 8, "Enter password: ") -+ pwd = self.text_win.getstr(6, 8) -+ if not self.cf.checkPassword(pwd): -+ self.text_win.addstr(6, 8, "Incorrect password!") -+ self.cf.setPasswordAccess( False ) -+ else: -+ self.text_win.addstr(6, 8, "Access granted ") -+ self.cf.setPasswordAccess( True ) -+ break - elif c in (curses.KEY_ENTER, ord('\n'), ord('\r')): - self.isdone = True - break diff --git a/20101-hvm-no-compat-virt-start.patch b/20101-hvm-no-compat-virt-start.patch deleted file mode 100644 index eee20f3..0000000 --- a/20101-hvm-no-compat-virt-start.patch +++ /dev/null @@ -1,26 +0,0 @@ -# HG changeset patch -# User Keir Fraser -# Date 1250789251 -3600 -# Node ID 100699877583818a54bc16360dfd5cf80daa5dc7 -# Parent 280fff79f7371981bb0bbda34205414fff14737e -x86_64 hvm: Adjust COMPAT_VIRT_START for 32-bit HVM guests. - -The PV limit should not apply as there is no M2P table mapped into an -HVM guest's virtual address space. - -Signed-off-by: Keir Fraser - -Index: xen-3.4.1-testing/xen/arch/x86/domain.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/domain.c -+++ xen-3.4.1-testing/xen/arch/x86/domain.c -@@ -428,7 +428,8 @@ int arch_domain_create(struct domain *d, - #endif /* __x86_64__ */ - - #ifdef CONFIG_COMPAT -- HYPERVISOR_COMPAT_VIRT_START(d) = __HYPERVISOR_COMPAT_VIRT_START; -+ HYPERVISOR_COMPAT_VIRT_START(d) = -+ is_hvm_domain(d) ? ~0u : __HYPERVISOR_COMPAT_VIRT_START; - #endif - - if ( (rc = paging_domain_init(d)) != 0 ) diff --git a/20107-pygrub-security.patch b/20107-pygrub-security.patch deleted file mode 100644 index 2607acb..0000000 --- a/20107-pygrub-security.patch +++ /dev/null @@ -1,39 +0,0 @@ -# HG changeset patch -# User Keir Fraser -# Date 1250871100 -3600 -# Node ID 168f0cfeded0ad64e03d821efe5dcbe2eb5806a3 -# Parent 4207d83fc78ef63016a4163b09f30aa471e4bdb8 -pygrub: Fix elilo handling after password patch. - -Signed-off-by: Michal Novotny - -Index: xen-3.4.1-testing/tools/pygrub/src/GrubConf.py -=================================================================== ---- xen-3.4.1-testing.orig/tools/pygrub/src/GrubConf.py -+++ xen-3.4.1-testing/tools/pygrub/src/GrubConf.py -@@ -219,7 +219,7 @@ class GrubConfigFile(object): - try: - getattr(self, self.commands['password']) - return True -- except KeyError, e: -+ except: - return False - - def checkPassword(self, password): -Index: xen-3.4.1-testing/tools/pygrub/src/LiloConf.py -=================================================================== ---- xen-3.4.1-testing.orig/tools/pygrub/src/LiloConf.py -+++ xen-3.4.1-testing/tools/pygrub/src/LiloConf.py -@@ -138,6 +138,12 @@ class LiloConfigFile(object): - if len(img) > 0: - self.add_image(LiloImage(img, path)) - -+ def hasPassword(self): -+ return False -+ -+ def hasPasswordAccess(self): -+ return True -+ - def add_image(self, image): - self.images.append(image) - diff --git a/20112-x86-dom0-boot-run-timers.patch b/20112-x86-dom0-boot-run-timers.patch deleted file mode 100644 index 4ed864c..0000000 --- a/20112-x86-dom0-boot-run-timers.patch +++ /dev/null @@ -1,47 +0,0 @@ -References: bnc#491081 -# HG changeset patch -# User Keir Fraser -# Date 1251097328 -3600 -# Node ID 7e194320394244bc5028881b498d2e01574086cd -# Parent 9189afa1f1e6939fcda5525e225843cfd2325c42 -x86: run timers when populating Dom0's P2M table - -When booting Dom0 with huge amounts of memory, and/or memory accesses -being sufficiently slow (due to NUMA effects), and the ACPI PM timer -or a high frequency HPET being used, the time it takes to populate the -M2P table may significantly exceed the overflow time of the platform -timer, screwing up time management to the point where Dom0 boot fails. - -Signed-off-by: Jan Beulich - -Index: xen-3.4.1-testing/xen/arch/x86/domain_build.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/domain_build.c -+++ xen-3.4.1-testing/xen/arch/x86/domain_build.c -@@ -877,6 +877,8 @@ int __init construct_dom0( - else - ((unsigned int *)vphysmap_start)[pfn] = mfn; - set_gpfn_from_mfn(mfn, pfn); -+ if (!(pfn & 0xfffff)) -+ process_pending_timers(); - } - si->first_p2m_pfn = pfn; - si->nr_p2m_frames = d->tot_pages - count; -@@ -895,6 +897,8 @@ int __init construct_dom0( - #ifndef NDEBUG - ++alloc_epfn; - #endif -+ if (!(pfn & 0xfffff)) -+ process_pending_timers(); - } - } - BUG_ON(pfn != d->tot_pages); -@@ -915,6 +919,8 @@ int __init construct_dom0( - set_gpfn_from_mfn(mfn, pfn); - #undef pfn - page++; pfn++; -+ if (!(pfn & 0xfffff)) -+ process_pending_timers(); - } - } - diff --git a/20125-xc-parse-tuple-fix.patch b/20125-xc-parse-tuple-fix.patch deleted file mode 100644 index 4cdc418..0000000 --- a/20125-xc-parse-tuple-fix.patch +++ /dev/null @@ -1,46 +0,0 @@ -# HG changeset patch -# User Keir Fraser -# Date 1251297719 -3600 -# Node ID ed672a604cc7d0acb9418b29cdc3d65ea84543e8 -# Parent 71389988f5d4e6417f7da1d86da984acd5118efc -xend: Do not pass pointer to a 16-bit domid_t to PyArg_ParseTuple() -when it expects a full integer. - -Signed-off-by: Keir Fraser - -Index: xen-3.4.1-testing/tools/python/xen/lowlevel/xc/xc.c -=================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/lowlevel/xc/xc.c -+++ xen-3.4.1-testing/tools/python/xen/lowlevel/xc/xc.c -@@ -650,10 +650,9 @@ static PyObject *pyxc_deassign_device(Xc - static PyObject *pyxc_get_device_group(XcObject *self, - PyObject *args) - { -- domid_t domid; - uint32_t bdf = 0; - uint32_t max_sdevs, num_sdevs; -- int seg, bus, dev, func, rc, i; -+ int domid, seg, bus, dev, func, rc, i; - PyObject *Pystr; - char *group_str; - char dev_str[9]; -@@ -808,7 +807,7 @@ static PyObject *pyxc_dom_check_cpuid(Xc - static PyObject *pyxc_dom_set_policy_cpuid(XcObject *self, - PyObject *args) - { -- domid_t domid; -+ int domid; - - if ( !PyArg_ParseTuple(args, "i", &domid) ) - return NULL; -@@ -824,9 +823,8 @@ static PyObject *pyxc_dom_set_policy_cpu - static PyObject *pyxc_dom_set_cpuid(XcObject *self, - PyObject *args) - { -- domid_t domid; - PyObject *sub_input, *config; -- unsigned int input[2]; -+ unsigned int domid, input[2]; - char *regs[4], *regs_transform[4]; - - if ( !PyArg_ParseTuple(args, "IIOO", &domid, diff --git a/20146-pygrub-security.patch b/20146-pygrub-security.patch deleted file mode 100644 index 95eef9c..0000000 --- a/20146-pygrub-security.patch +++ /dev/null @@ -1,95 +0,0 @@ -# HG changeset patch -# User Keir Fraser -# Date 1251887904 -3600 -# Node ID e513d565c8f1298d26bc614eabd1b7111693a940 -# Parent 8fc92779847680fe40a1ee9c2a01b3effc7cd056 -pygrub: Match bare-metal GRUB behavior for passwords - -The password support patch already merged didn't match the bare-metal -GRUB behavior so I created a patch to match it. If password is entered -in grub.conf file, pressing `p` is required exactly like when using -"real" (bare-metal) GRUB. New options are available after the correct -password is entered. - -Signed-off-by: Michal Novotny - -Index: xen-3.4.1-testing/tools/pygrub/src/pygrub -=================================================================== ---- xen-3.4.1-testing.orig/tools/pygrub/src/pygrub -+++ xen-3.4.1-testing/tools/pygrub/src/pygrub -@@ -415,16 +415,17 @@ class Grub: - def draw(): - # set up the screen - self.draw_main_windows() -- self.text_win.addstr(0, 0, "Use the U and D keys to select which entry is highlighted.") -- self.text_win.addstr(1, 0, "Press enter to boot the selected OS. 'e' to edit the") -- self.text_win.addstr(2, 0, "commands before booting, 'a' to modify the kernel arguments ") - -- # if grub has password defined we allow option to enter password -- if not self.cf.hasPassword(): -+ if not self.cf.hasPassword() or self.cf.hasPasswordAccess(): -+ self.text_win.addstr(0, 0, "Use the U and D keys to select which entry is highlighted.") -+ self.text_win.addstr(1, 0, "Press enter to boot the selected OS, 'e' to edit the") -+ self.text_win.addstr(2, 0, "commands before booting, 'a' to modify the kernel arguments ") - self.text_win.addstr(3, 0, "before booting, or 'c' for a command line.") -+ - else: -- self.text_win.addstr(3, 0, "before booting, or 'c' for a command line. You can also") -- self.text_win.addstr(4, 0, "press 'p' to enter password for modifications...") -+ self.text_win.addstr(0, 0, "Use the U and D keys to select which entry is highlighted.") -+ self.text_win.addstr(1, 0, "Press enter to boot the selected OS or `p` to enter a") -+ self.text_win.addstr(2, 0, "password to unlock the next set of features.") - - self.text_win.addch(0, 8, curses.ACS_UARROW) - self.text_win.addch(0, 14, curses.ACS_DARROW) -@@ -463,20 +464,10 @@ class Grub: - self.screen.timeout(-1) - - # handle keypresses -- if c == ord('c'): -- # we disallow access without password specified -- if not self.cf.hasPasswordAccess(): -- self.text_win.addstr(6, 8, "You have to enter GRUB password first") -- break -- -+ if c == ord('c') and self.cf.hasPasswordAccess(): - self.command_line_mode() - break -- elif c == ord('a'): -- # we disallow access without password specified -- if not self.cf.hasPasswordAccess(): -- self.text_win.addstr(6, 8, "You have to enter GRUB password first") -- break -- -+ elif c == ord('a') and self.cf.hasPasswordAccess(): - # find the kernel line, edit it and then boot - img = self.cf.images[self.selected_image] - for line in img.lines: -@@ -487,23 +478,18 @@ class Grub: - self.isdone = True - break - break -- elif c == ord('e'): -- # we disallow access without password specified -- if not self.cf.hasPasswordAccess(): -- self.text_win.addstr(6, 8, "You have to enter GRUB password first") -- break -- -+ elif c == ord('e') and self.cf.hasPasswordAccess(): - img = self.cf.images[self.selected_image] - self.edit_entry(img) - break - elif c == ord('p') and self.cf.hasPassword(): -- self.text_win.addstr(6, 8, "Enter password: ") -+ self.text_win.addstr(6, 1, "Password: ") - pwd = self.text_win.getstr(6, 8) - if not self.cf.checkPassword(pwd): -- self.text_win.addstr(6, 8, "Incorrect password!") -+ self.text_win.addstr(6, 1, "Password: ") -+ self.text_win.addstr(7, 0, "Failed!") - self.cf.setPasswordAccess( False ) - else: -- self.text_win.addstr(6, 8, "Access granted ") - self.cf.setPasswordAccess( True ) - break - elif c in (curses.KEY_ENTER, ord('\n'), ord('\r')): diff --git a/20174-pygrub-security.patch b/20174-pygrub-security.patch deleted file mode 100644 index bd9beeb..0000000 --- a/20174-pygrub-security.patch +++ /dev/null @@ -1,95 +0,0 @@ -# HG changeset patch -# User Keir Fraser -# Date 1252327855 -3600 -# Node ID a28c9c2fa8de05ebd0284f578289e96d2d15d574 -# Parent b81e375e03922cd72d6e1404bc62a05059a4fe61 -pygrub: trap exception when python module import fails - -Fix the issue when importing 'crypt' module or crypt.crypt fails in -pygrub. The exception is written on the same line like "Failed!" -message but only if there is an exception. If there is no exception, -we don't bother users with details (probably the password they entered -was wrong) so we just display "Failed!" message. Also, the code for -hasPassword() was rewritten not to have try/except block here. - -Signed-off-by: Michal Novotny - -Index: xen-3.4.1-testing/tools/pygrub/src/GrubConf.py -=================================================================== ---- xen-3.4.1-testing.orig/tools/pygrub/src/GrubConf.py -+++ xen-3.4.1-testing/tools/pygrub/src/GrubConf.py -@@ -158,6 +158,7 @@ class GrubConfigFile(object): - self.timeout = -1 - self._default = 0 - self.passwordAccess = True -+ self.passExc = None - - if fn is not None: - self.parse() -@@ -197,7 +198,6 @@ class GrubConfigFile(object): - if self.commands.has_key(com): - if self.commands[com] is not None: - setattr(self, self.commands[com], arg.strip()) -- #print "%s = %s => %s" % (com, self.commands[com], arg.strip() ) - else: - logging.info("Ignored directive %s" %(com,)) - else: -@@ -216,25 +216,28 @@ class GrubConfigFile(object): - self.passwordAccess = val - - def hasPassword(self): -- try: -- getattr(self, self.commands['password']) -- return True -- except: -- return False -+ return hasattr(self, 'password') - - def checkPassword(self, password): -- try: -- pwd = getattr(self, self.commands['password']).split() -- if pwd[0] == '--md5': -+ # Always allow if no password defined in grub.conf -+ if not self.hasPassword: -+ return True -+ -+ # If we're here, we're having 'password' attribute set -+ pwd = getattr(self, 'password').split() -+ -+ # We check whether password is in MD5 hash for comparison -+ if pwd[0] == '--md5': -+ try: - import crypt - if crypt.crypt(password, pwd[1]) == pwd[1]: - return True -+ except Exception, e: -+ self.passExc = "Can't verify password: %s" % str(e) -+ return False - -- if pwd[0] == password: -- return True -- -- return False -- except: -+ # ... and if not, we compare it as a plain text -+ if pwd[0] == password: - return True - - def set(self, line): -Index: xen-3.4.1-testing/tools/pygrub/src/pygrub -=================================================================== ---- xen-3.4.1-testing.orig/tools/pygrub/src/pygrub -+++ xen-3.4.1-testing/tools/pygrub/src/pygrub -@@ -487,7 +487,11 @@ class Grub: - pwd = self.text_win.getstr(6, 8) - if not self.cf.checkPassword(pwd): - self.text_win.addstr(6, 1, "Password: ") -- self.text_win.addstr(7, 0, "Failed!") -+ if self.cf.passExc is not None: -+ self.text_win.addstr(7, 0, "Exception: %s" -+ % self.cf.passExc) -+ else: -+ self.text_win.addstr(7, 0, "Failed!") - self.cf.setPasswordAccess( False ) - else: - self.cf.setPasswordAccess( True ) diff --git a/20201-pygrub-security.patch b/20201-pygrub-security.patch deleted file mode 100644 index 7218664..0000000 --- a/20201-pygrub-security.patch +++ /dev/null @@ -1,42 +0,0 @@ -# HG changeset patch -# User Keir Fraser -# Date 1253002894 -3600 -# Node ID 67f1b8b3258591b979c441c6013af3c442063cc1 -# Parent 045b2b8b522708093b91f883f1b7e7c1805f71e3 -pygrub: Correct pygrub return value - -This is the patch to correct pygrub return value for checkPassword() -function. It didn't return False at the end of the function. It -returned None so it was working fine and it's most likely just a -cosmetic issue. - -Also, the missing () were added to checkPassword() function when -calling hasPassword and the unnecessary comment was removed. - -Signed-off-by: Michal Novotny - -Index: xen-3.4.1-testing/tools/pygrub/src/GrubConf.py -=================================================================== ---- xen-3.4.1-testing.orig/tools/pygrub/src/GrubConf.py -+++ xen-3.4.1-testing/tools/pygrub/src/GrubConf.py -@@ -220,10 +220,9 @@ class GrubConfigFile(object): - - def checkPassword(self, password): - # Always allow if no password defined in grub.conf -- if not self.hasPassword: -+ if not self.hasPassword(): - return True - -- # If we're here, we're having 'password' attribute set - pwd = getattr(self, 'password').split() - - # We check whether password is in MD5 hash for comparison -@@ -240,6 +239,8 @@ class GrubConfigFile(object): - if pwd[0] == password: - return True - -+ return False -+ - def set(self, line): - (com, arg) = grub_exact_split(line, 2) - if self.commands.has_key(com): diff --git a/32on64-extra-mem.patch b/32on64-extra-mem.patch index 1f215ff..da8f123 100644 --- a/32on64-extra-mem.patch +++ b/32on64-extra-mem.patch @@ -1,10 +1,10 @@ -Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -2560,7 +2560,7 @@ class XendDomainInfo: - vtd_mem = ((vtd_mem + 1023) / 1024) * 1024 +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py +@@ -2863,7 +2863,7 @@ class XendDomainInfo: + self.guest_bitsize = self.image.getBitSize() # Make sure there's enough RAM available for the domain - balloon.free(memory + shadow + vtd_mem, self) + balloon.free(memory + shadow + vtd_mem + 512, self) diff --git a/bdrv_open2_fix_flags.patch b/bdrv_open2_fix_flags.patch index 497d403..3a79db2 100644 --- a/bdrv_open2_fix_flags.patch +++ b/bdrv_open2_fix_flags.patch @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/ioemu-remote/block.c +Index: xen-4.0.0-testing/tools/ioemu-remote/block.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/block.c -+++ xen-3.4.1-testing/tools/ioemu-remote/block.c -@@ -347,7 +347,7 @@ int bdrv_file_open(BlockDriverState **pb +--- xen-4.0.0-testing.orig/tools/ioemu-remote/block.c ++++ xen-4.0.0-testing/tools/ioemu-remote/block.c +@@ -350,7 +350,7 @@ int bdrv_file_open(BlockDriverState **pb int bdrv_open(BlockDriverState *bs, const char *filename, int flags) { @@ -11,7 +11,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/block.c } int bdrv_open2(BlockDriverState *bs, const char *filename, int flags, -@@ -416,12 +416,13 @@ int bdrv_open2(BlockDriverState *bs, con +@@ -419,12 +419,13 @@ int bdrv_open2(BlockDriverState *bs, con } bs->drv = drv; bs->opaque = qemu_mallocz(drv->instance_size); @@ -28,10 +28,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/block.c ret = drv->bdrv_open(bs, filename, open_flags); if ((ret == -EACCES || ret == -EPERM) && !(flags & BDRV_O_FILE)) { ret = drv->bdrv_open(bs, filename, open_flags & ~BDRV_O_RDWR); -Index: xen-3.4.1-testing/tools/ioemu-remote/hw/usb-msd.c +Index: xen-4.0.0-testing/tools/ioemu-remote/hw/usb-msd.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/usb-msd.c -+++ xen-3.4.1-testing/tools/ioemu-remote/hw/usb-msd.c +--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/usb-msd.c ++++ xen-4.0.0-testing/tools/ioemu-remote/hw/usb-msd.c @@ -551,7 +551,7 @@ USBDevice *usb_msd_init(const char *file s = qemu_mallocz(sizeof(MSDState)); @@ -41,10 +41,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/usb-msd.c goto fail; s->bs = bdrv; *pbs = bdrv; -Index: xen-3.4.1-testing/tools/ioemu-remote/qemu-img.c +Index: xen-4.0.0-testing/tools/ioemu-remote/qemu-img.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/qemu-img.c -+++ xen-3.4.1-testing/tools/ioemu-remote/qemu-img.c +--- xen-4.0.0-testing.orig/tools/ioemu-remote/qemu-img.c ++++ xen-4.0.0-testing/tools/ioemu-remote/qemu-img.c @@ -32,7 +32,7 @@ #endif diff --git a/bdrv_open2_flags_2.patch b/bdrv_open2_flags_2.patch index 9a9a213..9f09ffd 100644 --- a/bdrv_open2_flags_2.patch +++ b/bdrv_open2_flags_2.patch @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c +Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_blktap.c -+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c -@@ -227,6 +227,7 @@ static int open_disk(struct td_state *s, +--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.c ++++ xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c +@@ -225,6 +225,7 @@ static int open_disk(struct td_state *s, BlockDriver* drv; char* devname; static int devnumber = 0; @@ -10,7 +10,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c int i; DPRINTF("Opening %s as blktap%d\n", path, devnumber); -@@ -249,7 +250,7 @@ static int open_disk(struct td_state *s, +@@ -247,7 +248,7 @@ static int open_disk(struct td_state *s, DPRINTF("%s driver specified\n", drv ? drv->format_name : "No"); /* Open the image */ @@ -19,44 +19,44 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c fprintf(stderr, "Could not open image file %s\n", path); return -ENOMEM; } -Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c +Index: xen-4.0.0-testing/tools/ioemu-remote/xenstore.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/xenstore.c -+++ xen-3.4.1-testing/tools/ioemu-remote/xenstore.c -@@ -64,7 +64,8 @@ static void insert_media(void *opaque) - for (i = 0; i < MAX_DRIVES + 1; i++) { - bs = drives_table[i].bdrv; - if (media_filename[i] && bs && bs->filename[0] == '\0') { -- bdrv_open2(bs, media_filename[i], 0, &bdrv_raw); +--- xen-4.0.0-testing.orig/tools/ioemu-remote/xenstore.c ++++ xen-4.0.0-testing/tools/ioemu-remote/xenstore.c +@@ -133,7 +133,8 @@ static void insert_media(void *opaque) + else + format = &bdrv_raw; + +- bdrv_open2(bs, media_filename[i], 0, format); + /* Temporary BDRV_O_RDWR */ -+ bdrv_open2(bs, media_filename[i], BDRV_O_RDWR, &bdrv_raw); - pstrcpy(bs->filename, sizeof(bs->filename), media_filename[i]); - free(media_filename[i]); - media_filename[i] = NULL; -@@ -314,9 +315,9 @@ void xenstore_parse_domain_config(int hv ++ bdrv_open2(bs, media_filename[i], BDRV_O_RDWR, format); + #ifdef CONFIG_STUBDOM + { + char *buf, *backend, *params_path, *params; +@@ -397,9 +398,9 @@ void xenstore_parse_domain_config(int hv { char **e_danger = NULL; char *buf = NULL; - char *fpath = NULL, *bpath = NULL, *btype = NULL, + char *fpath = NULL, *bpath = NULL, *btype = NULL, *mode = NULL, *dev = NULL, *params = NULL, *drv = NULL; -- int i, j, any_hdN = 0, ret, is_tap; -+ int i, j, any_hdN = 0, ret, is_tap, flags; +- int i, j, ret, is_tap; ++ int i, j, ret, is_tap, flags; unsigned int len, num, hd_index, pci_devid = 0; BlockDriverState *bs; BlockDriver *format; -@@ -378,7 +379,8 @@ void xenstore_parse_domain_config(int hv +@@ -461,7 +462,8 @@ void xenstore_parse_domain_config(int hv } for (i = 0; i < num; i++) { - format = NULL; /* don't know what the format is yet */ -+ flags = 0; ++ flags = 0; + format = NULL; /* don't know what the format is yet */ /* read the backend path */ xenstore_get_backend_path(&bpath, "vbd", danger_path, hvm_domid, e_danger[i]); if (bpath == NULL) -@@ -464,6 +466,17 @@ void xenstore_parse_domain_config(int hv - format = &bdrv_raw; +@@ -560,6 +562,17 @@ void xenstore_parse_domain_config(int hv + } } + /* read the mode of the device */ @@ -73,21 +73,21 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c #if 0 /* Phantom VBDs are disabled because the use of paths * from guest-controlled areas in xenstore is unsafe. -@@ -509,7 +522,7 @@ void xenstore_parse_domain_config(int hv +@@ -612,7 +625,7 @@ void xenstore_parse_domain_config(int hv #ifdef CONFIG_STUBDOM if (pasprintf(&danger_buf, "%s/device/vbd/%s", danger_path, e_danger[i]) == -1) continue; - if (bdrv_open2(bs, danger_buf, BDRV_O_CACHE_WB /* snapshot and write-back */, &bdrv_raw) == 0) { + if (bdrv_open2(bs, danger_buf, flags|BDRV_O_CACHE_WB /* snapshot and write-back */, &bdrv_raw) == 0) { pstrcpy(bs->filename, sizeof(bs->filename), params); - } else - #endif -@@ -535,7 +548,7 @@ void xenstore_parse_domain_config(int hv + } + #else +@@ -641,7 +654,7 @@ void xenstore_parse_domain_config(int hv } } pstrcpy(bs->filename, sizeof(bs->filename), params); -- if (bdrv_open2(bs, params, BDRV_O_CACHE_WB /* snapshot and write-back */, format) < 0) { -+ if (bdrv_open2(bs, params, flags|BDRV_O_CACHE_WB /* snapshot and write-back */, format) < 0) { +- if (bdrv_open2(bs, params, BDRV_O_CACHE_WB /* snapshot and write-back */, format) < 0) ++ if (bdrv_open2(bs, params, flags|BDRV_O_CACHE_WB /* snapshot and write-back */, format) < 0) fprintf(stderr, "qemu: could not open vbd '%s' or hard disk image '%s' (drv '%s' format '%s')\n", buf, params, drv ? drv : "?", format ? format->format_name : "0"); - } else { - char* snapshot = get_snapshot_name(atoi(e_danger[i])); + } + diff --git a/blktap-pv-cdrom.patch b/blktap-pv-cdrom.patch index 5050436..ccaf60a 100644 --- a/blktap-pv-cdrom.patch +++ b/blktap-pv-cdrom.patch @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/blktap/drivers/block-cdrom.c +Index: xen-4.0.0-testing/tools/blktap/drivers/block-cdrom.c =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/blktap/drivers/block-cdrom.c -@@ -0,0 +1,536 @@ ++++ xen-4.0.0-testing/tools/blktap/drivers/block-cdrom.c +@@ -0,0 +1,535 @@ +/* block-cdrom.c + * + * simple slow synchronous cdrom disk implementation. Based off @@ -42,7 +42,6 @@ Index: xen-3.4.1-testing/tools/blktap/drivers/block-cdrom.c +#include +#include +#include -+#include +#include +#include +#include @@ -539,11 +538,11 @@ Index: xen-3.4.1-testing/tools/blktap/drivers/block-cdrom.c + .td_get_parent_id = tdcdrom_get_parent_id, + .td_validate_parent = tdcdrom_validate_parent +}; -Index: xen-3.4.1-testing/xen/include/public/io/cdromif.h +Index: xen-4.0.0-testing/xen/include/public/io/cdromif.h =================================================================== --- /dev/null -+++ xen-3.4.1-testing/xen/include/public/io/cdromif.h -@@ -0,0 +1,120 @@ ++++ xen-4.0.0-testing/xen/include/public/io/cdromif.h +@@ -0,0 +1,122 @@ +/****************************************************************************** + * cdromif.h + * @@ -574,6 +573,8 @@ Index: xen-3.4.1-testing/xen/include/public/io/cdromif.h +#ifndef __XEN_PUBLIC_IO_CDROMIF_H__ +#define __XEN_PUBLIC_IO_CDROMIF_H__ + ++#include ++ +/* + * Queries backend for CDROM support + */ @@ -664,23 +665,23 @@ Index: xen-3.4.1-testing/xen/include/public/io/cdromif.h + sizeof(struct vcd_generic_command) - sizeof(struct request_sense)) + +#endif -Index: xen-3.4.1-testing/tools/blktap/drivers/Makefile +Index: xen-4.0.0-testing/tools/blktap/drivers/Makefile =================================================================== ---- xen-3.4.1-testing.orig/tools/blktap/drivers/Makefile -+++ xen-3.4.1-testing/tools/blktap/drivers/Makefile -@@ -20,8 +20,9 @@ CRYPT_LIB := -lcrypto - $(warning === libgcrypt not installed: falling back to libcrypto ===) +--- xen-4.0.0-testing.orig/tools/blktap/drivers/Makefile ++++ xen-4.0.0-testing/tools/blktap/drivers/Makefile +@@ -28,8 +28,9 @@ CFLAGS += -DMEMSHR + MEMSHRLIBS += $(MEMSHR_DIR)/libmemshr.a endif --LDFLAGS_blktapctrl := $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenstore) -L../lib -lblktap +-LDFLAGS_blktapctrl := $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenstore) $(MEMSHRLIBS) -L../lib -lblktap -lrt -lm -LDFLAGS_img := $(LIBAIO_DIR)/libaio.a $(CRYPT_LIB) -lpthread -lz +LDFLAGS_xen := $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenstore) -+LDFLAGS_blktapctrl := $(LDFLAGS_xen) -L../lib -lblktap ++LDFLAGS_blktapctrl := $(LDFLAGS_xen) $(MEMSHRLIBS) -L../lib -lblktap -lrt -lm +LDFLAGS_img := $(LIBAIO_DIR)/libaio.a $(CRYPT_LIB) -lpthread -lz $(LDFLAGS_xen) BLK-OBJS-y := block-aio.o BLK-OBJS-y += block-sync.o -@@ -29,6 +30,7 @@ BLK-OBJS-y += block-vmdk.o +@@ -37,6 +38,7 @@ BLK-OBJS-y += block-vmdk.o BLK-OBJS-y += block-ram.o BLK-OBJS-y += block-qcow.o BLK-OBJS-y += block-qcow2.o @@ -688,10 +689,10 @@ Index: xen-3.4.1-testing/tools/blktap/drivers/Makefile BLK-OBJS-y += aes.o BLK-OBJS-y += tapaio.o BLK-OBJS-$(CONFIG_Linux) += blk_linux.o -Index: xen-3.4.1-testing/tools/blktap/drivers/tapdisk.h +Index: xen-4.0.0-testing/tools/blktap/drivers/tapdisk.h =================================================================== ---- xen-3.4.1-testing.orig/tools/blktap/drivers/tapdisk.h -+++ xen-3.4.1-testing/tools/blktap/drivers/tapdisk.h +--- xen-4.0.0-testing.orig/tools/blktap/drivers/tapdisk.h ++++ xen-4.0.0-testing/tools/blktap/drivers/tapdisk.h @@ -137,6 +137,9 @@ struct tap_disk { int (*td_get_parent_id) (struct disk_driver *dd, struct disk_id *id); int (*td_validate_parent)(struct disk_driver *dd, @@ -736,11 +737,11 @@ Index: xen-3.4.1-testing/tools/blktap/drivers/tapdisk.h }; typedef struct driver_list_entry { -Index: xen-3.4.1-testing/tools/blktap/lib/blktaplib.h +Index: xen-4.0.0-testing/tools/blktap/lib/blktaplib.h =================================================================== ---- xen-3.4.1-testing.orig/tools/blktap/lib/blktaplib.h -+++ xen-3.4.1-testing/tools/blktap/lib/blktaplib.h -@@ -220,6 +220,7 @@ typedef struct msg_pid { +--- xen-4.0.0-testing.orig/tools/blktap/lib/blktaplib.h ++++ xen-4.0.0-testing/tools/blktap/lib/blktaplib.h +@@ -219,6 +219,7 @@ typedef struct msg_pid { #define DISK_TYPE_RAM 3 #define DISK_TYPE_QCOW 4 #define DISK_TYPE_QCOW2 5 @@ -748,10 +749,10 @@ Index: xen-3.4.1-testing/tools/blktap/lib/blktaplib.h /* xenstore/xenbus: */ #define DOMNAME "Domain-0" -Index: xen-3.4.1-testing/xen/include/public/io/blkif.h +Index: xen-4.0.0-testing/xen/include/public/io/blkif.h =================================================================== ---- xen-3.4.1-testing.orig/xen/include/public/io/blkif.h -+++ xen-3.4.1-testing/xen/include/public/io/blkif.h +--- xen-4.0.0-testing.orig/xen/include/public/io/blkif.h ++++ xen-4.0.0-testing/xen/include/public/io/blkif.h @@ -76,6 +76,10 @@ * "feature-flush-cache" node! */ @@ -763,10 +764,10 @@ Index: xen-3.4.1-testing/xen/include/public/io/blkif.h /* * Maximum scatter/gather segments per request. -Index: xen-3.4.1-testing/tools/blktap/drivers/tapdisk.c +Index: xen-4.0.0-testing/tools/blktap/drivers/tapdisk.c =================================================================== ---- xen-3.4.1-testing.orig/tools/blktap/drivers/tapdisk.c -+++ xen-3.4.1-testing/tools/blktap/drivers/tapdisk.c +--- xen-4.0.0-testing.orig/tools/blktap/drivers/tapdisk.c ++++ xen-4.0.0-testing/tools/blktap/drivers/tapdisk.c @@ -735,6 +735,22 @@ static void get_io_request(struct td_sta goto out; } @@ -790,15 +791,15 @@ Index: xen-3.4.1-testing/tools/blktap/drivers/tapdisk.c default: DPRINTF("Unknown block operation\n"); break; -Index: xen-3.4.1-testing/tools/python/xen/xend/server/BlktapController.py +Index: xen-4.0.0-testing/tools/python/xen/xend/server/BlktapController.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/server/BlktapController.py -+++ xen-3.4.1-testing/tools/python/xen/xend/server/BlktapController.py -@@ -14,6 +14,7 @@ blktap_disk_types = [ +--- xen-4.0.0-testing.orig/tools/python/xen/xend/server/BlktapController.py ++++ xen-4.0.0-testing/tools/python/xen/xend/server/BlktapController.py +@@ -20,6 +20,7 @@ blktap1_disk_types = [ 'ram', 'qcow', 'qcow2', + 'cdrom', - 'ioemu', - 'tapdisk', + ] + diff --git a/blktap.patch b/blktap.patch index 4947a8b..7be792a 100644 --- a/blktap.patch +++ b/blktap.patch @@ -1,11 +1,11 @@ bug #239173 bug #242953 -Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -2940,7 +2940,7 @@ class XendDomainInfo: +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py +@@ -3262,7 +3262,7 @@ class XendDomainInfo: (fn, BOOTLOADER_LOOPBACK_DEVICE)) vbd = { @@ -14,23 +14,23 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py 'device': BOOTLOADER_LOOPBACK_DEVICE, } -Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c +Index: xen-4.0.0-testing/tools/ioemu-remote/xenstore.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/xenstore.c -+++ xen-3.4.1-testing/tools/ioemu-remote/xenstore.c -@@ -311,9 +311,9 @@ void xenstore_parse_domain_config(int hv +--- xen-4.0.0-testing.orig/tools/ioemu-remote/xenstore.c ++++ xen-4.0.0-testing/tools/ioemu-remote/xenstore.c +@@ -396,9 +396,9 @@ void xenstore_parse_domain_config(int hv { char **e_danger = NULL; char *buf = NULL; - char *fpath = NULL, *bpath = NULL, + char *fpath = NULL, *bpath = NULL, *btype = NULL, *dev = NULL, *params = NULL, *drv = NULL; -- int i, any_hdN = 0, ret; -+ int i, any_hdN = 0, ret, is_tap; +- int i, ret; ++ int i, ret, is_tap; unsigned int len, num, hd_index, pci_devid = 0; BlockDriverState *bs; BlockDriver *format; -@@ -353,6 +353,14 @@ void xenstore_parse_domain_config(int hv +@@ -438,6 +438,14 @@ void xenstore_parse_domain_config(int hv e_danger[i]); if (bpath == NULL) continue; @@ -45,7 +45,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c /* read the name of the device */ if (pasprintf(&buf, "%s/dev", bpath) == -1) continue; -@@ -662,6 +670,7 @@ void xenstore_parse_domain_config(int hv +@@ -712,6 +720,7 @@ void xenstore_parse_domain_config(int hv free(danger_type); free(params); free(dev); diff --git a/blktapctrl-default-to-ioemu.patch b/blktapctrl-default-to-ioemu.patch index 3719937..f4633c0 100644 --- a/blktapctrl-default-to-ioemu.patch +++ b/blktapctrl-default-to-ioemu.patch @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/blktap/drivers/tapdisk.h +Index: xen-4.0.0-testing/tools/blktap/drivers/tapdisk.h =================================================================== ---- xen-3.4.1-testing.orig/tools/blktap/drivers/tapdisk.h -+++ xen-3.4.1-testing/tools/blktap/drivers/tapdisk.h +--- xen-4.0.0-testing.orig/tools/blktap/drivers/tapdisk.h ++++ xen-4.0.0-testing/tools/blktap/drivers/tapdisk.h @@ -168,7 +168,7 @@ static disk_info_t aio_disk = { "raw image (aio)", "aio", diff --git a/block-dmmd b/block-dmmd new file mode 100644 index 0000000..eb52a02 --- /dev/null +++ b/block-dmmd @@ -0,0 +1,255 @@ +#! /bin/bash + +# Usage: block-dmmd [add args | remove args] +# +# the xm config file should have something like: +# dmmd:md;/dev/md0;md;/dev/md1;lvm;/dev/vg1/lv1 +# or +# dmmd:lvm;/dev/vg1/lv1;lvm;/dev/vg1/lv2;md;/dev/md0 +# note the last device will be used for VM + +# History: +# 2009-06-09, mh@novell.com: +# Emit debugging messages into a temporary file; if no longer needed, +# just comment the exec I/O redirection below +# Make variables used in functions local to avoid global overridings +# Use vgscan and vgchange where required +# Use the C locale to avoid dealing with localized messages +# Assign output from assembling an MD device to a variable to aid debugging + +# We do not want to deal with localized messages: +LANG=C +LC_MESSAGES=C +export LANG LC_MESSAGES + +dir=$(dirname "$0") +. "$dir/block-common.sh" + +#exec >> /tmp/block-dmmd-`date +%F_%T.%N`.log 2>&1 +echo "" +date +set -x +echo shell-flags: $- +command=$1 + +# We check for errors ourselves: +set +e + +function run_mdadm() +{ + local mdadm_cmd=$1 + local msg + local rc + + msg="`/sbin/mdadm $mdadm_cmd 2>&1`" + rc=$? + case "$msg" in + *"has been started"* | *"already active"* ) + return 0 + ;; + *"is already in use"* ) + : hmm, might be used by another device in this domU + : leave it to upper layers to detect a real error + return 2 + ;; + * ) + return $rc + ;; + esac + + return 1 +} + +function activate_md() +{ + local par=$1 + local already_active=0 cfg dev rc t + + if [ ${par} = ${par%%(*} ]; then + # No configuration file specified: + dev=$par + cfd= + else + dev=${par%%(*} + t=${par#*(} + cfg="-c ${t%%)*}" + fi + if /sbin/mdadm -Q -D $dev; then + already_active=1 + fi + run_mdadm "-A $dev $cfg" + rc=$? + if [ $already_active -eq 1 ] && [ $rc -eq 2 ]; then + return 0 + fi + return $rc +} + +function deactivate_md () +{ + local par=$1 # Make it explicitly local + + ## We need the device name only while deactivating + /sbin/mdadm -S ${par%%(*} + return $? +} + +function activate_lvm () +{ + # First scan for PVs and VGs; we may then have to activate the VG + # first, but can ignore errors: + /sbin/pvscan || : + /sbin/vgscan --mknodes || : + /sbin/vgchange -ay ${1%/*} || : + /sbin/lvchange -ay $1 + return $? +} + +function deactivate_lvm () +{ + /sbin/lvchange -an $1 + if [ $? -eq 0 ]; then + # We may have to deactivate the VG now, but can ignore errors: + /sbin/vgchange -an ${1%/*} || : + # Maybe we need to cleanup the LVM cache: + /sbin/vgscan --mknodes || : + return 0 + fi + return 1 +} + +BP=100 +SP=$BP +VBD= + +declare -a stack +function push () +{ + if [ -z "$1" ]; then + return + fi + let "SP -= 1" + stack[$SP]="${1}" + return +} +function pop () +{ + VBD= + + if [ "$SP" -eq "$BP" ]; then + return + fi + + VBD=${stack[$SP]} + let "SP += 1" + return +} +function activate_dmmd () +{ +# echo $1 $2 + case $1 in + md) + activate_md $2 + return + ;; + lvm) + activate_lvm $2 + return + ;; + esac +} +function deactivate_dmmd() +{ + case "$1" in + md) + deactivate_md $2 + return + ;; + lvm) + deactivate_lvm $2 + return + ;; + esac +} +function cleanup_stack () +{ + while [ 1 ]; do + pop + if [ -z "$VBD" ]; then + break + fi + deactivate_dmmd $VBD + done + return +} + +function parse_par () +{ + local ac par rc s t # Make these explicitly local vars + + ac=$1 + par="$2" + + echo "parse_paring $1, $2" + par="$par;" + while [ 1 ]; do + t=${par%%;*} + if [ -z "$t" ]; then + return 0 + fi + par=${par#*;} + + s=${par%%;*} + if [ -z "$s" ]; then + return 1 + fi + par=${par#*;} + + echo "type is $t, dev is $s" + if [ "$ac" = "activate" ]; then + activate_dmmd $t $s + rc=$? + if [ $rc -ne 0 ]; then + return 1 + fi + fi + echo "push $t $s" + push "$t $s" + + done +} + +echo $command + +case "$command" in + add) + p=`xenstore-read $XENBUS_PATH/params` || true + claim_lock "dmmd" + dmmd=$p + echo "before parse_par $dmmd" + parse_par activate "$dmmd" + rc=$? + echo "reach here with rc: $rc" + if [ $rc -ne 0 ]; then + cleanup_stack + release_lock "dmmd" + exit 1 + fi + claim_lock "block" + xenstore-write $XENBUS_PATH/node ${dmmd##*;} + write_dev ${dmmd##*;} + release_lock "block" + release_lock "dmmd" + exit 0 + ;; + + remove) + p=`xenstore-read $XENBUS_PATH/params` || true + claim_lock "dmmd" + dmmd=$p + parse_par noactivate "$dmmd" + cleanup_stack + release_lock "dmmd" + exit 0 + ;; +esac diff --git a/block-flags.diff b/block-flags.diff index 4267f04..7eae479 100644 --- a/block-flags.diff +++ b/block-flags.diff @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/hotplug/Linux/block +Index: xen-3.5.0-testing/tools/hotplug/Linux/block =================================================================== ---- xen-3.4.1-testing.orig/tools/hotplug/Linux/block -+++ xen-3.4.1-testing/tools/hotplug/Linux/block +--- xen-3.5.0-testing.orig/tools/hotplug/Linux/block ++++ xen-3.5.0-testing/tools/hotplug/Linux/block @@ -225,11 +225,14 @@ case "$command" in ;; diff --git a/block-losetup-retry.diff b/block-losetup-retry.diff index b8fa650..ea3d73c 100644 --- a/block-losetup-retry.diff +++ b/block-losetup-retry.diff @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/hotplug/Linux/block +Index: xen-3.5.0-testing/tools/hotplug/Linux/block =================================================================== ---- xen-3.4.1-testing.orig/tools/hotplug/Linux/block -+++ xen-3.4.1-testing/tools/hotplug/Linux/block +--- xen-3.5.0-testing.orig/tools/hotplug/Linux/block ++++ xen-3.5.0-testing/tools/hotplug/Linux/block @@ -241,107 +241,111 @@ case "$command" in mount it read-write in a guest domain." fi diff --git a/bridge-bonding.diff b/bridge-bonding.diff index 8a6c1a1..a63b33d 100644 --- a/bridge-bonding.diff +++ b/bridge-bonding.diff @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/hotplug/Linux/network-bridge +Index: xen-4.0.0-testing/tools/hotplug/Linux/network-bridge =================================================================== ---- xen-3.4.1-testing.orig/tools/hotplug/Linux/network-bridge -+++ xen-3.4.1-testing/tools/hotplug/Linux/network-bridge +--- xen-4.0.0-testing.orig/tools/hotplug/Linux/network-bridge ++++ xen-4.0.0-testing/tools/hotplug/Linux/network-bridge @@ -241,6 +241,9 @@ op_start () { return fi diff --git a/bridge-hostonly.diff b/bridge-hostonly.diff deleted file mode 100644 index 61ca70d..0000000 --- a/bridge-hostonly.diff +++ /dev/null @@ -1,82 +0,0 @@ -Add support for "hostonly" xen bridges. - -Add support for "hostonly" networking, i.e. create a bridge without a -physical network device linked in. The virtual machines can see each -other and the host, but can't (directly) talk to the outside. Pass -"netdev=none" to the network-bridge script to activate this. - -I'm using this on a laptop which has different network connections at -different times (wired / wireless), so it is inconvinient to add the -physical device into the bridge. In case the laptop is offline the -virtual network still works just fine. It also avoids the problem that -bridging doesn't work with wireless due to being limited to one mac -address then. - -dom0 on that laptop also runs a dhcp server for the virtual network. -Guests can talk to the internet via apache configured as http proxy. -Another possible approach for guest internet access is NATing the -virtual network. - -Signed-off-by: Gerd Hoffmann ---- - tools/examples/network-bridge | 37 +++++++++++++++++++++++++++++++++++-- - 1 file changed, 35 insertions(+), 2 deletions(-) - -Index: xen-3.4.0-testing/tools/hotplug/Linux/network-bridge -=================================================================== ---- xen-3.4.0-testing.orig/tools/hotplug/Linux/network-bridge -+++ xen-3.4.0-testing/tools/hotplug/Linux/network-bridge -@@ -316,6 +316,31 @@ op_stop () { - for vlan in $vlans ; do ifup $vlan ; done - } - -+op_start_hostonly () { -+ if [ "${bridge}" = "null" ] ; then -+ return -+ fi -+ if link_exists "${bridge}"; then -+ return -+ fi -+ -+ create_bridge ${bridge} -+ setup_bridge_port ${vif0} -+ add_to_bridge ${bridge} ${vif0} -+} -+ -+op_stop_hostonly () { -+ if [ "${bridge}" = "null" ]; then -+ return -+ fi -+ if ! link_exists "$bridge"; then -+ return -+ fi -+ -+ brctl delbr ${bridge} -+} -+ -+ - # adds $dev to $bridge but waits for $dev to be in running state first - add_to_bridge2() { - local bridge=$1 -@@ -341,11 +366,19 @@ add_to_bridge2() { - - case "$command" in - start) -- op_start -+ if test "$netdev" = "none"; then -+ op_start_hostonly -+ else -+ op_start -+ fi - ;; - - stop) -- op_stop -+ if test "$netdev" = "none"; then -+ op_stop_hostonly -+ else -+ op_stop -+ fi - ;; - - status) diff --git a/bridge-opensuse.patch b/bridge-opensuse.patch index 43727c5..3a60e82 100644 --- a/bridge-opensuse.patch +++ b/bridge-opensuse.patch @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/hotplug/Linux/network-bridge +Index: xen-4.0.0-testing/tools/hotplug/Linux/network-bridge =================================================================== ---- xen-3.4.1-testing.orig/tools/hotplug/Linux/network-bridge -+++ xen-3.4.1-testing/tools/hotplug/Linux/network-bridge +--- xen-4.0.0-testing.orig/tools/hotplug/Linux/network-bridge ++++ xen-4.0.0-testing/tools/hotplug/Linux/network-bridge @@ -262,18 +262,18 @@ op_stop () { transfer_addrs ${bridge} ${pdev} if ! ifdown ${bridge}; then diff --git a/bridge-record-creation.patch b/bridge-record-creation.patch index 31946b3..0efba44 100644 --- a/bridge-record-creation.patch +++ b/bridge-record-creation.patch @@ -1,15 +1,15 @@ -Index: xen-3.4.1-testing/tools/hotplug/Linux/network-bridge +Index: xen-3.5.0-testing/tools/hotplug/Linux/network-bridge =================================================================== ---- xen-3.4.1-testing.orig/tools/hotplug/Linux/network-bridge -+++ xen-3.4.1-testing/tools/hotplug/Linux/network-bridge +--- xen-3.5.0-testing.orig/tools/hotplug/Linux/network-bridge ++++ xen-3.5.0-testing/tools/hotplug/Linux/network-bridge @@ -249,6 +249,11 @@ op_start () { create_bridge ${tdev} -+ # Record creation of bridge in /dev/shm/sysconfig/xenbridges so other ++ # Record creation of bridge in /dev/.sysconfig/network/xenbridges so other + # tools, e.g. yast2 lan, know that Xen bridging is active. -+ [ -d /dev/shm/sysconfig/xenbridges ] || mkdir /dev/shm/sysconfig/xenbridges -+ touch /dev/shm/sysconfig/xenbridges/${bridge} ++ [ -d /dev/.sysconfig/network/xenbridges ] || mkdir /dev/.sysconfig/network/xenbridges ++ touch /dev/.sysconfig/network/xenbridges/${bridge} + preiftransfer ${netdev} transfer_addrs ${netdev} ${tdev} @@ -18,11 +18,11 @@ Index: xen-3.4.1-testing/tools/hotplug/Linux/network-bridge ip link set ${pdev} name ${netdev} do_ifup ${netdev} -+ # Remove record of bridge from /dev/shm/sysconfig/xenbridges ... -+ rm -f /dev/shm/sysconfig/xenbridges/${bridge} ++ # Remove record of bridge from /dev/.sysconfig/network/xenbridges ... ++ rm -f /dev/.sysconfig/network/xenbridges/${bridge} + # ... and directory itself if empty -+ if [ -z "$(ls -A /dev/shm/sysconfig/xenbridges 2>/dev/null)" ]; then -+ rmdir /dev/shm/sysconfig/xenbridges ++ if [ -z "$(ls -A /dev/.sysconfig/network/xenbridges 2>/dev/null)" ]; then ++ rmdir /dev/.sysconfig/network/xenbridges + fi + for vlan in $vlans ; do ifup $vlan ; done diff --git a/bridge-vlan.diff b/bridge-vlan.diff index 500587b..a513295 100644 --- a/bridge-vlan.diff +++ b/bridge-vlan.diff @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/hotplug/Linux/network-bridge +Index: xen-4.0.0-testing/tools/hotplug/Linux/network-bridge =================================================================== ---- xen-3.4.1-testing.orig/tools/hotplug/Linux/network-bridge -+++ xen-3.4.1-testing/tools/hotplug/Linux/network-bridge +--- xen-4.0.0-testing.orig/tools/hotplug/Linux/network-bridge ++++ xen-4.0.0-testing/tools/hotplug/Linux/network-bridge @@ -191,6 +191,28 @@ antispoofing () { iptables -A FORWARD -m physdev --physdev-in ${pdev} -j ACCEPT } diff --git a/build-tapdisk-ioemu.patch b/build-tapdisk-ioemu.patch index 01d7e96..ca20c55 100644 --- a/build-tapdisk-ioemu.patch +++ b/build-tapdisk-ioemu.patch @@ -15,25 +15,26 @@ Signed-off-by: Kevin Wolf tapdisk-ioemu.c | 17 ----------------- 4 files changed, 17 insertions(+), 26 deletions(-) -Index: xen-3.4.1-testing/tools/ioemu-remote/Makefile +Index: xen-4.0.0-testing/tools/ioemu-remote/Makefile =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/Makefile -+++ xen-3.4.1-testing/tools/ioemu-remote/Makefile -@@ -46,13 +46,6 @@ $(filter %-user,$(SUBDIR_RULES)): libqem +--- xen-4.0.0-testing.orig/tools/ioemu-remote/Makefile ++++ xen-4.0.0-testing/tools/ioemu-remote/Makefile +@@ -46,14 +46,6 @@ $(filter %-user,$(SUBDIR_RULES)): libqem recurse-all: $(SUBDIR_RULES) --tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/libxc --tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/blktap/lib --tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore --tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/include +-CPPFLAGS += -I$(XEN_ROOT)/tools/libxc +-CPPFLAGS += -I$(XEN_ROOT)/tools/blktap/lib +-CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore +-CPPFLAGS += -I$(XEN_ROOT)/tools/include +- -tapdisk-ioemu: tapdisk-ioemu.c cutils.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c hw/xen_blktap.c osdep.c - $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS) - ####################################################################### # BLOCK_OBJS is code used by both qemu system emulation and qemu-img -@@ -71,6 +64,21 @@ endif +@@ -72,6 +64,21 @@ endif BLOCK_OBJS += block-raw-posix.o endif @@ -55,10 +56,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/Makefile ###################################################################### # libqemu_common.a: Target independent part of system emulation. The # long term path is to suppress *all* target specific code in case of -Index: xen-3.4.1-testing/tools/ioemu-remote/configure +Index: xen-4.0.0-testing/tools/ioemu-remote/configure =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/configure -+++ xen-3.4.1-testing/tools/ioemu-remote/configure +--- xen-4.0.0-testing.orig/tools/ioemu-remote/configure ++++ xen-4.0.0-testing/tools/ioemu-remote/configure @@ -1508,7 +1508,7 @@ bsd) ;; esac @@ -68,10 +69,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/configure if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then tools="qemu-img\$(EXESUF) $tools" if [ "$linux" = "yes" ] ; then -Index: xen-3.4.1-testing/tools/ioemu-remote/qemu-tool.c +Index: xen-4.0.0-testing/tools/ioemu-remote/qemu-tool.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/qemu-tool.c -+++ xen-3.4.1-testing/tools/ioemu-remote/qemu-tool.c +--- xen-4.0.0-testing.orig/tools/ioemu-remote/qemu-tool.c ++++ xen-4.0.0-testing/tools/ioemu-remote/qemu-tool.c @@ -68,7 +68,7 @@ void qemu_bh_delete(QEMUBH *bh) qemu_free(bh); } @@ -81,10 +82,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/qemu-tool.c IOCanRWHandler *fd_read_poll, IOHandler *fd_read, IOHandler *fd_write, -Index: xen-3.4.1-testing/tools/ioemu-remote/tapdisk-ioemu.c +Index: xen-4.0.0-testing/tools/ioemu-remote/tapdisk-ioemu.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/tapdisk-ioemu.c -+++ xen-3.4.1-testing/tools/ioemu-remote/tapdisk-ioemu.c +--- xen-4.0.0-testing.orig/tools/ioemu-remote/tapdisk-ioemu.c ++++ xen-4.0.0-testing/tools/ioemu-remote/tapdisk-ioemu.c @@ -12,34 +12,12 @@ extern void qemu_aio_init(void); diff --git a/cdrom-removable.patch b/cdrom-removable.patch index 401f98d..422d00e 100644 --- a/cdrom-removable.patch +++ b/cdrom-removable.patch @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/python/xen/xend/server/HalDaemon.py +Index: xen-4.0.0-testing/tools/python/xen/xend/server/HalDaemon.py =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/python/xen/xend/server/HalDaemon.py ++++ xen-4.0.0-testing/tools/python/xen/xend/server/HalDaemon.py @@ -0,0 +1,243 @@ +#!/usr/bin/env python +# -*- mode: python; -*- @@ -246,10 +246,10 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/server/HalDaemon.py + print 'Falling off end' + + -Index: xen-3.4.1-testing/tools/python/xen/xend/server/Hald.py +Index: xen-4.0.0-testing/tools/python/xen/xend/server/Hald.py =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/python/xen/xend/server/Hald.py ++++ xen-4.0.0-testing/tools/python/xen/xend/server/Hald.py @@ -0,0 +1,125 @@ +#============================================================================ +# This library is free software; you can redistribute it and/or @@ -376,10 +376,10 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/server/Hald.py + watcher.run() + time.sleep(10) + watcher.shutdown() -Index: xen-3.4.1-testing/tools/python/xen/xend/server/SrvServer.py +Index: xen-4.0.0-testing/tools/python/xen/xend/server/SrvServer.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/server/SrvServer.py -+++ xen-3.4.1-testing/tools/python/xen/xend/server/SrvServer.py +--- xen-4.0.0-testing.orig/tools/python/xen/xend/server/SrvServer.py ++++ xen-4.0.0-testing/tools/python/xen/xend/server/SrvServer.py @@ -56,6 +56,7 @@ from xen.web.SrvDir import SrvDir from SrvRoot import SrvRoot @@ -397,13 +397,13 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/server/SrvServer.py def create(): root = SrvDir() -Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c +Index: xen-4.0.0-testing/tools/ioemu-remote/xenstore.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/xenstore.c -+++ xen-3.4.1-testing/tools/ioemu-remote/xenstore.c -@@ -503,6 +503,19 @@ void xenstore_parse_domain_config(int hv - if (bdrv_open2(bs, params, BDRV_O_CACHE_WB /* snapshot and write-back */, format) < 0) - fprintf(stderr, "qemu: could not open vbd '%s' or hard disk image '%s' (drv '%s' format '%s')\n", buf, params, drv ? drv : "?", format ? format->format_name : "0"); +--- xen-4.0.0-testing.orig/tools/ioemu-remote/xenstore.c ++++ xen-4.0.0-testing/tools/ioemu-remote/xenstore.c +@@ -513,6 +513,19 @@ void xenstore_parse_domain_config(int hv + params = newparams; + format = &bdrv_raw; } + /* if cdrom pyhsical put a watch on media-present */ + if (bdrv_get_type_hint(bs) == BDRV_TYPE_CDROM) { @@ -419,9 +419,9 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c + } + } - drives_table[nb_drives].bdrv = bs; - drives_table[nb_drives].used = 1; -@@ -920,6 +933,50 @@ void xenstore_record_dm_state(const char + #if 0 + /* Phantom VBDs are disabled because the use of paths +@@ -938,6 +951,50 @@ void xenstore_record_dm_state(const char xenstore_record_dm("state", state); } @@ -472,9 +472,9 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c void xenstore_process_event(void *opaque) { char **vec, *offset, *bpath = NULL, *buf = NULL, *drv = NULL, *image = NULL; -@@ -939,6 +996,11 @@ void xenstore_process_event(void *opaque - goto out; - } +@@ -968,6 +1025,11 @@ void xenstore_process_event(void *opaque + xenstore_watch_callbacks[i].cb(vec[XS_WATCH_TOKEN], + xenstore_watch_callbacks[i].opaque); + if (!strcmp(vec[XS_WATCH_TOKEN], "media-present")) { + xenstore_process_media_change_event(vec); diff --git a/checkpoint-rename.patch b/checkpoint-rename.patch index 6561947..4471a6c 100644 --- a/checkpoint-rename.patch +++ b/checkpoint-rename.patch @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/python/xen/xend/XendCheckpoint.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendCheckpoint.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendCheckpoint.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendCheckpoint.py -@@ -151,7 +151,7 @@ def save(fd, dominfo, network, live, dst +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendCheckpoint.py +@@ -165,7 +165,7 @@ def save(fd, dominfo, network, live, dst dominfo.destroy() dominfo.testDeviceComplete() try: diff --git a/disable_emulated_device.diff b/disable_emulated_device.diff index 80022a2..30ca259 100644 --- a/disable_emulated_device.diff +++ b/disable_emulated_device.diff @@ -1,8 +1,8 @@ -Index: xen-3.4.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +Index: xen-4.0.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c =================================================================== ---- xen-3.4.0-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -+++ xen-3.4.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -@@ -301,6 +301,11 @@ static int __devinit platform_pci_init(s +--- xen-4.0.0-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c ++++ xen-4.0.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +@@ -363,6 +363,11 @@ static int __devinit platform_pci_init(s platform_mmio = mmio_addr; platform_mmiolen = mmio_len; diff --git a/dom-print.patch b/dom-print.patch index 298ac84..c25b6b8 100644 --- a/dom-print.patch +++ b/dom-print.patch @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/xen/arch/x86/domain.c +Index: xen-4.0.0-testing/xen/arch/x86/domain.c =================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/domain.c -+++ xen-3.4.1-testing/xen/arch/x86/domain.c +--- xen-4.0.0-testing.orig/xen/arch/x86/domain.c ++++ xen-4.0.0-testing/xen/arch/x86/domain.c @@ -143,7 +143,7 @@ void dump_pageframe_info(struct domain * printk("Memory pages belonging to domain %u:\n", d->domain_id); diff --git a/domUloader.py b/domUloader.py index a46bcaf..ca48dfa 100644 --- a/domUloader.py +++ b/domUloader.py @@ -87,6 +87,7 @@ class Wholedisk: self.mapped = 0 self.partitions = [] self.pcount = 0 + self.lvm = False # Finish initialization; may raise: self.is_blk = (S_ISBLK(os.stat(pdev)[ST_MODE])) self.pcount = self.scanpartitions() @@ -104,6 +105,8 @@ class Wholedisk: for part in self.partitions: if vdev == part.vdev: return part + if len(self.partitions): + return self.partitions[0] return None def loopsetup(self): @@ -152,6 +155,31 @@ class Wholedisk: os.system("kpartx %s -d '%s'" % (kpartx_args, self.physdev())) time.sleep(0.1) retries -= 1 + + def scanlvmpartitions(self): + pcount = 0 + verbose_print("vgchange -ay '%s'" % (self.vdev)) + ret = os.system("vgchange -ay '%s' > /dev/null 2>&1" % (self.vdev)) >> 8 + if not ret: + self.lvm = True + verbose_print("lvscan | grep '/dev/%s'" % (self.vdev)) + fd = os.popen("lvscan | grep '/dev/%s'" % (self.vdev)) + for line in fd.readlines(): + line = line.strip() + (t1, lvname, t2) = line.split('\'') + pname = lvname[lvname.rfind('/')+1:] + pname = pname.strip() + pname = "/dev/mapper/" + self.vdev + "-" + pname + verbose_print("Found partition: vdev %s, pdev %s" % (self.vdev, pname)) + self.partitions.append(Partition(self, self.vdev, pname)) + pcount += 1 + fd.close() + verbose_print("vgchange -an '%s'" % (self.vdev)) + os.system("vgchange -an '%s' > /dev/null 2>&1" % (self.vdev)) + else: + verbose_print("vgchange -ay %s ... failed: -%d" % (self.vdev, ret)) + + return pcount def scanpartitions(self): """Scan device for partitions (kpartx -l) and set up data structures, @@ -159,6 +187,7 @@ class Wholedisk: self.loopsetup() # TODO: We could use fdisk -l instead and look at the type of # partitions; this way we could also detect LVM and support it. + verbose_print("kpartx %s -l '%s'" % (kpartx_args, self.physdev())) fd = os.popen("kpartx %s -l '%s'" % (kpartx_args, self.physdev())) pcount = 0 for line in fd.readlines(): @@ -175,6 +204,12 @@ class Wholedisk: self.partitions.append(Partition(self, '%s%i' % (self.vdev, pno), pname)) pcount += 1 fd.close() + + # Try lvm + if not pcount: + pcount = self.scanlvmpartitions() + + # Add self to partition table if not pcount: if self.ldev: ref = self @@ -185,12 +220,19 @@ class Wholedisk: def activatepartitions(self): "Set up loop mapping and device-mapper mappings" + verbose_print("activatepartitions") if not self.mapped: self.loopsetup() if self.pcount: verbose_print("kpartx %s -a '%s'" % (kpartx_args, self.physdev())) fd = os.popen("kpartx %s -a '%s'" % (kpartx_args, self.physdev())) fd.close() + if self.pcount and self.lvm: + verbose_print("vgchange -ay '%s'" % (self.vdev)) + ret = os.system("vgchange -ay '%s' > /dev/null 2>&1" % (self.vdev)) >> 8 + if not ret: + verbose_print("lvchange -ay '%s'" % (self.vdev)) + os.system("lvchange -ay '%s' > /dev/null 2>&1" % (self.vdev)) self.mapped += 1 def deactivatepartitions(self): @@ -198,6 +240,7 @@ class Wholedisk: Will never raise. """ + verbose_print("deactivatepartitions") if not self.mapped: return self.mapped -= 1 @@ -206,6 +249,17 @@ class Wholedisk: verbose_print("kpartx %s -d '%s'" % (kpartx_args, self.physdev())) fd = os.popen("kpartx %s -d '%s'" % (kpartx_args, self.physdev())) fd.close() + if self.pcount and self.lvm: + verbose_print("lvchange -an '%s'" % (self.vdev)) + ret = os.system("lvchange -an '%s' > /dev/null 2>&1" % (self.vdev)) >> 8 + if ret: + time.sleep(0.3) + os.system("lvchange -an '/dev/%s' > /dev/null 2>&1" % (self.vdev)) + verbose_print("vgchange -an '%s'" % (self.vdev)) + ret = os.system("vgchange -an '%s' > /dev/null 2>&1" % (self.vdev)) >> 8 + if ret: + time.sleep(0.3) + os.system("vgchange -an '%s' > /dev/null 2>&1" % (self.vdev)) self.loopclean() def __del__(self): @@ -375,7 +429,9 @@ def main(argv): "Help output (usage info)" global verbose, quiet, dryrun print >> sys.stderr, "domUloader usage: domUloader [--output=fd] [--quiet] [--dryrun] [--verbose]\n" +\ - "[--args] [--help] --entry=dev:kernel[,ramdisk] physdisk [virtdisk]\n" + "[--args] [--help] --entry=dev:kernel[,ramdisk] physdisk [virtdisk]\n" +\ + "\n" +\ + "dev format: hd[a-p][0-9]*, xvd[a-p][0-9]*, LVM-vgname-lvname\n" print >> sys.stderr, __doc__ try: @@ -432,6 +488,8 @@ def main(argv): os.chmod(tmpdir, 0750) vdev, kernel, ramdisk = parseEntry(entry) + if vdev[:vdev.find('-')] == "LVM": + vdev = vdev.split('-')[1] if not vdisk: vdisk = getWholedisk(vdev) verbose_print("vdisk not specified; guessing '%s' based on '%s'" % (vdisk, vdev)) diff --git a/dump-exec-state.patch b/dump-exec-state.patch index 2409402..be236ab 100644 --- a/dump-exec-state.patch +++ b/dump-exec-state.patch @@ -1,8 +1,6 @@ -Index: xen-3.4.1-testing/xen/arch/ia64/linux-xen/smp.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/ia64/linux-xen/smp.c -+++ xen-3.4.1-testing/xen/arch/ia64/linux-xen/smp.c -@@ -190,7 +190,7 @@ handle_IPI (int irq, void *dev_id, struc +--- 2010-01-06.orig/xen/arch/ia64/linux-xen/smp.c 2009-05-27 13:54:05.000000000 +0200 ++++ 2010-01-06/xen/arch/ia64/linux-xen/smp.c 2010-01-06 11:22:12.000000000 +0100 +@@ -189,7 +189,7 @@ handle_IPI (int irq, void *dev_id, struc * At this point the structure may be gone unless * wait is true. */ @@ -11,35 +9,31 @@ Index: xen-3.4.1-testing/xen/arch/ia64/linux-xen/smp.c /* Notify the sending CPU that the task is done. */ mb(); -Index: xen-3.4.1-testing/xen/arch/x86/smp.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/smp.c -+++ xen-3.4.1-testing/xen/arch/x86/smp.c -@@ -356,7 +356,7 @@ fastcall void smp_call_function_interrup +--- 2010-01-06.orig/xen/arch/x86/smp.c 2009-08-19 17:01:49.000000000 +0200 ++++ 2010-01-06/xen/arch/x86/smp.c 2010-01-06 11:22:12.000000000 +0100 +@@ -394,7 +394,7 @@ static void __smp_call_function_interrup - if ( call_data->wait ) + if ( call_data.wait ) { - (*func)(info); -+ (*func)(info ?: regs); ++ (*func)(info ?: get_irq_regs()); mb(); - atomic_inc(&call_data->finished); + atomic_inc(&call_data.finished); } -@@ -364,7 +364,7 @@ fastcall void smp_call_function_interrup +@@ -402,7 +402,7 @@ static void __smp_call_function_interrup { mb(); - atomic_inc(&call_data->started); + atomic_inc(&call_data.started); - (*func)(info); -+ (*func)(info ?: regs); ++ (*func)(info ?: get_irq_regs()); } irq_exit(); -Index: xen-3.4.1-testing/xen/common/keyhandler.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/common/keyhandler.c -+++ xen-3.4.1-testing/xen/common/keyhandler.c -@@ -91,14 +91,25 @@ static void show_handlers(unsigned char - key_table[i].desc); - } +--- 2010-01-06.orig/xen/common/keyhandler.c 2009-12-16 09:14:13.000000000 +0100 ++++ 2010-01-06/xen/common/keyhandler.c 2010-01-06 11:22:12.000000000 +0100 +@@ -72,14 +72,25 @@ static struct keyhandler show_handlers_k + .desc = "show this message" + }; -static void __dump_execstate(void *unused) +static void __dump_execstate(void *_regs) @@ -67,7 +61,7 @@ Index: xen-3.4.1-testing/xen/common/keyhandler.c } static void dump_registers(unsigned char key, struct cpu_user_regs *regs) -@@ -111,14 +122,12 @@ static void dump_registers(unsigned char +@@ -93,14 +104,12 @@ static void dump_registers(unsigned char printk("'%c' pressed -> dumping registers\n", key); /* Get local execution state out immediately, in case we get stuck. */ @@ -80,13 +74,11 @@ Index: xen-3.4.1-testing/xen/common/keyhandler.c if ( cpu == smp_processor_id() ) continue; - printk("\n*** Dumping CPU%d host state: ***\n", cpu); - on_selected_cpus(cpumask_of_cpu(cpu), __dump_execstate, NULL, 1, 1); + on_selected_cpus(cpumask_of(cpu), __dump_execstate, NULL, 1); } -Index: xen-3.4.1-testing/xen/include/asm-ia64/linux-xen/asm/ptrace.h -=================================================================== ---- xen-3.4.1-testing.orig/xen/include/asm-ia64/linux-xen/asm/ptrace.h -+++ xen-3.4.1-testing/xen/include/asm-ia64/linux-xen/asm/ptrace.h +--- 2010-01-06.orig/xen/include/asm-ia64/linux-xen/asm/ptrace.h 2009-05-20 08:46:00.000000000 +0200 ++++ 2010-01-06/xen/include/asm-ia64/linux-xen/asm/ptrace.h 2010-01-06 11:22:12.000000000 +0100 @@ -278,7 +278,7 @@ struct switch_stack { # define ia64_task_regs(t) (((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1) # define ia64_psr(regs) ((struct ia64_psr *) &(regs)->cr_ipsr) diff --git a/hv_tools.patch b/hv_tools.patch index 7656ff6..dd3d8c9 100644 --- a/hv_tools.patch +++ b/hv_tools.patch @@ -1,27 +1,29 @@ -Index: xen-3.4.1-testing/tools/python/xen/lowlevel/xc/xc.c +Index: xen-4.0.0-testing/tools/python/xen/lowlevel/xc/xc.c =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/lowlevel/xc/xc.c -+++ xen-3.4.1-testing/tools/python/xen/lowlevel/xc/xc.c -@@ -888,14 +888,14 @@ static PyObject *pyxc_hvm_build(XcObject +--- xen-4.0.0-testing.orig/tools/python/xen/lowlevel/xc/xc.c ++++ xen-4.0.0-testing/tools/python/xen/lowlevel/xc/xc.c +@@ -914,15 +914,15 @@ static PyObject *pyxc_hvm_build(XcObject int i; #endif char *image; - int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1; + int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1, extid = 0; + uint64_t vcpu_avail = 1; static char *kwd_list[] = { "domid", -- "memsize", "image", "target", "vcpus", "acpi", -+ "memsize", "image", "target", "vcpus", "extid", "acpi", - "apic", NULL }; -- if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiii", kwd_list, -+ if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiiii", kwd_list, +- "memsize", "image", "target", "vcpus", +- "vcpu_avail", "acpi", "apic", NULL }; +- if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iilii", kwd_list, ++ "memsize", "image", "target", "vcpus", ++ "vcpu_avail", "extid", "acpi", "apic", NULL }; ++ if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiliii", kwd_list, &dom, &memsize, &image, &target, &vcpus, -- &acpi, &apic) ) -+ &extid, &acpi, &apic) ) +- &vcpu_avail, &acpi, &apic) ) ++ &vcpu_avail, &extid, &acpi, &apic) ) return NULL; if ( target == -1 ) -@@ -921,6 +921,7 @@ static PyObject *pyxc_hvm_build(XcObject +@@ -950,6 +950,7 @@ static PyObject *pyxc_hvm_build(XcObject va_hvm->checksum -= sum; munmap(va_map, XC_PAGE_SIZE); #endif @@ -29,51 +31,51 @@ Index: xen-3.4.1-testing/tools/python/xen/lowlevel/xc/xc.c return Py_BuildValue("{}"); } -Index: xen-3.4.1-testing/tools/python/xen/xend/XendConfig.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendConfig.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendConfig.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendConfig.py -@@ -143,6 +143,7 @@ XENAPI_PLATFORM_CFG_TYPES = { - 'monitor': int, +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendConfig.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendConfig.py +@@ -150,6 +150,7 @@ XENAPI_PLATFORM_CFG_TYPES = { 'nographic': int, + 'nomigrate': int, 'pae' : int, -+ 'extid': int, ++ 'extid': int, 'rtc_timeoffset': int, + 'parallel': str, 'serial': str, - 'sdl': int, -Index: xen-3.4.1-testing/tools/python/xen/xend/image.py +Index: xen-4.0.0-testing/tools/python/xen/xend/image.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/image.py -+++ xen-3.4.1-testing/tools/python/xen/xend/image.py -@@ -762,6 +762,7 @@ class HVMImageHandler(ImageHandler): +--- xen-4.0.0-testing.orig/tools/python/xen/xend/image.py ++++ xen-4.0.0-testing/tools/python/xen/xend/image.py +@@ -841,6 +841,7 @@ class HVMImageHandler(ImageHandler): self.apic = int(vmConfig['platform'].get('apic', 0)) self.acpi = int(vmConfig['platform'].get('acpi', 0)) + self.extid = int(vmConfig['platform'].get('extid', 0)) self.guest_os_type = vmConfig['platform'].get('guest_os_type') - - -@@ -878,6 +879,7 @@ class HVMImageHandler(ImageHandler): - log.debug("memsize = %d", memmax_mb) + self.memory_sharing = int(vmConfig['memory_sharing']) + xc.dom_set_memshr(self.vm.getDomid(), self.memory_sharing) +@@ -966,6 +967,7 @@ class HVMImageHandler(ImageHandler): log.debug("target = %d", mem_mb) log.debug("vcpus = %d", self.vm.getVCpuCount()) + log.debug("vcpu_avail = %li", self.vm.getVCpuAvail()) + log.debug("extid = %d", self.extid) log.debug("acpi = %d", self.acpi) log.debug("apic = %d", self.apic) -@@ -886,6 +888,7 @@ class HVMImageHandler(ImageHandler): - memsize = memmax_mb, +@@ -975,6 +977,7 @@ class HVMImageHandler(ImageHandler): target = mem_mb, vcpus = self.vm.getVCpuCount(), + vcpu_avail = self.vm.getVCpuAvail(), + extid = self.extid, acpi = self.acpi, apic = self.apic) rc['notes'] = { 'SUSPEND_CANCEL': 1 } -Index: xen-3.4.1-testing/tools/python/xen/xm/create.py +Index: xen-4.0.0-testing/tools/python/xen/xm/create.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xm/create.py -+++ xen-3.4.1-testing/tools/python/xen/xm/create.py -@@ -229,6 +229,10 @@ gopts.var('viridian', val='VIRIDIAN', +--- xen-4.0.0-testing.orig/tools/python/xen/xm/create.py ++++ xen-4.0.0-testing/tools/python/xen/xm/create.py +@@ -242,6 +242,10 @@ gopts.var('viridian', val='VIRIDIAN', use="""Expose Viridian interface to x86 HVM guest? (Default is 0).""") @@ -84,12 +86,12 @@ Index: xen-3.4.1-testing/tools/python/xen/xm/create.py gopts.var('acpi', val='ACPI', fn=set_int, default=1, use="Disable or enable ACPI of HVM domain.") -@@ -925,7 +929,7 @@ def configure_vifs(config_devs, vals): - def configure_hvm(config_image, vals): - """Create the config for HVM devices. - """ -- args = [ 'device_model', 'pae', 'vcpus', 'boot', 'fda', 'fdb', 'timer_mode', -+ args = [ 'device_model', 'pae', 'extid', 'vcpus', 'boot', 'fda', 'fdb', 'timer_mode', - 'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'soundhw', - 'vnc', 'vncdisplay', 'vncunused', 'vncconsole', 'vnclisten', - 'sdl', 'display', 'xauthority', 'rtc_timeoffset', 'monitor', +@@ -1077,7 +1081,7 @@ def configure_hvm(config_image, vals): + 'timer_mode', + 'usb', 'usbdevice', + 'vcpus', 'vnc', 'vncconsole', 'vncdisplay', 'vnclisten', +- 'vncunused', 'viridian', 'vpt_align', ++ 'vncunused', 'viridian', 'extid', 'vpt_align', + 'xauthority', 'xen_extended_power_mgmt', 'xen_platform_pci', + 'memory_sharing' ] + diff --git a/hv_win7_eoi_bug.patch b/hv_win7_eoi_bug.patch index 2986acc..03343c9 100644 --- a/hv_win7_eoi_bug.patch +++ b/hv_win7_eoi_bug.patch @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c +Index: xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c =================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/hvm/hyperv/hv_intercept.c -+++ xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c +--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/hyperv/hv_intercept.c ++++ xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c @@ -33,6 +33,7 @@ #include @@ -10,7 +10,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c #include #include #include -@@ -987,8 +988,15 @@ hyperv_do_wr_msr(uint32_t idx, struct cp +@@ -988,8 +989,15 @@ hyperv_do_wr_msr(uint32_t idx, struct cp break; case HV_MSR_APIC_ASSIST_PAGE: /* diff --git a/hv_xen_base.patch b/hv_xen_base.patch index 181f722..a3c03dd 100644 --- a/hv_xen_base.patch +++ b/hv_xen_base.patch @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/xen/include/asm-x86/hvm/domain.h +Index: xen-4.0.0-testing/xen/include/asm-x86/hvm/domain.h =================================================================== ---- xen-3.4.1-testing.orig/xen/include/asm-x86/hvm/domain.h -+++ xen-3.4.1-testing/xen/include/asm-x86/hvm/domain.h -@@ -89,6 +89,7 @@ struct hvm_domain { +--- xen-4.0.0-testing.orig/xen/include/asm-x86/hvm/domain.h ++++ xen-4.0.0-testing/xen/include/asm-x86/hvm/domain.h +@@ -98,6 +98,7 @@ struct hvm_domain { struct vmx_domain vmx; struct svm_domain svm; }; @@ -10,22 +10,22 @@ Index: xen-3.4.1-testing/xen/include/asm-x86/hvm/domain.h }; #endif /* __ASM_X86_HVM_DOMAIN_H__ */ -Index: xen-3.4.1-testing/xen/arch/x86/hvm/Makefile +Index: xen-4.0.0-testing/xen/arch/x86/hvm/Makefile =================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/hvm/Makefile -+++ xen-3.4.1-testing/xen/arch/x86/hvm/Makefile +--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/Makefile ++++ xen-4.0.0-testing/xen/arch/x86/hvm/Makefile @@ -1,5 +1,6 @@ subdir-y += svm subdir-y += vmx +subdir-$(x86_64) += hyperv + obj-y += asid.o obj-y += emulate.o - obj-y += hvm.o -Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c +Index: xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c =================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/hvm/hvm.c -+++ xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c -@@ -46,6 +46,7 @@ +--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/hvm.c ++++ xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c +@@ -48,6 +48,7 @@ #include #include #include @@ -33,7 +33,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c #include #include #include -@@ -377,6 +378,7 @@ void hvm_domain_relinquish_resources(str +@@ -461,6 +462,7 @@ void hvm_domain_relinquish_resources(str void hvm_domain_destroy(struct domain *d) { @@ -41,9 +41,9 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c hvm_funcs.domain_destroy(d); rtc_deinit(d); stdvga_deinit(d); -@@ -680,8 +682,14 @@ int hvm_vcpu_initialise(struct vcpu *v) - { - int rc; +@@ -782,8 +784,14 @@ int hvm_vcpu_initialise(struct vcpu *v) + v->arch.hvm_vcpu.xfeature_mask = XSTATE_FP_SSE; + } + if ((rc = hyperx_intercept_vcpu_initialize(v)) != 0) + goto fail1; @@ -56,7 +56,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c if ( (rc = hvm_funcs.vcpu_initialise(v)) != 0 ) goto fail2; -@@ -732,12 +740,14 @@ int hvm_vcpu_initialise(struct vcpu *v) +@@ -834,12 +842,14 @@ int hvm_vcpu_initialise(struct vcpu *v) hvm_funcs.vcpu_destroy(v); fail2: vlapic_destroy(v); @@ -71,43 +71,43 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c tasklet_kill(&v->arch.hvm_vcpu.assert_evtchn_irq_tasklet); hvm_vcpu_cacheattr_destroy(v); vlapic_destroy(v); -@@ -1690,7 +1700,7 @@ void hvm_cpuid(unsigned int input, unsig +@@ -1897,7 +1907,7 @@ void hvm_cpuid(unsigned int input, unsig return; - if ( cpuid_hypervisor_leaves(input, eax, ebx, ecx, edx) ) + if ( cpuid_hypervisor_leaves(input, count, eax, ebx, ecx, edx) ) - return; + goto hvm_cpuid_done; domain_cpuid(v->domain, input, *ecx, eax, ebx, ecx, edx); -@@ -1702,6 +1712,8 @@ void hvm_cpuid(unsigned int input, unsig - if ( vlapic_hw_disabled(vcpu_vlapic(v)) ) - __clear_bit(X86_FEATURE_APIC & 31, edx); +@@ -1964,6 +1974,8 @@ void hvm_cpuid(unsigned int input, unsig + *edx &= ~bitmaskof(X86_FEATURE_RDTSCP); + break; } +hvm_cpuid_done: + hyperx_intercept_do_cpuid(input, eax, ebx, ecx, edx); } void hvm_rdtsc_intercept(struct cpu_user_regs *regs) -@@ -1801,6 +1813,8 @@ int hvm_msr_read_intercept(struct cpu_us - break; - - default: -+ if (hyperx_intercept_do_msr_read(ecx, regs)) -+ return X86EMUL_OKAY; - return hvm_funcs.msr_read_intercept(regs); +@@ -2064,6 +2076,8 @@ int hvm_msr_read_intercept(struct cpu_us + break; + /* ret == 0, This is not an MCE MSR, see other MSRs */ + else if (!ret) ++ if (hyperx_intercept_do_msr_read(ecx, regs)) ++ return X86EMUL_OKAY; + return hvm_funcs.msr_read_intercept(regs); } -@@ -1889,6 +1903,8 @@ int hvm_msr_write_intercept(struct cpu_u - break; - - default: -+ if (hyperx_intercept_do_msr_write(ecx, regs)) -+ return X86EMUL_OKAY; - return hvm_funcs.msr_write_intercept(regs); +@@ -2162,6 +2176,8 @@ int hvm_msr_write_intercept(struct cpu_u + else if ( ret ) + break; + else if (!ret) ++ if (hyperx_intercept_do_msr_write(ecx, regs)) ++ return X86EMUL_OKAY; + return hvm_funcs.msr_write_intercept(regs); } -@@ -2056,6 +2072,10 @@ int hvm_do_hypercall(struct cpu_user_reg +@@ -2354,6 +2370,10 @@ int hvm_do_hypercall(struct cpu_user_reg case 0: break; } @@ -118,7 +118,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c if ( (eax & 0x80000000) && is_viridian_domain(curr->domain) ) return viridian_hypercall(regs); -@@ -2572,6 +2592,18 @@ long do_hvm_op(unsigned long op, XEN_GUE +@@ -2888,6 +2908,18 @@ long do_hvm_op(unsigned long op, XEN_GUE rc = -EINVAL; break; @@ -137,11 +137,11 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c } if ( rc == 0 ) -Index: xen-3.4.1-testing/xen/include/public/arch-x86/hvm/save.h +Index: xen-4.0.0-testing/xen/include/public/arch-x86/hvm/save.h =================================================================== ---- xen-3.4.1-testing.orig/xen/include/public/arch-x86/hvm/save.h -+++ xen-3.4.1-testing/xen/include/public/arch-x86/hvm/save.h -@@ -432,9 +432,24 @@ struct hvm_viridian_context { +--- xen-4.0.0-testing.orig/xen/include/public/arch-x86/hvm/save.h ++++ xen-4.0.0-testing/xen/include/public/arch-x86/hvm/save.h +@@ -431,9 +431,24 @@ struct hvm_viridian_context { DECLARE_HVM_SAVE_TYPE(VIRIDIAN, 15, struct hvm_viridian_context); @@ -167,10 +167,10 @@ Index: xen-3.4.1-testing/xen/include/public/arch-x86/hvm/save.h +#define HVM_SAVE_CODE_MAX 17 #endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */ -Index: xen-3.4.1-testing/xen/arch/x86/hvm/vlapic.c +Index: xen-4.0.0-testing/xen/arch/x86/hvm/vlapic.c =================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/hvm/vlapic.c -+++ xen-3.4.1-testing/xen/arch/x86/hvm/vlapic.c +--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/vlapic.c ++++ xen-4.0.0-testing/xen/arch/x86/hvm/vlapic.c @@ -34,6 +34,7 @@ #include #include @@ -179,7 +179,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/vlapic.c #include #include #include -@@ -307,6 +308,7 @@ static int vlapic_accept_sipi(struct vcp +@@ -291,6 +292,7 @@ static int vlapic_accept_sipi(struct vcp hvm_vcpu_reset_state(v, trampoline_vector << 8, 0); vcpu_unpause(v); @@ -187,10 +187,10 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/vlapic.c return X86EMUL_OKAY; } -Index: xen-3.4.1-testing/xen/include/public/hvm/params.h +Index: xen-4.0.0-testing/xen/include/public/hvm/params.h =================================================================== ---- xen-3.4.1-testing.orig/xen/include/public/hvm/params.h -+++ xen-3.4.1-testing/xen/include/public/hvm/params.h +--- xen-4.0.0-testing.orig/xen/include/public/hvm/params.h ++++ xen-4.0.0-testing/xen/include/public/hvm/params.h @@ -106,6 +106,8 @@ /* Boolean: Enable aligning all periodic vpts to reduce interrupts */ #define HVM_PARAM_VPT_ALIGN 16 diff --git a/hv_xen_extension.patch b/hv_xen_extension.patch index 567a802..248d69d 100644 --- a/hv_xen_extension.patch +++ b/hv_xen_extension.patch @@ -1,8 +1,8 @@ %patch -Index: xen-3.4.1-testing/xen/include/asm-x86/hvm/hvm_extensions.h +Index: xen-4.0.0-testing/xen/include/asm-x86/hvm/hvm_extensions.h =================================================================== --- /dev/null -+++ xen-3.4.1-testing/xen/include/asm-x86/hvm/hvm_extensions.h ++++ xen-4.0.0-testing/xen/include/asm-x86/hvm/hvm_extensions.h @@ -0,0 +1,183 @@ +/**************************************************************************** + | @@ -187,17 +187,17 @@ Index: xen-3.4.1-testing/xen/include/asm-x86/hvm/hvm_extensions.h +int hyperx_initialize(struct domain *d); + +#endif -Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/Makefile +Index: xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/Makefile =================================================================== --- /dev/null -+++ xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/Makefile ++++ xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/Makefile @@ -0,0 +1,2 @@ +obj-y += hv_intercept.o +obj-y += hv_hypercall.o -Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_errno.h +Index: xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_errno.h =================================================================== --- /dev/null -+++ xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_errno.h ++++ xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_errno.h @@ -0,0 +1,62 @@ +/**************************************************************************** + | @@ -261,10 +261,10 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_errno.h +#define HV_STATUS_NO_MEMORY_256PAGES 0x0103 +#define HV_STATUS_NO_MEMORY_1024PAGES 0x0104 +#endif -Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.c +Index: xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.c =================================================================== --- /dev/null -+++ xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.c ++++ xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.c @@ -0,0 +1,153 @@ +/**************************************************************************** + | @@ -419,10 +419,10 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.c + return; + } +} -Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.h +Index: xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.h =================================================================== --- /dev/null -+++ xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.h ++++ xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.h @@ -0,0 +1,46 @@ +/**************************************************************************** + | @@ -470,11 +470,11 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.h +#define HV_NOTIFY_LONG_SPIN_WAIT 0x0008 + +#endif /* HV_HYPERCALL_H */ -Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c +Index: xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c =================================================================== --- /dev/null -+++ xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c -@@ -0,0 +1,1008 @@ ++++ xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c +@@ -0,0 +1,1009 @@ +/**************************************************************************** + | + | Copyright (c) [2007, 2008] Novell, Inc. @@ -1087,6 +1087,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c +{ + struct domain *d = current->domain; + int extid = d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR]; ++ unsigned int count = *ecx; + + if (extid == 1) { + /* @@ -1107,7 +1108,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c + { + /* Get rid of the offset and let xen handle it */ + input -= 0x1000; -+ cpuid_hypervisor_leaves(input, eax, ebx, ecx, edx); ++ cpuid_hypervisor_leaves(input, count, eax, ebx, ecx, edx); + /* Setup hypercall MSR value - add the offset*/ + if (input == 0x40000002) + *ebx |= 0x1000; @@ -1452,7 +1453,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c + /* + * Establish the hypercall page for PV drivers. + */ -+ wrmsr_hypervisor_regs(0x40000000, regs->eax, regs->edx); ++ wrmsr_hypervisor_regs(0x40000000, msr_content); + break; + case HV_MSR_SYSTEM_RESET: + /* @@ -1483,10 +1484,10 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c + hvm_inject_exception(TRAP_gp_fault, 0, 0); + return (1); +} -Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_shim.h +Index: xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_shim.h =================================================================== --- /dev/null -+++ xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_shim.h ++++ xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_shim.h @@ -0,0 +1,285 @@ +/**************************************************************************** + | diff --git a/init.xend b/init.xend index b8ccdbf..d539705 100644 --- a/init.xend +++ b/init.xend @@ -91,6 +91,7 @@ case "$1" in modprobe blkbk 2>/dev/null || true modprobe xenblk 2>/dev/null || true modprobe netbk 2>/dev/null || true + modprobe gntdev 2>/dev/null || true xend start await_daemons_up ;; diff --git a/ioemu-7615-qcow2-fix-alloc_cluster_link_l2.patch b/ioemu-7615-qcow2-fix-alloc_cluster_link_l2.patch index 5b63f5e..c8e19ce 100644 --- a/ioemu-7615-qcow2-fix-alloc_cluster_link_l2.patch +++ b/ioemu-7615-qcow2-fix-alloc_cluster_link_l2.patch @@ -17,10 +17,10 @@ qcow2 image (the header is gone after three loop iterations): Signed-off-by: Kevin Wolf -Index: xen-3.4.1-testing/tools/ioemu-remote/block-qcow2.c +Index: xen-4.0.0-testing/tools/ioemu-remote/block-qcow2.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/block-qcow2.c -+++ xen-3.4.1-testing/tools/ioemu-remote/block-qcow2.c +--- xen-4.0.0-testing.orig/tools/ioemu-remote/block-qcow2.c ++++ xen-4.0.0-testing/tools/ioemu-remote/block-qcow2.c @@ -916,7 +916,7 @@ static int alloc_cluster_link_l2(BlockDr goto err; diff --git a/ioemu-bdrv-open-CACHE_WB.patch b/ioemu-bdrv-open-CACHE_WB.patch index e59ad1c..b44d0d9 100644 --- a/ioemu-bdrv-open-CACHE_WB.patch +++ b/ioemu-bdrv-open-CACHE_WB.patch @@ -1,14 +1,16 @@ ---- xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c 2009-09-21 13:26:03.000000000 +0800 -+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c 2009-09-28 16:30:13.000000000 +0800 -@@ -249,8 +249,11 @@ static int open_disk(struct td_state *s, +Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c +=================================================================== +--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.c ++++ xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c +@@ -247,8 +247,11 @@ static int open_disk(struct td_state *s, drv = blktap_drivers[i].drv; DPRINTF("%s driver specified\n", drv ? drv->format_name : "No"); - /* Open the image */ - if (bdrv_open2(bs, path, flags, drv) != 0) { + /* Open the image -+ * Use BDRV_O_CACHE_WB for write-through caching, -+ * no flags for write-back caching ++ * Use BDRV_O_CACHE_WB for write-through caching, ++ * no flags for write-back caching + */ + if (bdrv_open2(bs, path, flags|BDRV_O_CACHE_WB, drv) != 0) { fprintf(stderr, "Could not open image file %s\n", path); diff --git a/ioemu-blktap-barriers.patch b/ioemu-blktap-barriers.patch index 8fdcd21..d5547bd 100644 --- a/ioemu-blktap-barriers.patch +++ b/ioemu-blktap-barriers.patch @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c +Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_blktap.c -+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c -@@ -362,6 +362,15 @@ static void qemu_send_responses(void* op +--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.c ++++ xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c +@@ -360,6 +360,15 @@ static void qemu_send_responses(void* op } /** @@ -18,7 +18,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c * Callback function for the IO message pipe. Reads requests from the ring * and processes them (call qemu read/write functions). * -@@ -380,6 +389,7 @@ static void handle_blktap_iomsg(void* pr +@@ -378,6 +387,7 @@ static void handle_blktap_iomsg(void* pr blkif_t *blkif = s->blkif; tapdev_info_t *info = s->ring_info; int page_size = getpagesize(); @@ -26,7 +26,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c struct aiocb_info *aiocb_info; -@@ -412,7 +422,7 @@ static void handle_blktap_iomsg(void* pr +@@ -410,7 +420,7 @@ static void handle_blktap_iomsg(void* pr /* Don't allow writes on readonly devices */ if ((s->flags & TD_RDONLY) && @@ -35,7 +35,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c blkif->pending_list[idx].status = BLKIF_RSP_ERROR; goto send_response; } -@@ -433,7 +443,7 @@ static void handle_blktap_iomsg(void* pr +@@ -431,7 +441,7 @@ static void handle_blktap_iomsg(void* pr DPRINTF("Sector request failed:\n"); DPRINTF("%s request, idx [%d,%d] size [%llu], " "sector [%llu,%llu]\n", @@ -44,7 +44,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c "WRITE" : "READ"), idx,i, (long long unsigned) -@@ -446,8 +456,14 @@ static void handle_blktap_iomsg(void* pr +@@ -444,8 +454,14 @@ static void handle_blktap_iomsg(void* pr blkif->pending_list[idx].secs_pending += nsects; @@ -60,7 +60,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c case BLKIF_OP_WRITE: aiocb_info = malloc(sizeof(*aiocb_info)); -@@ -467,6 +483,10 @@ static void handle_blktap_iomsg(void* pr +@@ -465,6 +481,10 @@ static void handle_blktap_iomsg(void* pr DPRINTF("ERROR: bdrv_write() == NULL\n"); goto send_response; } diff --git a/ioemu-blktap-fv-init.patch b/ioemu-blktap-fv-init.patch index 36ee82b..37db5c3 100644 --- a/ioemu-blktap-fv-init.patch +++ b/ioemu-blktap-fv-init.patch @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_machine_fv.c +Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_machine_fv.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_machine_fv.c -+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_machine_fv.c -@@ -266,6 +266,7 @@ void qemu_invalidate_entry(uint8_t *buff +--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/xen_machine_fv.c ++++ xen-4.0.0-testing/tools/ioemu-remote/hw/xen_machine_fv.c +@@ -268,6 +268,7 @@ void qemu_invalidate_entry(uint8_t *buff #endif /* defined(MAPCACHE) */ @@ -10,7 +10,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_machine_fv.c static void xen_init_fv(ram_addr_t ram_size, int vga_ram_size, const char *boot_device, -@@ -291,6 +292,11 @@ static void xen_init_fv(ram_addr_t ram_s +@@ -293,6 +294,11 @@ static void xen_init_fv(ram_addr_t ram_s } #endif diff --git a/ioemu-blktap-image-format.patch b/ioemu-blktap-image-format.patch index 0601d40..76e03b1 100644 --- a/ioemu-blktap-image-format.patch +++ b/ioemu-blktap-image-format.patch @@ -15,11 +15,11 @@ Signed-off-by: Kevin Wolf hw/xen_blktap.h | 14 ++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) -Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c +Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_blktap.c -+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c -@@ -220,9 +220,10 @@ static int map_new_dev(struct td_state * +--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.c ++++ xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c +@@ -218,9 +218,10 @@ static int map_new_dev(struct td_state * return -1; } @@ -31,7 +31,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c char* devname; static int devnumber = 0; int i; -@@ -232,7 +233,22 @@ static int open_disk(struct td_state *s, +@@ -230,7 +231,22 @@ static int open_disk(struct td_state *s, bs = bdrv_new(devname); free(devname); @@ -55,7 +55,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c fprintf(stderr, "Could not open image file %s\n", path); return -ENOMEM; } -@@ -527,7 +543,7 @@ static void handle_blktap_ctrlmsg(void* +@@ -521,7 +537,7 @@ static void handle_blktap_ctrlmsg(void* s = state_init(); /*Open file*/ @@ -64,10 +64,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c msglen = sizeof(msg_hdr_t); msg->type = CTLMSG_IMG_FAIL; msg->len = msglen; -Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.h +Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.h =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_blktap.h -+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.h +--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.h ++++ xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.h @@ -52,4 +52,18 @@ typedef struct fd_list_entry { int init_blktap(void); diff --git a/ioemu-blktap-zero-size.patch b/ioemu-blktap-zero-size.patch index a362af3..1b8eeab 100644 --- a/ioemu-blktap-zero-size.patch +++ b/ioemu-blktap-zero-size.patch @@ -12,11 +12,11 @@ Signed-off-by: Kevin Wolf hw/xen_blktap.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) -Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c +Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_blktap.c -+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c -@@ -258,6 +258,12 @@ static int open_disk(struct td_state *s, +--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.c ++++ xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c +@@ -256,6 +256,12 @@ static int open_disk(struct td_state *s, s->size = bs->total_sectors; s->sector_size = 512; @@ -29,10 +29,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c s->info = ((s->flags & TD_RDONLY) ? VDISK_READONLY : 0); #ifndef QEMU_TOOL -Index: xen-3.4.1-testing/tools/python/xen/xend/server/DevController.py +Index: xen-4.0.0-testing/tools/python/xen/xend/server/DevController.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/server/DevController.py -+++ xen-3.4.1-testing/tools/python/xen/xend/server/DevController.py +--- xen-4.0.0-testing.orig/tools/python/xen/xend/server/DevController.py ++++ xen-4.0.0-testing/tools/python/xen/xend/server/DevController.py @@ -155,7 +155,7 @@ class DevController: (devid, self.deviceClass)) diff --git a/ioemu-debuginfo.patch b/ioemu-debuginfo.patch index db33c1c..b88354a 100644 --- a/ioemu-debuginfo.patch +++ b/ioemu-debuginfo.patch @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/ioemu-remote/Makefile +Index: xen-4.0.0-testing/tools/ioemu-remote/Makefile =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/Makefile -+++ xen-3.4.1-testing/tools/ioemu-remote/Makefile -@@ -242,7 +242,7 @@ endif +--- xen-4.0.0-testing.orig/tools/ioemu-remote/Makefile ++++ xen-4.0.0-testing/tools/ioemu-remote/Makefile +@@ -243,7 +243,7 @@ endif install: all $(if $(BUILD_DOCS),install-doc) mkdir -p "$(DESTDIR)$(bindir)" ifneq ($(TOOLS),) @@ -11,10 +11,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/Makefile endif ifneq ($(BLOBS),) mkdir -p "$(DESTDIR)$(datadir)" -Index: xen-3.4.1-testing/tools/ioemu-remote/Makefile.target +Index: xen-4.0.0-testing/tools/ioemu-remote/Makefile.target =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/Makefile.target -+++ xen-3.4.1-testing/tools/ioemu-remote/Makefile.target +--- xen-4.0.0-testing.orig/tools/ioemu-remote/Makefile.target ++++ xen-4.0.0-testing/tools/ioemu-remote/Makefile.target @@ -754,7 +754,7 @@ clean: install: all install-hook diff --git a/ioemu-vnc-resize.patch b/ioemu-vnc-resize.patch index db60e73..ef27832 100644 --- a/ioemu-vnc-resize.patch +++ b/ioemu-vnc-resize.patch @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/ioemu-remote/vnc.c +Index: xen-4.0.0-testing/tools/ioemu-remote/vnc.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/vnc.c -+++ xen-3.4.1-testing/tools/ioemu-remote/vnc.c +--- xen-4.0.0-testing.orig/tools/ioemu-remote/vnc.c ++++ xen-4.0.0-testing/tools/ioemu-remote/vnc.c @@ -1713,6 +1713,31 @@ static int protocol_client_msg(VncState } diff --git a/libxen_permissive.patch b/libxen_permissive.patch index 87b037e..2f69b3b 100644 --- a/libxen_permissive.patch +++ b/libxen_permissive.patch @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/libxen/src/xen_common.c +Index: xen-4.0.0-testing/tools/libxen/src/xen_common.c =================================================================== ---- xen-3.4.1-testing.orig/tools/libxen/src/xen_common.c -+++ xen-3.4.1-testing/tools/libxen/src/xen_common.c +--- xen-4.0.0-testing.orig/tools/libxen/src/xen_common.c ++++ xen-4.0.0-testing/tools/libxen/src/xen_common.c @@ -904,8 +904,15 @@ static void parse_into(xen_session *s, x 0 != strcmp((char *)value_node->children->name, "struct") || value_node->children->children == NULL) diff --git a/magic_ioport_compat.patch b/magic_ioport_compat.patch new file mode 100644 index 0000000..69ca3be --- /dev/null +++ b/magic_ioport_compat.patch @@ -0,0 +1,20 @@ +Make our PV drivers work with older hosts that do not recognize the new PV driver protocol. + +Signed-off-by: K. Y. Srinivasan + +Index: xen-4.0.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +=================================================================== +--- xen-4.0.0-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c ++++ xen-4.0.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +@@ -289,7 +289,10 @@ static int check_platform_magic(struct d + + if (magic != XEN_IOPORT_MAGIC_VAL) { + dev_err(dev, "invalid magic %#x", magic); +- return -ENODEV; ++ /* ++ * Older backend; just return 0 to be compatible. ++ */ ++ return 0; + } + + protocol = inb(XEN_IOPORT_PROTOVER); diff --git a/mkbuildtree.patch b/mkbuildtree.patch deleted file mode 100644 index f346359..0000000 --- a/mkbuildtree.patch +++ /dev/null @@ -1,33 +0,0 @@ -Index: xen-3.4.1-testing/unmodified_drivers/linux-2.6/mkbuildtree -=================================================================== ---- xen-3.4.1-testing.orig/unmodified_drivers/linux-2.6/mkbuildtree -+++ xen-3.4.1-testing/unmodified_drivers/linux-2.6/mkbuildtree -@@ -33,7 +33,11 @@ for d in $(find ${XL}/drivers/xen/ -mind - done - - ln -sf ${XL}/drivers/xen/core/gnttab.c platform-pci --ln -sf ${XL}/drivers/xen/core/features.c platform-pci -+if [ -f ${XL}/drivers/xen/core/features.c ]; then -+ ln -sf ${XL}/drivers/xen/core/features.c platform-pci -+else -+ ln -sf ${XL}/drivers/xen/features.c platform-pci -+fi - ln -sf ${XL}/drivers/xen/core/xen_proc.c xenbus - ln -sf ${XL}/drivers/xen/core/reboot.c platform-pci - -@@ -47,7 +51,14 @@ ln -nsf ${XEN}/include/public include/xe - # be native and not xenolinux). - case "$uname" in - i[34567]86|x86_64) -- if [ -d ${XL}/include/asm-x86 ]; then -+ if [ -d ${XL}/arch/x86/include/mach-xen ]; then -+ ln -sf ${XL}/arch/x86/include/mach-xen/asm/hypervisor.h include/asm -+ ln -sf ${XL}/arch/x86/include/mach-xen/asm/hypercall*.h include/asm -+ ln -sf ${XL}/arch/x86/include/mach-xen/asm/synch_bitops*.h include/asm -+ ln -sf ${XL}/arch/x86/include/mach-xen/asm/maddr*.h include/asm -+ ln -sf ${XL}/arch/x86/include/mach-xen/asm/gnttab_dma.h include/asm -+ ln -sf ${XL}/arch/x86/lib/scrub.c balloon -+ elif [ -d ${XL}/include/asm-x86 ]; then - ln -sf ${XL}/include/asm-x86/mach-xen/asm/hypervisor.h include/asm - ln -sf ${XL}/include/asm-x86/mach-xen/asm/hypercall*.h include/asm - ln -sf ${XL}/include/asm-x86/mach-xen/asm/synch_bitops*.h include/asm diff --git a/msi-enable.patch b/msi-enable.patch deleted file mode 100644 index 32e4bbf..0000000 --- a/msi-enable.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: xen-3.3.1-testing/xen/arch/x86/io_apic.c -=================================================================== ---- xen-3.3.1-testing.orig/xen/arch/x86/io_apic.c -+++ xen-3.3.1-testing/xen/arch/x86/io_apic.c -@@ -45,7 +45,7 @@ - int (*ioapic_renumber_irq)(int ioapic, int irq); - atomic_t irq_mis_count; - --int msi_enable = 0; -+int msi_enable = 1; - boolean_param("msi", msi_enable); - - /* Where if anywhere is the i8259 connect in external int mode */ diff --git a/network-nat-open-SuSEfirewall2-FORWARD.patch b/network-nat-open-SuSEfirewall2-FORWARD.patch index 0428203..50b9e2b 100644 --- a/network-nat-open-SuSEfirewall2-FORWARD.patch +++ b/network-nat-open-SuSEfirewall2-FORWARD.patch @@ -1,10 +1,10 @@ Open SuSEfirewall2 FORWARD rule when use xen nat -Index: xen-3.4.1-testing/tools/hotplug/Linux/network-nat +Index: xen-4.0.0-testing/tools/hotplug/Linux/network-nat =================================================================== ---- xen-3.4.1-testing.orig/tools/hotplug/Linux/network-nat -+++ xen-3.4.1-testing/tools/hotplug/Linux/network-nat -@@ -82,6 +82,7 @@ function dhcp_stop() +--- xen-4.0.0-testing.orig/tools/hotplug/Linux/network-nat ++++ xen-4.0.0-testing/tools/hotplug/Linux/network-nat +@@ -83,6 +83,7 @@ function dhcp_stop() op_start() { echo 1 >/proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o ${netdev} -j MASQUERADE @@ -12,7 +12,7 @@ Index: xen-3.4.1-testing/tools/hotplug/Linux/network-nat [ "$dhcp" != 'no' ] && dhcp_start } -@@ -89,6 +90,7 @@ op_start() { +@@ -90,6 +91,7 @@ op_start() { op_stop() { [ "$dhcp" != 'no' ] && dhcp_stop iptables -t nat -D POSTROUTING -o ${netdev} -j MASQUERADE diff --git a/network-nat.patch b/network-nat.patch index 3321371..92c016a 100644 --- a/network-nat.patch +++ b/network-nat.patch @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/hotplug/Linux/network-nat +Index: xen-4.0.0-testing/tools/hotplug/Linux/network-nat =================================================================== ---- xen-3.4.1-testing.orig/tools/hotplug/Linux/network-nat -+++ xen-3.4.1-testing/tools/hotplug/Linux/network-nat +--- xen-4.0.0-testing.orig/tools/hotplug/Linux/network-nat ++++ xen-4.0.0-testing/tools/hotplug/Linux/network-nat @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash diff --git a/network-route.patch b/network-route.patch index 7a15a2c..d4bb037 100644 --- a/network-route.patch +++ b/network-route.patch @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/hotplug/Linux/network-route +Index: xen-4.0.0-testing/tools/hotplug/Linux/network-route =================================================================== ---- xen-3.4.1-testing.orig/tools/hotplug/Linux/network-route -+++ xen-3.4.1-testing/tools/hotplug/Linux/network-route -@@ -21,7 +21,7 @@ dir=$(dirname "$0") +--- xen-4.0.0-testing.orig/tools/hotplug/Linux/network-route ++++ xen-4.0.0-testing/tools/hotplug/Linux/network-route +@@ -22,7 +22,7 @@ dir=$(dirname "$0") evalVariables "$@" diff --git a/pv-driver-build.patch b/pv-driver-build.patch index 51f4637..8e05029 100644 --- a/pv-driver-build.patch +++ b/pv-driver-build.patch @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/unmodified_drivers/linux-2.6/blkfront/Kbuild +Index: xen-4.0.0-testing/unmodified_drivers/linux-2.6/blkfront/Kbuild =================================================================== ---- xen-3.4.1-testing.orig/unmodified_drivers/linux-2.6/blkfront/Kbuild -+++ xen-3.4.1-testing/unmodified_drivers/linux-2.6/blkfront/Kbuild +--- xen-4.0.0-testing.orig/unmodified_drivers/linux-2.6/blkfront/Kbuild ++++ xen-4.0.0-testing/unmodified_drivers/linux-2.6/blkfront/Kbuild @@ -3,3 +3,4 @@ include $(M)/overrides.mk obj-m += xen-vbd.o diff --git a/pvdrv-import-shared-info.patch b/pvdrv-import-shared-info.patch new file mode 100644 index 0000000..dfded56 --- /dev/null +++ b/pvdrv-import-shared-info.patch @@ -0,0 +1,56 @@ +--- 2009-11-09.orig/unmodified_drivers/linux-2.6/platform-pci/evtchn.c 2008-10-14 19:44:11.000000000 +0200 ++++ 2009-11-09/unmodified_drivers/linux-2.6/platform-pci/evtchn.c 2009-11-24 17:38:08.000000000 +0100 +@@ -40,7 +40,9 @@ + #include + #endif + ++#ifndef shared_info_area + void *shared_info_area; ++#endif + + #define is_valid_evtchn(x) ((x) != 0) + #define evtchn_from_irq(x) (irq_evtchn[irq].evtchn) +--- 2009-11-09.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c 2009-02-24 20:09:53.000000000 +0100 ++++ 2009-11-09/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c 2009-11-24 17:45:02.000000000 +0100 +@@ -70,7 +70,6 @@ static uint64_t callback_via; + static int __devinit init_xen_info(void) + { + struct xen_add_to_physmap xatp; +- extern void *shared_info_area; + + #ifdef __ia64__ + xencomm_initialize(); +@@ -78,6 +77,7 @@ static int __devinit init_xen_info(void) + + setup_xen_features(); + ++#ifndef shared_info_area + shared_info_frame = alloc_xen_mmio(PAGE_SIZE) >> PAGE_SHIFT; + xatp.domid = DOMID_SELF; + xatp.idx = 0; +@@ -90,6 +90,11 @@ static int __devinit init_xen_info(void) + ioremap(shared_info_frame << PAGE_SHIFT, PAGE_SIZE); + if (shared_info_area == NULL) + panic("can't map shared info\n"); ++#else ++ shared_info_frame = __pa(shared_info_area) >> PAGE_SHIFT; ++ printk(KERN_INFO "Using kernel provided shared info (pfn=%lx)\n", ++ shared_info_frame); ++#endif + + return 0; + } +--- 2009-11-09.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.h 2008-10-14 19:44:11.000000000 +0200 ++++ 2009-11-09/unmodified_drivers/linux-2.6/platform-pci/platform-pci.h 2009-11-24 17:40:08.000000000 +0100 +@@ -27,6 +27,11 @@ + unsigned long alloc_xen_mmio(unsigned long len); + void platform_pci_resume(void); + ++#ifdef CONFIG_ENLIGHTEN_SPINLOCKS ++#define shared_info_area xen_shared_info ++#endif ++extern void *shared_info_area; ++ + extern struct pci_dev *xen_platform_pdev; + + #endif /* _XEN_PLATFORM_PCI_H */ diff --git a/pvdrv_emulation_control.patch b/pvdrv_emulation_control.patch index e65190f..c999e5c 100644 --- a/pvdrv_emulation_control.patch +++ b/pvdrv_emulation_control.patch @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_platform.c +Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_platform.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_platform.c -+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_platform.c -@@ -361,6 +361,19 @@ static void platform_ioport_write(void * +--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/xen_platform.c ++++ xen-4.0.0-testing/tools/ioemu-remote/hw/xen_platform.c +@@ -365,6 +365,19 @@ static void platform_ioport_write(void * net_tap_shutdown_all(); fprintf(logfile, "Done.\n"); break; diff --git a/qemu-dm-segfault.patch b/qemu-dm-segfault.patch index 23a1912..573ac19 100644 --- a/qemu-dm-segfault.patch +++ b/qemu-dm-segfault.patch @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ide.c +Index: xen-4.0.0-testing/tools/ioemu-remote/hw/ide.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/ide.c -+++ xen-3.4.1-testing/tools/ioemu-remote/hw/ide.c -@@ -934,8 +934,9 @@ static inline void ide_dma_submit_check( +--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/ide.c ++++ xen-4.0.0-testing/tools/ioemu-remote/hw/ide.c +@@ -935,8 +935,9 @@ static inline void ide_dma_submit_check( static inline void ide_set_irq(IDEState *s) { @@ -14,7 +14,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ide.c if (!(s->cmd & IDE_CMD_DISABLE_IRQ)) { if (bm) { bm->status |= BM_STATUS_INT; -@@ -1223,14 +1224,14 @@ static void ide_read_dma_cb(void *opaque +@@ -1224,14 +1225,14 @@ static void ide_read_dma_cb(void *opaque int n; int64_t sector_num; @@ -31,7 +31,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ide.c n = s->io_buffer_size >> 9; sector_num = ide_get_sector(s); if (n > 0) { -@@ -1334,6 +1335,8 @@ static void ide_write_flush_cb(void *opa +@@ -1335,6 +1336,8 @@ static void ide_write_flush_cb(void *opa BMDMAState *bm = opaque; IDEState *s = bm->ide_if; @@ -40,7 +40,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ide.c if (ret != 0) { ide_dma_error(s); return; -@@ -1365,13 +1368,13 @@ static void ide_write_dma_cb(void *opaqu +@@ -1366,13 +1369,13 @@ static void ide_write_dma_cb(void *opaqu int n; int64_t sector_num; @@ -56,7 +56,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ide.c n = s->io_buffer_size >> 9; sector_num = ide_get_sector(s); if (n > 0) { -@@ -1428,7 +1431,7 @@ static void ide_flush_cb(void *opaque, i +@@ -1429,7 +1432,7 @@ static void ide_flush_cb(void *opaque, i { IDEState *s = opaque; @@ -65,7 +65,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ide.c if (ret) { /* We are completely doomed. The IDE spec does not permit us -@@ -1685,7 +1688,7 @@ static void ide_atapi_cmd_read_dma_cb(vo +@@ -1686,7 +1689,7 @@ static void ide_atapi_cmd_read_dma_cb(vo IDEState *s = bm->ide_if; int data_offset, n; @@ -74,7 +74,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ide.c if (ret < 0) { ide_atapi_io_error(s, ret); -@@ -2363,7 +2366,7 @@ static void cdrom_change_cb(void *opaque +@@ -2365,7 +2368,7 @@ static void cdrom_change_cb(void *opaque IDEState *s = opaque; uint64_t nb_sectors; diff --git a/qemu-retry-be-status.patch b/qemu-retry-be-status.patch deleted file mode 100644 index a215846..0000000 --- a/qemu-retry-be-status.patch +++ /dev/null @@ -1,40 +0,0 @@ -Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_backend.c -=================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_backend.c -+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_backend.c -@@ -377,8 +377,12 @@ static int xen_be_try_init(struct XenDev - int rc = 0; - - if (!xendev->online) { -- xen_be_printf(xendev, 1, "not online\n"); -- return -1; -+ sleep(3); -+ xenstore_read_be_int(xendev, "online", &xendev->online); -+ if (!xendev->online) { -+ xen_be_printf(xendev, 1, "not online\n"); -+ return -1; -+ } - } - - if (xendev->ops->init) -Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_console.c -=================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_console.c -+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_console.c -@@ -196,9 +196,14 @@ static int con_init(struct XenDevice *xe - - type = xenstore_read_str(con->console, "type"); - if (!type || 0 != strcmp(type, "ioemu")) { -- xen_be_printf(xendev, 1, "not for me (type=%s)\n", type); -- return -1; -+ sleep(3); -+ type = xenstore_read_str(con->console, "type"); -+ if (!type || 0 != strcmp(type, "ioemu")) { -+ xen_be_printf(xendev, 1, "not for me (type=%s)\n", type); -+ return -1; -+ } - } -+ qemu_free(type); - - if (!serial_hds[con->xendev.dev]) - xen_be_printf(xendev, 1, "WARNING: serial line %d not configured\n", diff --git a/qemu-security-etch1.diff b/qemu-security-etch1.diff index c737f7a..62cc0d5 100644 --- a/qemu-security-etch1.diff +++ b/qemu-security-etch1.diff @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ne2000.c +Index: xen-4.0.0-testing/tools/ioemu-remote/hw/ne2000.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/ne2000.c -+++ xen-3.4.1-testing/tools/ioemu-remote/hw/ne2000.c +--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/ne2000.c ++++ xen-4.0.0-testing/tools/ioemu-remote/hw/ne2000.c @@ -218,7 +218,7 @@ static int ne2000_can_receive(void *opaq NE2000State *s = opaque; @@ -11,10 +11,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ne2000.c return !ne2000_buffer_full(s); } -Index: xen-3.4.1-testing/tools/ioemu-remote/hw/pc.c +Index: xen-4.0.0-testing/tools/ioemu-remote/hw/pc.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/pc.c -+++ xen-3.4.1-testing/tools/ioemu-remote/hw/pc.c +--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/pc.c ++++ xen-4.0.0-testing/tools/ioemu-remote/hw/pc.c @@ -409,7 +409,8 @@ static void bochs_bios_write(void *opaqu case 0x400: case 0x401: diff --git a/serial-split.patch b/serial-split.patch index fc90f3c..89f0cce 100644 --- a/serial-split.patch +++ b/serial-split.patch @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/misc/serial-split/Makefile +Index: xen-4.0.0-testing/tools/misc/serial-split/Makefile =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/misc/serial-split/Makefile ++++ xen-4.0.0-testing/tools/misc/serial-split/Makefile @@ -0,0 +1,20 @@ +CC ?= gcc +CFLAGS ?= -Wall -Os @@ -23,10 +23,10 @@ Index: xen-3.4.1-testing/tools/misc/serial-split/Makefile + +%.o: %.c Makefile + $(CC) $(CFLAGS) -c -o $@ $< -Index: xen-3.4.1-testing/tools/misc/serial-split/serial-split.c +Index: xen-4.0.0-testing/tools/misc/serial-split/serial-split.c =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/misc/serial-split/serial-split.c ++++ xen-4.0.0-testing/tools/misc/serial-split/serial-split.c @@ -0,0 +1,422 @@ +/* + * serial-split.c diff --git a/snapshot-ioemu-delete.patch b/snapshot-ioemu-delete.patch index 496dc2e..34b8f62 100644 --- a/snapshot-ioemu-delete.patch +++ b/snapshot-ioemu-delete.patch @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c +Index: xen-4.0.0-testing/tools/ioemu-remote/xenstore.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/xenstore.c -+++ xen-3.4.1-testing/tools/ioemu-remote/xenstore.c -@@ -919,6 +919,18 @@ static void xenstore_process_dm_command_ +--- xen-4.0.0-testing.orig/tools/ioemu-remote/xenstore.c ++++ xen-4.0.0-testing/tools/ioemu-remote/xenstore.c +@@ -865,6 +865,18 @@ static void xenstore_process_dm_command_ } snapshot_name = xs_read(xsh, XBT_NULL, path, &len); @@ -21,10 +21,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c } else if (!strncmp(command, "continue", len)) { fprintf(logfile, "dm-command: continue after state save\n"); xen_pause_requested = 0; -Index: xen-3.4.1-testing/tools/ioemu-remote/savevm.c +Index: xen-4.0.0-testing/tools/ioemu-remote/savevm.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/savevm.c -+++ xen-3.4.1-testing/tools/ioemu-remote/savevm.c +--- xen-4.0.0-testing.orig/tools/ioemu-remote/savevm.c ++++ xen-4.0.0-testing/tools/ioemu-remote/savevm.c @@ -1096,6 +1096,35 @@ the_end: return ret; } @@ -61,10 +61,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/savevm.c #ifndef CONFIG_DM void do_savevm(const char *name) -Index: xen-3.4.1-testing/tools/ioemu-remote/qemu-xen.h +Index: xen-4.0.0-testing/tools/ioemu-remote/qemu-xen.h =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/qemu-xen.h -+++ xen-3.4.1-testing/tools/ioemu-remote/qemu-xen.h +--- xen-4.0.0-testing.orig/tools/ioemu-remote/qemu-xen.h ++++ xen-4.0.0-testing/tools/ioemu-remote/qemu-xen.h @@ -42,6 +42,7 @@ enum { /* xen-vl-extra.c */ diff --git a/snapshot-ioemu-restore.patch b/snapshot-ioemu-restore.patch index 84436bd..be689ae 100644 --- a/snapshot-ioemu-restore.patch +++ b/snapshot-ioemu-restore.patch @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/blktap/drivers/blktapctrl.c +Index: xen-4.0.0-testing/tools/blktap/drivers/blktapctrl.c =================================================================== ---- xen-3.4.1-testing.orig/tools/blktap/drivers/blktapctrl.c -+++ xen-3.4.1-testing/tools/blktap/drivers/blktapctrl.c -@@ -346,6 +346,7 @@ static int write_msg(int fd, int msgtype +--- xen-4.0.0-testing.orig/tools/blktap/drivers/blktapctrl.c ++++ xen-4.0.0-testing/tools/blktap/drivers/blktapctrl.c +@@ -347,6 +347,7 @@ static int write_msg(int fd, int msgtype msg_dev = (msg_newdev_t *)(buf + sizeof(msg_hdr_t)); msg_dev->devnum = blkif->minor; msg_dev->domid = blkif->domid; @@ -10,10 +10,10 @@ Index: xen-3.4.1-testing/tools/blktap/drivers/blktapctrl.c break; -Index: xen-3.4.1-testing/tools/blktap/lib/blktaplib.h +Index: xen-4.0.0-testing/tools/blktap/lib/blktaplib.h =================================================================== ---- xen-3.4.1-testing.orig/tools/blktap/lib/blktaplib.h -+++ xen-3.4.1-testing/tools/blktap/lib/blktaplib.h +--- xen-4.0.0-testing.orig/tools/blktap/lib/blktaplib.h ++++ xen-4.0.0-testing/tools/blktap/lib/blktaplib.h @@ -189,6 +189,7 @@ typedef struct msg_hdr { typedef struct msg_newdev { uint8_t devnum; @@ -22,10 +22,10 @@ Index: xen-3.4.1-testing/tools/blktap/lib/blktaplib.h } msg_newdev_t; typedef struct msg_pid { -Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c +Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_blktap.c -+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c +--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.c ++++ xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c @@ -67,6 +67,8 @@ int write_fd; static pid_t process; fd_list_entry_t *fd_start = NULL; @@ -35,7 +35,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c static void handle_blktap_iomsg(void* private); struct aiocb_info { -@@ -500,6 +502,10 @@ static void handle_blktap_ctrlmsg(void* +@@ -500,6 +502,10 @@ static void handle_blktap_ctrlmsg(void* char buf[MSG_SIZE]; @@ -46,7 +46,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c length = read(read_fd, buf, MSG_SIZE); if (length > 0 && length >= sizeof(msg_hdr_t)) -@@ -555,7 +561,39 @@ static void handle_blktap_ctrlmsg(void* +@@ -555,7 +561,39 @@ static void handle_blktap_ctrlmsg(void* if (s != NULL) { ret = ((map_new_dev(s, msg_dev->devnum) == msg_dev->devnum ? 0: -1)); @@ -87,20 +87,20 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c memset(buf, 0x00, MSG_SIZE); msglen = sizeof(msg_hdr_t); -Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c +Index: xen-4.0.0-testing/tools/ioemu-remote/xenstore.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/xenstore.c -+++ xen-3.4.1-testing/tools/ioemu-remote/xenstore.c -@@ -38,6 +38,8 @@ static QEMUTimer *insert_timer = NULL; - #define UWAIT_MAX (30*1000000) /* thirty seconds */ - #define UWAIT (100000) /* 1/10th second */ +--- xen-4.0.0-testing.orig/tools/ioemu-remote/xenstore.c ++++ xen-4.0.0-testing/tools/ioemu-remote/xenstore.c +@@ -102,6 +102,8 @@ int xenstore_watch_new_callback(const ch + } + +char* get_snapshot_name(int devid); + static int pasprintf(char **buf, const char *fmt, ...) { va_list ap; -@@ -533,8 +535,33 @@ void xenstore_parse_domain_config(int hv +@@ -641,8 +643,33 @@ void xenstore_parse_domain_config(int hv } } pstrcpy(bs->filename, sizeof(bs->filename), params); @@ -133,9 +133,9 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c + } + } } - /* if cdrom pyhsical put a watch on media-present */ - if (bdrv_get_type_hint(bs) == BDRV_TYPE_CDROM) { -@@ -726,6 +753,23 @@ int xenstore_parse_disable_pf_config () + + #endif +@@ -776,6 +803,23 @@ int xenstore_parse_disable_pf_config () return disable_pf; } diff --git a/snapshot-ioemu-save.patch b/snapshot-ioemu-save.patch index de33755..8067a2a 100644 --- a/snapshot-ioemu-save.patch +++ b/snapshot-ioemu-save.patch @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/ioemu-remote/savevm.c +Index: xen-4.0.0-testing/tools/ioemu-remote/savevm.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/savevm.c -+++ xen-3.4.1-testing/tools/ioemu-remote/savevm.c +--- xen-4.0.0-testing.orig/tools/ioemu-remote/savevm.c ++++ xen-4.0.0-testing/tools/ioemu-remote/savevm.c @@ -28,6 +28,7 @@ #include "sysemu.h" #include "qemu-timer.h" @@ -97,13 +97,13 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/savevm.c #ifndef CONFIG_DM void do_savevm(const char *name) -Index: xen-3.4.1-testing/tools/ioemu-remote/i386-dm/helper2.c +Index: xen-4.0.0-testing/tools/ioemu-remote/i386-dm/helper2.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/i386-dm/helper2.c -+++ xen-3.4.1-testing/tools/ioemu-remote/i386-dm/helper2.c +--- xen-4.0.0-testing.orig/tools/ioemu-remote/i386-dm/helper2.c ++++ xen-4.0.0-testing/tools/ioemu-remote/i386-dm/helper2.c @@ -109,6 +109,9 @@ int send_vcpu = 0; - #define NR_CPUS 32 - evtchn_port_t ioreq_local_port[NR_CPUS]; + //the evtchn port for polling the notification, + evtchn_port_t *ioreq_local_port; +/** Name of the snapshot which should be saved */ +char* snapshot_name; @@ -111,7 +111,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/i386-dm/helper2.c CPUX86State *cpu_x86_init(const char *cpu_model) { CPUX86State *env; -@@ -551,6 +554,7 @@ int main_loop(void) +@@ -553,6 +556,7 @@ int main_loop(void) int evtchn_fd = xce_handle == -1 ? -1 : xc_evtchn_fd(xce_handle); char *qemu_file; fd_set fds; @@ -119,7 +119,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/i386-dm/helper2.c main_loop_prepare(); -@@ -578,11 +582,43 @@ int main_loop(void) +@@ -580,11 +584,43 @@ int main_loop(void) main_loop_wait(1); /* For the select() on events */ /* Save the device state */ @@ -167,10 +167,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/i386-dm/helper2.c /* Wait to be allowed to continue */ while (xen_pause_requested) { -Index: xen-3.4.1-testing/tools/ioemu-remote/qemu-xen.h +Index: xen-4.0.0-testing/tools/ioemu-remote/qemu-xen.h =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/qemu-xen.h -+++ xen-3.4.1-testing/tools/ioemu-remote/qemu-xen.h +--- xen-4.0.0-testing.orig/tools/ioemu-remote/qemu-xen.h ++++ xen-4.0.0-testing/tools/ioemu-remote/qemu-xen.h @@ -34,6 +34,15 @@ void qemu_invalidate_map_cache(void) #define mapcache_lock() ((void)0) #define mapcache_unlock() ((void)0) @@ -195,11 +195,11 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/qemu-xen.h void xenstore_check_new_media_present(int timeout); void xenstore_write_vncport(int vnc_display); void xenstore_read_vncpasswd(int domid, char *pwbuf, size_t pwbuflen); -Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c +Index: xen-4.0.0-testing/tools/ioemu-remote/xenstore.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/xenstore.c -+++ xen-3.4.1-testing/tools/ioemu-remote/xenstore.c -@@ -24,6 +24,7 @@ +--- xen-4.0.0-testing.orig/tools/ioemu-remote/xenstore.c ++++ xen-4.0.0-testing/tools/ioemu-remote/xenstore.c +@@ -17,6 +17,7 @@ #include "exec-all.h" #include "sysemu.h" @@ -207,7 +207,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c #include "hw.h" #include "pci.h" -@@ -849,6 +850,7 @@ static void xenstore_process_dm_command_ +@@ -836,6 +837,7 @@ static void xenstore_process_dm_command_ { char *path = NULL, *command = NULL, *par = NULL; unsigned int len; @@ -215,8 +215,8 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c if (pasprintf(&path, "/local/domain/0/device-model/%u/command", domid) == -1) { -@@ -861,7 +863,18 @@ static void xenstore_process_dm_command_ - +@@ -851,7 +853,18 @@ static void xenstore_process_dm_command_ + if (!strncmp(command, "save", len)) { fprintf(logfile, "dm-command: pause and save state\n"); - xen_pause_requested = 1; @@ -235,7 +235,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c } else if (!strncmp(command, "continue", len)) { fprintf(logfile, "dm-command: continue after state save\n"); xen_pause_requested = 0; -@@ -966,6 +979,13 @@ void xenstore_record_dm_state(const char +@@ -984,6 +997,13 @@ void xenstore_record_dm_state(const char xenstore_record_dm("state", state); } diff --git a/snapshot-xend.patch b/snapshot-xend.patch index d906e8d..031ea13 100644 --- a/snapshot-xend.patch +++ b/snapshot-xend.patch @@ -1,17 +1,17 @@ -Index: xen-3.4.1-testing/tools/python/xen/xend/image.py +Index: xen-4.0.0-testing/tools/python/xen/xend/image.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/image.py -+++ xen-3.4.1-testing/tools/python/xen/xend/image.py -@@ -445,7 +445,7 @@ class ImageHandler: - # have a callback but sadly we don't have Twisted in xend - self.sentinel_thread = thread.start_new_thread(self._sentinel_watch,()) +--- xen-4.0.0-testing.orig/tools/python/xen/xend/image.py ++++ xen-4.0.0-testing/tools/python/xen/xend/image.py +@@ -492,7 +492,7 @@ class ImageHandler: + + domains.domains_lock.acquire() - def signalDeviceModel(self, cmd, ret, par = None): + def signalDeviceModel(self, cmd, ret, par = None, timeout = True): if self.device_model is None: return # Signal the device model to for action -@@ -468,10 +468,17 @@ class ImageHandler: +@@ -529,10 +529,17 @@ class ImageHandler: while state != ret: state = xstransact.Read("/local/domain/0/device-model/%i/state" % self.vm.getDomid()) @@ -32,7 +32,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/image.py #resotre orig state xstransact.Store("/local/domain/0/device-model/%i" -@@ -496,6 +503,10 @@ class ImageHandler: +@@ -557,6 +564,10 @@ class ImageHandler: except: pass @@ -43,10 +43,10 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/image.py def recreate(self): if self.device_model is None: return -Index: xen-3.4.1-testing/tools/python/xen/xend/server/blkif.py +Index: xen-4.0.0-testing/tools/python/xen/xend/server/blkif.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/server/blkif.py -+++ xen-3.4.1-testing/tools/python/xen/xend/server/blkif.py +--- xen-4.0.0-testing.orig/tools/python/xen/xend/server/blkif.py ++++ xen-4.0.0-testing/tools/python/xen/xend/server/blkif.py @@ -88,6 +88,9 @@ class BlkifController(DevController): if bootable != None: back['bootable'] = str(bootable) @@ -57,10 +57,10 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/server/blkif.py if security.on() == xsconstants.XS_POLICY_USE: self.do_access_control(config, uname) -Index: xen-3.4.1-testing/tools/python/xen/xend/server/SrvDomain.py +Index: xen-4.0.0-testing/tools/python/xen/xend/server/SrvDomain.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/server/SrvDomain.py -+++ xen-3.4.1-testing/tools/python/xen/xend/server/SrvDomain.py +--- xen-4.0.0-testing.orig/tools/python/xen/xend/server/SrvDomain.py ++++ xen-4.0.0-testing/tools/python/xen/xend/server/SrvDomain.py @@ -95,6 +95,31 @@ class SrvDomain(SrvDir): def do_save(self, _, req): return self.xd.domain_save(self.dom.domid, req.args['file'][0]) @@ -93,7 +93,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/server/SrvDomain.py def op_dump(self, op, req): self.acceptCommand(req) return req.threadRequest(self.do_dump, op, req) -@@ -231,7 +256,7 @@ class SrvDomain(SrvDir): +@@ -245,7 +270,7 @@ class SrvDomain(SrvDir): def render_GET(self, req): op = req.args.get('op') @@ -102,20 +102,20 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/server/SrvDomain.py return self.perform(req) # -Index: xen-3.4.1-testing/tools/python/xen/xend/XendCheckpoint.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendCheckpoint.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendCheckpoint.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendCheckpoint.py +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendCheckpoint.py @@ -65,7 +65,7 @@ def insert_after(list, pred, value): return -def save(fd, dominfo, network, live, dst, checkpoint=False, node=-1): +def save(fd, dominfo, network, live, dst, checkpoint=False, node=-1, name=None, diskonly=False): + from xen.xend import XendDomain + try: - if not os.path.isdir("/var/lib/xen"): - os.makedirs("/var/lib/xen") -@@ -98,52 +98,61 @@ def save(fd, dominfo, network, live, dst +@@ -112,52 +112,61 @@ def save(fd, dominfo, network, live, dst image_cfg = dominfo.info.get('image', {}) hvm = dominfo.info.is_hvm() @@ -223,7 +223,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendCheckpoint.py if checkpoint: dominfo.resumeDomain() -@@ -207,6 +216,71 @@ def restore(xd, fd, dominfo = None, paus +@@ -221,6 +230,71 @@ def restore(xd, fd, dominfo = None, paus if othervm is not None and othervm.domid is not None: raise VmError("Domain '%s' already exists with ID '%d'" % (domconfig["name_label"], othervm.domid)) @@ -295,7 +295,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendCheckpoint.py if dominfo: dominfo.resume() else: -@@ -322,26 +396,7 @@ def restore(xd, fd, dominfo = None, paus +@@ -329,26 +403,7 @@ def restore(xd, fd, dominfo = None, paus dominfo.completeRestore(handler.store_mfn, handler.console_mfn) @@ -323,23 +323,23 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendCheckpoint.py if not paused: dominfo.unpause() -Index: xen-3.4.1-testing/tools/python/xen/xend/XendConfig.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendConfig.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendConfig.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendConfig.py -@@ -220,6 +220,7 @@ XENAPI_CFG_TYPES = { - 'machine_address_size': int, - 'suppress_spurious_page_faults': bool0, +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendConfig.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendConfig.py +@@ -233,6 +233,7 @@ XENAPI_CFG_TYPES = { 's3_integrity' : int, + 'superpages' : int, + 'memory_sharing': int, + 'snapshotname': str, } # List of legacy configuration keys that have no equivalent in the -Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomain.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomain.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendDomain.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendDomain.py -@@ -52,6 +52,7 @@ from xen.xend.xenstore.xstransact import +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomain.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendDomain.py +@@ -53,6 +53,7 @@ from xen.xend.xenstore.xstransact import from xen.xend.xenstore.xswatch import xswatch from xen.util import mkdir, rwlock from xen.xend import uuid @@ -347,9 +347,9 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomain.py xc = xen.lowlevel.xc.xc() xoptions = XendOptions.instance() -@@ -1421,6 +1422,187 @@ class XendDomain: - raise XendError("can't write guest state file %s: %s" % - (dst, ex[1])) +@@ -1564,6 +1565,187 @@ class XendDomain: + else: + log.debug("error: Domain is not running!") + def domain_snapshot_create(self, domid, name, diskonly=False): + """Snapshot a running domain. @@ -535,11 +535,11 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomain.py def domain_pincpu(self, domid, vcpu, cpumap): """Set which cpus vcpu can use -Index: xen-3.4.1-testing/tools/python/xen/xm/main.py +Index: xen-4.0.0-testing/tools/python/xen/xm/main.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xm/main.py -+++ xen-3.4.1-testing/tools/python/xen/xm/main.py -@@ -120,6 +120,14 @@ SUBCOMMAND_HELP = { +--- xen-4.0.0-testing.orig/tools/python/xen/xm/main.py ++++ xen-4.0.0-testing/tools/python/xen/xm/main.py +@@ -122,6 +122,14 @@ SUBCOMMAND_HELP = { 'Restore a domain from a saved state.'), 'save' : ('[-c|-f] ', 'Save a domain state to restore later.'), @@ -554,7 +554,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xm/main.py 'shutdown' : (' [-waRH]', 'Shutdown a domain.'), 'top' : ('', 'Monitor a host and the domains in real time.'), 'unpause' : ('', 'Unpause a paused domain.'), -@@ -277,6 +285,9 @@ SUBCOMMAND_OPTIONS = { +@@ -316,6 +324,9 @@ SUBCOMMAND_OPTIONS = { ('-c', '--checkpoint', 'Leave domain running after creating snapshot'), ('-f', '--force', 'Force to overwrite exist file'), ), @@ -564,7 +564,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xm/main.py 'restore': ( ('-p', '--paused', 'Do not unpause domain after restoring it'), ), -@@ -303,6 +314,10 @@ common_commands = [ +@@ -362,6 +373,10 @@ common_commands = [ "restore", "resume", "save", @@ -575,7 +575,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xm/main.py "shell", "shutdown", "start", -@@ -334,6 +349,10 @@ domain_commands = [ +@@ -395,6 +410,10 @@ domain_commands = [ "restore", "resume", "save", @@ -586,7 +586,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xm/main.py "shutdown", "start", "suspend", -@@ -725,6 +744,62 @@ def xm_event_monitor(args): +@@ -815,6 +834,62 @@ def xm_event_monitor(args): # ######################################################################### @@ -649,7 +649,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xm/main.py def xm_save(args): arg_check(args, "save", 2, 4) -@@ -2857,6 +2932,10 @@ commands = { +@@ -3467,6 +3542,10 @@ commands = { "restore": xm_restore, "resume": xm_resume, "save": xm_save, diff --git a/supported_module.diff b/supported_module.diff index 0019950..b72f0ac 100644 --- a/supported_module.diff +++ b/supported_module.diff @@ -2,10 +2,10 @@ Make our PV drivers "Novell supported modules" Signed-off-by: K. Y. Srinivasan -Index: xen-3.4.1-testing/unmodified_drivers/linux-2.6/Module.supported +Index: xen-4.0.0-testing/unmodified_drivers/linux-2.6/Module.supported =================================================================== --- /dev/null -+++ xen-3.4.1-testing/unmodified_drivers/linux-2.6/Module.supported ++++ xen-4.0.0-testing/unmodified_drivers/linux-2.6/Module.supported @@ -0,0 +1,5 @@ +xen-vbd +xen-platform-pci diff --git a/svm-lmsl.patch b/svm-lmsl.patch index bb0acb2..7585d56 100644 --- a/svm-lmsl.patch +++ b/svm-lmsl.patch @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c +Index: xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c =================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/hvm/hvm.c -+++ xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c -@@ -543,11 +543,12 @@ static int hvm_load_cpu_ctxt(struct doma +--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/hvm.c ++++ xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c +@@ -629,11 +629,12 @@ static int hvm_load_cpu_ctxt(struct doma return -EINVAL; } @@ -16,7 +16,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c (!cpu_has_ffxsr && (ctxt.msr_efer & EFER_FFXSE)) || ((ctxt.msr_efer & (EFER_LME|EFER_LMA)) == EFER_LMA) ) { -@@ -830,10 +831,11 @@ int hvm_set_efer(uint64_t value) +@@ -984,10 +985,11 @@ int hvm_set_efer(uint64_t value) value &= ~EFER_LMA; @@ -29,11 +29,11 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c (!cpu_has_ffxsr && (value & EFER_FFXSE)) ) { gdprintk(XENLOG_WARNING, "Trying to set reserved bit in " -Index: xen-3.4.1-testing/xen/arch/x86/hvm/svm/svm.c +Index: xen-4.0.0-testing/xen/arch/x86/hvm/svm/svm.c =================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/hvm/svm/svm.c -+++ xen-3.4.1-testing/xen/arch/x86/hvm/svm/svm.c -@@ -53,6 +53,11 @@ +--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/svm/svm.c ++++ xen-4.0.0-testing/xen/arch/x86/hvm/svm/svm.c +@@ -56,6 +56,11 @@ u32 svm_feature_flags; @@ -45,7 +45,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/svm/svm.c #define set_segment_register(name, value) \ asm volatile ( "movw %%ax ,%%" STR(name) "" : : "a" (value) ) -@@ -869,6 +874,22 @@ static int svm_cpu_up(struct cpuinfo_x86 +@@ -840,6 +845,29 @@ static int svm_cpu_up(struct cpuinfo_x86 /* Initialize core's ASID handling. */ svm_asid_init(c); @@ -60,19 +60,26 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/svm/svm.c + rdmsr(MSR_EFER, eax, edx); + if ( eax & EFER_LMSLE ) + { -+ cpu_has_lmsl = 1; ++ if ( c == &boot_cpu_data ) ++ cpu_has_lmsl = 1; + wrmsr(MSR_EFER, eax ^ EFER_LMSLE, edx); + } ++ else ++ { ++ if ( cpu_has_lmsl ) ++ printk(XENLOG_WARNING "Inconsistent LMLSE support across CPUs!\n"); ++ cpu_has_lmsl = 0; ++ } +#endif + return 1; } -Index: xen-3.4.1-testing/xen/include/asm-x86/hvm/hvm.h +Index: xen-4.0.0-testing/xen/include/asm-x86/hvm/hvm.h =================================================================== ---- xen-3.4.1-testing.orig/xen/include/asm-x86/hvm/hvm.h -+++ xen-3.4.1-testing/xen/include/asm-x86/hvm/hvm.h -@@ -134,6 +134,12 @@ struct hvm_function_table { +--- xen-4.0.0-testing.orig/xen/include/asm-x86/hvm/hvm.h ++++ xen-4.0.0-testing/xen/include/asm-x86/hvm/hvm.h +@@ -131,6 +131,12 @@ struct hvm_function_table { extern struct hvm_function_table hvm_funcs; extern int hvm_enabled; diff --git a/tapdisk-ioemu-logfile.patch b/tapdisk-ioemu-logfile.patch index 6f0bad1..407174f 100644 --- a/tapdisk-ioemu-logfile.patch +++ b/tapdisk-ioemu-logfile.patch @@ -11,10 +11,10 @@ Signed-off-by: Kevin Wolf tapdisk-ioemu.c | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) -Index: xen-3.4.0-testing/tools/ioemu-remote/tapdisk-ioemu.c +Index: xen-4.0.0-testing/tools/ioemu-remote/tapdisk-ioemu.c =================================================================== ---- xen-3.4.0-testing.orig/tools/ioemu-remote/tapdisk-ioemu.c -+++ xen-3.4.0-testing/tools/ioemu-remote/tapdisk-ioemu.c +--- xen-4.0.0-testing.orig/tools/ioemu-remote/tapdisk-ioemu.c ++++ xen-4.0.0-testing/tools/ioemu-remote/tapdisk-ioemu.c @@ -78,15 +78,22 @@ int main(void) struct timeval tv; void *old_fd_start = NULL; diff --git a/tapdisk-ioemu-shutdown-fix.patch b/tapdisk-ioemu-shutdown-fix.patch index c4d47cc..395cdb3 100644 --- a/tapdisk-ioemu-shutdown-fix.patch +++ b/tapdisk-ioemu-shutdown-fix.patch @@ -16,10 +16,10 @@ Signed-off-by: Kevin Wolf tapdisk-ioemu.c | 13 ++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) -Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c +Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_blktap.c -+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c +--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.c ++++ xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c @@ -65,6 +65,7 @@ int read_fd; int write_fd; @@ -27,8 +27,8 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c +int connected_disks = 0; fd_list_entry_t *fd_start = NULL; - extern char* get_snapshot_name(int devid); -@@ -547,6 +548,7 @@ static void handle_blktap_ctrlmsg(void* + static void handle_blktap_iomsg(void* private); +@@ -541,6 +542,7 @@ static void handle_blktap_ctrlmsg(void* /* Allocate the disk structs */ s = state_init(); @@ -36,7 +36,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c /*Open file*/ if (s == NULL || open_disk(s, path, msg->drivertype, msg->readonly)) { -@@ -629,7 +631,8 @@ static void handle_blktap_ctrlmsg(void* +@@ -591,7 +593,8 @@ static void handle_blktap_ctrlmsg(void* case CTLMSG_CLOSE: s = get_state(msg->cookie); if (s) unmap_disk(s); @@ -46,10 +46,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c case CTLMSG_PID: memset(buf, 0x00, MSG_SIZE); -Index: xen-3.4.1-testing/tools/ioemu-remote/tapdisk-ioemu.c +Index: xen-4.0.0-testing/tools/ioemu-remote/tapdisk-ioemu.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/tapdisk-ioemu.c -+++ xen-3.4.1-testing/tools/ioemu-remote/tapdisk-ioemu.c +--- xen-4.0.0-testing.orig/tools/ioemu-remote/tapdisk-ioemu.c ++++ xen-4.0.0-testing/tools/ioemu-remote/tapdisk-ioemu.c @@ -14,6 +14,7 @@ extern void qemu_aio_init(void); extern void qemu_aio_poll(void); @@ -58,7 +58,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/tapdisk-ioemu.c int domid = 0; FILE* logfile; -@@ -76,7 +77,7 @@ int main(void) +@@ -76,7 +77,7 @@ int main(void) int max_fd; fd_set rfds; struct timeval tv; @@ -67,7 +67,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/tapdisk-ioemu.c /* Daemonize */ if (fork() != 0) -@@ -128,11 +129,17 @@ int main(void) +@@ -128,11 +129,17 @@ int main(void) pioh = &ioh->next; } diff --git a/tmp_build.patch b/tmp_build.patch index ffbdf06..cf004a7 100644 --- a/tmp_build.patch +++ b/tmp_build.patch @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/xenstore/Makefile +Index: xen-4.0.0-testing/tools/xenstore/Makefile =================================================================== ---- xen-3.4.1-testing.orig/tools/xenstore/Makefile -+++ xen-3.4.1-testing/tools/xenstore/Makefile -@@ -56,6 +56,7 @@ $(CLIENTS_DOMU): xenstore +--- xen-4.0.0-testing.orig/tools/xenstore/Makefile ++++ xen-4.0.0-testing/tools/xenstore/Makefile +@@ -61,6 +61,7 @@ $(CLIENTS_DOMU): xenstore xenstore: xenstore_client.o $(LIBXENSTORE) $(CC) $(CFLAGS) $(LDFLAGS) $< -L. -lxenstore $(SOCKET_LIBS) -o $@ @@ -10,7 +10,7 @@ Index: xen-3.4.1-testing/tools/xenstore/Makefile xenstore-control: xenstore_control.o $(LIBXENSTORE) $(CC) $(CFLAGS) $(LDFLAGS) $< -L. -lxenstore $(SOCKET_LIBS) -o $@ -@@ -104,10 +105,11 @@ install: all +@@ -111,10 +112,11 @@ endif $(INSTALL_PROG) xenstore-control $(DESTDIR)$(BINDIR) $(INSTALL_PROG) xenstore $(DESTDIR)$(BINDIR) set -e ; for c in $(CLIENTS) ; do \ diff --git a/tools-gdbserver-build.diff b/tools-gdbserver-build.diff index 2aafe56..90991a6 100644 --- a/tools-gdbserver-build.diff +++ b/tools-gdbserver-build.diff @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in +Index: xen-4.0.0-testing/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in =================================================================== ---- xen-3.4.1-testing.orig/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in -+++ xen-3.4.1-testing/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in +--- xen-4.0.0-testing.orig/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in ++++ xen-4.0.0-testing/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in @@ -90,7 +90,7 @@ INCLUDE_CFLAGS = -I. -I${srcdir} -I$(src GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS} #PROFILE_CFLAGS = -pg diff --git a/tools-kboot.diff b/tools-kboot.diff index 6160aa9..a074251 100644 --- a/tools-kboot.diff +++ b/tools-kboot.diff @@ -13,10 +13,10 @@ Signed-off-by: Gerd Hoffmann tools/kboot/select-kernel | 59 + 9 files changed, 2111 insertions(+) -Index: xen-3.4.1-testing/buildconfigs/linux-defconfig_xenUboot_x86_32 +Index: xen-4.0.0-testing/buildconfigs/linux-defconfig_xenUboot_x86_32 =================================================================== --- /dev/null -+++ xen-3.4.1-testing/buildconfigs/linux-defconfig_xenUboot_x86_32 ++++ xen-4.0.0-testing/buildconfigs/linux-defconfig_xenUboot_x86_32 @@ -0,0 +1,874 @@ +# +# Automatically generated make config: don't edit @@ -892,10 +892,10 @@ Index: xen-3.4.1-testing/buildconfigs/linux-defconfig_xenUboot_x86_32 +CONFIG_X86_NO_TSS=y +CONFIG_X86_NO_IDT=y +CONFIG_KTIME_SCALAR=y -Index: xen-3.4.1-testing/buildconfigs/linux-defconfig_xenUboot_x86_64 +Index: xen-4.0.0-testing/buildconfigs/linux-defconfig_xenUboot_x86_64 =================================================================== --- /dev/null -+++ xen-3.4.1-testing/buildconfigs/linux-defconfig_xenUboot_x86_64 ++++ xen-4.0.0-testing/buildconfigs/linux-defconfig_xenUboot_x86_64 @@ -0,0 +1,653 @@ +# +# Automatically generated make config: don't edit @@ -1550,17 +1550,17 @@ Index: xen-3.4.1-testing/buildconfigs/linux-defconfig_xenUboot_x86_64 +# CONFIG_CRC32 is not set +# CONFIG_LIBCRC32C is not set +CONFIG_ZLIB_INFLATE=y -Index: xen-3.4.1-testing/buildconfigs/mk.linux-2.6-xenUboot +Index: xen-4.0.0-testing/buildconfigs/mk.linux-2.6-xenUboot =================================================================== --- /dev/null -+++ xen-3.4.1-testing/buildconfigs/mk.linux-2.6-xenUboot ++++ xen-4.0.0-testing/buildconfigs/mk.linux-2.6-xenUboot @@ -0,0 +1,2 @@ +EXTRAVERSION = xenUboot +include buildconfigs/mk.linux-2.6-xen -Index: xen-3.4.1-testing/tools/kboot/Makefile +Index: xen-4.0.0-testing/tools/kboot/Makefile =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/kboot/Makefile ++++ xen-4.0.0-testing/tools/kboot/Makefile @@ -0,0 +1,23 @@ +# +# tools/kboot/Makefile @@ -1585,10 +1585,10 @@ Index: xen-3.4.1-testing/tools/kboot/Makefile +kboot.initramfs: mkinitramfs init select-kernel ../xcutils/xc_kexec + sh ./mkinitramfs | tee $@ + -Index: xen-3.4.1-testing/tools/kboot/README +Index: xen-4.0.0-testing/tools/kboot/README =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/kboot/README ++++ xen-4.0.0-testing/tools/kboot/README @@ -0,0 +1,43 @@ + +This is a simple kexec-based boot loader @@ -1633,10 +1633,10 @@ Index: xen-3.4.1-testing/tools/kboot/README + +-- +Gerd Hoffmann -Index: xen-3.4.1-testing/tools/kboot/init +Index: xen-4.0.0-testing/tools/kboot/init =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/kboot/init ++++ xen-4.0.0-testing/tools/kboot/init @@ -0,0 +1,309 @@ +#!/bin/sh + @@ -1947,10 +1947,10 @@ Index: xen-3.4.1-testing/tools/kboot/init +msg "bye ..." +banner "boot $guestos" +xc_kexec -e -Index: xen-3.4.1-testing/tools/kboot/mkinitramfs +Index: xen-4.0.0-testing/tools/kboot/mkinitramfs =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/kboot/mkinitramfs ++++ xen-4.0.0-testing/tools/kboot/mkinitramfs @@ -0,0 +1,111 @@ +#!/bin/sh + @@ -2063,10 +2063,10 @@ Index: xen-3.4.1-testing/tools/kboot/mkinitramfs + echo "file $LIB/$(basename $lib) $lib 0755 0 0" +done +echo -Index: xen-3.4.1-testing/tools/kboot/select-kernel +Index: xen-4.0.0-testing/tools/kboot/select-kernel =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/kboot/select-kernel ++++ xen-4.0.0-testing/tools/kboot/select-kernel @@ -0,0 +1,59 @@ +#!/bin/sh + @@ -2127,10 +2127,10 @@ Index: xen-3.4.1-testing/tools/kboot/select-kernel +msg "using $kernelname" +echo "$kernelname" + -Index: xen-3.4.1-testing/make-kboot +Index: xen-4.0.0-testing/make-kboot =================================================================== --- /dev/null -+++ xen-3.4.1-testing/make-kboot ++++ xen-4.0.0-testing/make-kboot @@ -0,0 +1,37 @@ +#!/bin/sh + diff --git a/tools-xc_kexec.diff b/tools-xc_kexec.diff index 4bd34e6..8fc3ec3 100644 --- a/tools-xc_kexec.diff +++ b/tools-xc_kexec.diff @@ -23,10 +23,10 @@ Signed-off-by: Gerd Hoffmann tools/xcutils/xc_kexec.c | 503 +++++++++++++++ 19 files changed, 4988 insertions(+), 2 deletions(-) -Index: xen-3.4.1-testing/tools/xcutils/Makefile +Index: xen-4.0.0-testing/tools/xcutils/Makefile =================================================================== ---- xen-3.4.1-testing.orig/tools/xcutils/Makefile -+++ xen-3.4.1-testing/tools/xcutils/Makefile +--- xen-4.0.0-testing.orig/tools/xcutils/Makefile ++++ xen-4.0.0-testing/tools/xcutils/Makefile @@ -14,7 +14,7 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore) @@ -55,10 +55,10 @@ Index: xen-3.4.1-testing/tools/xcutils/Makefile + make -C helper clean -include $(DEPS) -Index: xen-3.4.1-testing/tools/xcutils/helper/Makefile +Index: xen-4.0.0-testing/tools/xcutils/helper/Makefile =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/helper/Makefile ++++ xen-4.0.0-testing/tools/xcutils/helper/Makefile @@ -0,0 +1,39 @@ + +XEN_ROOT = ../../.. @@ -99,10 +99,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/Makefile +# dependencies + +$(XEN_TARGET_ARCH)/entry.o: $(XEN_TARGET_ARCH)/entry.S $(XEN_TARGET_ARCH)/offsets.h -Index: xen-3.4.1-testing/tools/xcutils/helper/console.c +Index: xen-4.0.0-testing/tools/xcutils/helper/console.c =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/helper/console.c ++++ xen-4.0.0-testing/tools/xcutils/helper/console.c @@ -0,0 +1,69 @@ +#include + @@ -173,10 +173,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/console.c + + return printed_len; +} -Index: xen-3.4.1-testing/tools/xcutils/helper/ctype.c +Index: xen-4.0.0-testing/tools/xcutils/helper/ctype.c =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/helper/ctype.c ++++ xen-4.0.0-testing/tools/xcutils/helper/ctype.c @@ -0,0 +1,35 @@ +/* + * linux/lib/ctype.c @@ -213,10 +213,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/ctype.c +_L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L}; /* 240-255 */ + +EXPORT_SYMBOL(_ctype); -Index: xen-3.4.1-testing/tools/xcutils/helper/ctype.h +Index: xen-4.0.0-testing/tools/xcutils/helper/ctype.h =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/helper/ctype.h ++++ xen-4.0.0-testing/tools/xcutils/helper/ctype.h @@ -0,0 +1,54 @@ +#ifndef _LINUX_CTYPE_H +#define _LINUX_CTYPE_H @@ -272,10 +272,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/ctype.h +#define toupper(c) __toupper(c) + +#endif -Index: xen-3.4.1-testing/tools/xcutils/helper/helper.h +Index: xen-4.0.0-testing/tools/xcutils/helper/helper.h =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/helper/helper.h ++++ xen-4.0.0-testing/tools/xcutils/helper/helper.h @@ -0,0 +1,107 @@ +#include +#include @@ -384,10 +384,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/helper.h +int sprintf(char * buf, const char *fmt, ...); +int vsscanf(const char * buf, const char * fmt, va_list args); +int sscanf(const char * buf, const char * fmt, ...); -Index: xen-3.4.1-testing/tools/xcutils/helper/main.c +Index: xen-4.0.0-testing/tools/xcutils/helper/main.c =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/helper/main.c ++++ xen-4.0.0-testing/tools/xcutils/helper/main.c @@ -0,0 +1,651 @@ +#include +#include "hypercall.h" @@ -1040,10 +1040,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/main.c + printk("\r\n"); + start_kernel(); +} -Index: xen-3.4.1-testing/tools/xcutils/helper/make-offsets.c +Index: xen-4.0.0-testing/tools/xcutils/helper/make-offsets.c =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/helper/make-offsets.c ++++ xen-4.0.0-testing/tools/xcutils/helper/make-offsets.c @@ -0,0 +1,28 @@ +#include +#include @@ -1073,10 +1073,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/make-offsets.c + vcpu_off("cr3", ctrlreg[3]); + return 0; +} -Index: xen-3.4.1-testing/tools/xcutils/helper/printk.c +Index: xen-4.0.0-testing/tools/xcutils/helper/printk.c =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/helper/printk.c ++++ xen-4.0.0-testing/tools/xcutils/helper/printk.c @@ -0,0 +1,1051 @@ +/* + * linux/kernel/printk.c @@ -2129,10 +2129,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/printk.c + printk_ratelimit_burst); +} +EXPORT_SYMBOL(printk_ratelimit); -Index: xen-3.4.1-testing/tools/xcutils/helper/string.c +Index: xen-4.0.0-testing/tools/xcutils/helper/string.c =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/helper/string.c ++++ xen-4.0.0-testing/tools/xcutils/helper/string.c @@ -0,0 +1,601 @@ +/* + * linux/lib/string.c @@ -2735,10 +2735,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/string.c +} +EXPORT_SYMBOL(memchr); +#endif -Index: xen-3.4.1-testing/tools/xcutils/helper/vsprintf.c +Index: xen-4.0.0-testing/tools/xcutils/helper/vsprintf.c =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/helper/vsprintf.c ++++ xen-4.0.0-testing/tools/xcutils/helper/vsprintf.c @@ -0,0 +1,842 @@ +/* + * linux/lib/vsprintf.c @@ -3582,10 +3582,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/vsprintf.c +} + +EXPORT_SYMBOL(sscanf); -Index: xen-3.4.1-testing/tools/xcutils/helper/x86_32/div64.h +Index: xen-4.0.0-testing/tools/xcutils/helper/x86_32/div64.h =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/helper/x86_32/div64.h ++++ xen-4.0.0-testing/tools/xcutils/helper/x86_32/div64.h @@ -0,0 +1,48 @@ +#ifndef __I386_DIV64 +#define __I386_DIV64 @@ -3635,10 +3635,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/x86_32/div64.h + +} +#endif -Index: xen-3.4.1-testing/tools/xcutils/helper/x86_32/entry.S +Index: xen-4.0.0-testing/tools/xcutils/helper/x86_32/entry.S =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/helper/x86_32/entry.S ++++ xen-4.0.0-testing/tools/xcutils/helper/x86_32/entry.S @@ -0,0 +1,49 @@ +#include "offsets.h" + @@ -3689,10 +3689,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/x86_32/entry.S + nop + .align 4096 +hypercall_end: -Index: xen-3.4.1-testing/tools/xcutils/helper/x86_32/hypercall.h +Index: xen-4.0.0-testing/tools/xcutils/helper/x86_32/hypercall.h =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/helper/x86_32/hypercall.h ++++ xen-4.0.0-testing/tools/xcutils/helper/x86_32/hypercall.h @@ -0,0 +1,359 @@ +/****************************************************************************** + * hypercall.h @@ -4053,10 +4053,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/x86_32/hypercall.h + + +#endif /* __HYPERCALL_H__ */ -Index: xen-3.4.1-testing/tools/xcutils/helper/x86_64/div64.h +Index: xen-4.0.0-testing/tools/xcutils/helper/x86_64/div64.h =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/helper/x86_64/div64.h ++++ xen-4.0.0-testing/tools/xcutils/helper/x86_64/div64.h @@ -0,0 +1,57 @@ +#ifndef _ASM_GENERIC_DIV64_H +#define _ASM_GENERIC_DIV64_H @@ -4115,10 +4115,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/x86_64/div64.h +#endif /* BITS_PER_LONG */ + +#endif /* _ASM_GENERIC_DIV64_H */ -Index: xen-3.4.1-testing/tools/xcutils/helper/x86_64/entry.S +Index: xen-4.0.0-testing/tools/xcutils/helper/x86_64/entry.S =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/helper/x86_64/entry.S ++++ xen-4.0.0-testing/tools/xcutils/helper/x86_64/entry.S @@ -0,0 +1,50 @@ +#include "offsets.h" + @@ -4170,10 +4170,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/x86_64/entry.S + nop + .align 4096 +hypercall_end: -Index: xen-3.4.1-testing/tools/xcutils/helper/x86_64/hypercall.h +Index: xen-4.0.0-testing/tools/xcutils/helper/x86_64/hypercall.h =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/helper/x86_64/hypercall.h ++++ xen-4.0.0-testing/tools/xcutils/helper/x86_64/hypercall.h @@ -0,0 +1,354 @@ +/****************************************************************************** + * hypercall.h @@ -4529,10 +4529,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/x86_64/hypercall.h +} + +#endif /* __HYPERCALL_H__ */ -Index: xen-3.4.1-testing/tools/xcutils/kexec-syscall.h +Index: xen-4.0.0-testing/tools/xcutils/kexec-syscall.h =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/kexec-syscall.h ++++ xen-4.0.0-testing/tools/xcutils/kexec-syscall.h @@ -0,0 +1,80 @@ +#ifndef KEXEC_SYSCALL_H +#define KEXEC_SYSCALL_H @@ -4614,10 +4614,10 @@ Index: xen-3.4.1-testing/tools/xcutils/kexec-syscall.h +#define KEXEC_MAX_SEGMENTS 16 + +#endif /* KEXEC_SYSCALL_H */ -Index: xen-3.4.1-testing/tools/xcutils/xc_kexec.c +Index: xen-4.0.0-testing/tools/xcutils/xc_kexec.c =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/xcutils/xc_kexec.c ++++ xen-4.0.0-testing/tools/xcutils/xc_kexec.c @@ -0,0 +1,503 @@ +#include +#include diff --git a/udev-rules.patch b/udev-rules.patch index 1995cd0..5ef05dd 100644 --- a/udev-rules.patch +++ b/udev-rules.patch @@ -1,9 +1,9 @@ -Index: xen-3.4.1-testing/tools/hotplug/Linux/xen-backend.rules +Index: xen-4.0.0-testing/tools/hotplug/Linux/xen-backend.rules =================================================================== ---- xen-3.4.1-testing.orig/tools/hotplug/Linux/xen-backend.rules -+++ xen-3.4.1-testing/tools/hotplug/Linux/xen-backend.rules -@@ -7,3 +7,4 @@ SUBSYSTEM=="xen-backend", KERNEL=="vscsi - SUBSYSTEM=="xen-backend", ACTION=="remove", RUN+="/etc/xen/scripts/xen-hotplug-cleanup" +--- xen-4.0.0-testing.orig/tools/hotplug/Linux/xen-backend.rules ++++ xen-4.0.0-testing/tools/hotplug/Linux/xen-backend.rules +@@ -9,3 +9,4 @@ SUBSYSTEM=="xen-backend", ACTION=="remov KERNEL=="evtchn", NAME="xen/%k" KERNEL=="blktap[0-9]*", NAME="xen/%k" + KERNEL=="pci_iomul", NAME="xen/%k" +KERNELS=="xen", KERNEL=="xvd*", SUBSYSTEM=="block", OPTIONS+="last_rule" diff --git a/vif-route-ifup.patch b/vif-route-ifup.patch new file mode 100644 index 0000000..284444d --- /dev/null +++ b/vif-route-ifup.patch @@ -0,0 +1,83 @@ +Index: xen-4.0.0-testing/tools/hotplug/Linux/vif-route-ifup +=================================================================== +--- /dev/null ++++ xen-4.0.0-testing/tools/hotplug/Linux/vif-route-ifup +@@ -0,0 +1,34 @@ ++#!/bin/bash ++#============================================================================ ++# /etc/xen/vif-route-ifup ++# ++# Script for configuring a vif in routed mode. ++# The hotplugging system will call this script if it is specified either in ++# the device configuration given to Xend, or the default Xend configuration ++# in /etc/xen/xend-config.sxp. If the script is specified in neither of those ++# places, then vif-bridge is the default. ++# ++# Usage: ++# vif-route-ifup (add|remove|online|offline) ++# ++# Environment vars: ++# vif vif interface name (required). ++#============================================================================ ++ ++dir=$(dirname "$0") ++. "$dir/vif-common.sh" ++ ++case "$command" in ++ online) ++ ifup ${vif} ++ ;; ++ offline) ++ do_without_error ifdown ${vif} ++ ;; ++esac ++ ++log debug "Successful vif-route-ifup $command for $vif." ++if [ "$command" = "online" ] ++then ++ success ++fi +Index: xen-4.0.0-testing/tools/examples/xend-config.sxp +=================================================================== +--- xen-4.0.0-testing.orig/tools/examples/xend-config.sxp ++++ xen-4.0.0-testing/tools/examples/xend-config.sxp +@@ -184,6 +184,26 @@ + #(network-script network-route) + #(vif-script vif-route) + ++# SuSE users note: ++# If using a routed network configuration it is advised to NOT use ++# network-route and vif-route scripts but instead use sysconfig scripts ++# in dom0 and vif-route-ifup script to "connect" the domU vif to dom0. ++# Since this configuration requires a vif sysconfig script in dom0, a static ++# vif name must be used. E.g. in dom0 the vif sysconfig script ++# (/etc/sysconfig/network/ifcfg-xen1.0) may contain ++# ++# NAME='XEN vm 1 virtual interface 0' ++# BOOTPROTO='static' ++# STARTMODE='hotplug' ++# ... ++# ++# The corresponding domain vif configuration would contain e.g. ++# vif=[ 'mac=00:16:3e:aa:bb:cc,script=vif-route-ifup,vifname=xen1.0', ] ++# ++# If the vif-route-ifup script will be used for all domains, it can be ++# set here as the default vif script, alleviating the need for ++# 'script=' in domain vif configuration. ++#(vif-script vif-route-ifup) + + ## Use the following if network traffic is routed with NAT, as an alternative + # to the settings for bridged networking given above. +Index: xen-4.0.0-testing/tools/hotplug/Linux/Makefile +=================================================================== +--- xen-4.0.0-testing.orig/tools/hotplug/Linux/Makefile ++++ xen-4.0.0-testing/tools/hotplug/Linux/Makefile +@@ -9,7 +9,7 @@ XENDOMAINS_SYSCONFIG = init.d/sysconfig. + + # Xen script dir and scripts to go there. + XEN_SCRIPTS = network-bridge vif-bridge +-XEN_SCRIPTS += network-route vif-route ++XEN_SCRIPTS += network-route vif-route vif-route-ifup + XEN_SCRIPTS += network-nat vif-nat + XEN_SCRIPTS += vif2 + XEN_SCRIPTS += block diff --git a/x86-alloc-cpu-structs.patch b/x86-alloc-cpu-structs.patch deleted file mode 100644 index 73a2787..0000000 --- a/x86-alloc-cpu-structs.patch +++ /dev/null @@ -1,403 +0,0 @@ -Index: xen-3.3.1-testing/xen/arch/x86/acpi/cpufreq/cpufreq.c -=================================================================== ---- xen-3.3.1-testing.orig/xen/arch/x86/acpi/cpufreq/cpufreq.c -+++ xen-3.3.1-testing/xen/arch/x86/acpi/cpufreq/cpufreq.c -@@ -44,7 +44,7 @@ - #include - #include - --struct processor_pminfo processor_pminfo[NR_CPUS]; -+struct processor_pminfo *__read_mostly processor_pminfo[NR_CPUS]; - struct cpufreq_policy xen_px_policy[NR_CPUS]; - - static cpumask_t *cpufreq_dom_pt; -@@ -430,7 +430,7 @@ acpi_cpufreq_cpu_init(struct cpufreq_pol - - drv_data[cpu] = data; - -- data->acpi_data = &processor_pminfo[cpu].perf; -+ data->acpi_data = &processor_pminfo[cpu]->perf; - - perf = data->acpi_data; - policy->shared_type = perf->shared_type; -@@ -569,8 +569,8 @@ int cpufreq_dom_init(void) - cpufreq_dom_max = 0; - - for_each_online_cpu(i) { -- if (cpufreq_dom_max < processor_pminfo[i].perf.domain_info.domain) -- cpufreq_dom_max = processor_pminfo[i].perf.domain_info.domain; -+ if (cpufreq_dom_max < processor_pminfo[i]->perf.domain_info.domain) -+ cpufreq_dom_max = processor_pminfo[i]->perf.domain_info.domain; - } - cpufreq_dom_max++; - -@@ -586,13 +586,13 @@ int cpufreq_dom_init(void) - memset(cpufreq_dom_pt, 0, cpufreq_dom_max * sizeof(cpumask_t)); - - for_each_online_cpu(i) { -- __set_bit(processor_pminfo[i].perf.domain_info.domain, cpufreq_dom_mask); -- cpu_set(i, cpufreq_dom_pt[processor_pminfo[i].perf.domain_info.domain]); -+ __set_bit(processor_pminfo[i]->perf.domain_info.domain, cpufreq_dom_mask); -+ cpu_set(i, cpufreq_dom_pt[processor_pminfo[i]->perf.domain_info.domain]); - } - - for_each_online_cpu(i) -- processor_pminfo[i].perf.shared_cpu_map = -- cpufreq_dom_pt[processor_pminfo[i].perf.domain_info.domain]; -+ processor_pminfo[i]->perf.shared_cpu_map = -+ cpufreq_dom_pt[processor_pminfo[i]->perf.domain_info.domain]; - - return 0; - } -Index: xen-3.3.1-testing/xen/arch/x86/acpi/cpufreq/powernow.c -=================================================================== ---- xen-3.3.1-testing.orig/xen/arch/x86/acpi/cpufreq/powernow.c -+++ xen-3.3.1-testing/xen/arch/x86/acpi/cpufreq/powernow.c -@@ -49,9 +49,6 @@ - #define MSR_PSTATE_CTRL 0xc0010062 /* Pstate control MSR */ - #define MSR_PSTATE_CUR_LIMIT 0xc0010061 /* pstate current limit MSR */ - --extern struct processor_pminfo processor_pminfo[NR_CPUS]; --extern struct cpufreq_policy xen_px_policy[NR_CPUS]; -- - struct powernow_cpufreq_data { - struct processor_performance *acpi_data; - struct cpufreq_frequency_table *freq_table; -@@ -149,7 +146,7 @@ static int powernow_cpufreq_cpu_init(str - - drv_data[cpu] = data; - -- data->acpi_data = &processor_pminfo[cpu].perf; -+ data->acpi_data = &processor_pminfo[cpu]->perf; - - perf = data->acpi_data; - policy->shared_type = perf->shared_type; -@@ -271,8 +268,8 @@ int powernow_cpufreq_init(void) - } - if (ret) - return ret; -- if (max_dom < processor_pminfo[i].perf.domain_info.domain) -- max_dom = processor_pminfo[i].perf.domain_info.domain; -+ if (max_dom < processor_pminfo[i]->perf.domain_info.domain) -+ max_dom = processor_pminfo[i]->perf.domain_info.domain; - } - max_dom++; - -@@ -288,13 +285,13 @@ int powernow_cpufreq_init(void) - - /* get cpumask of each psd domain */ - for_each_online_cpu(i) { -- __set_bit(processor_pminfo[i].perf.domain_info.domain, dom_mask); -- cpu_set(i, pt[processor_pminfo[i].perf.domain_info.domain]); -+ __set_bit(processor_pminfo[i]->perf.domain_info.domain, dom_mask); -+ cpu_set(i, pt[processor_pminfo[i]->perf.domain_info.domain]); - } - - for_each_online_cpu(i) -- processor_pminfo[i].perf.shared_cpu_map = -- pt[processor_pminfo[i].perf.domain_info.domain]; -+ processor_pminfo[i]->perf.shared_cpu_map = -+ pt[processor_pminfo[i]->perf.domain_info.domain]; - - cpufreq_driver = &powernow_cpufreq_driver; - -Index: xen-3.3.1-testing/xen/drivers/cpufreq/utility.c -=================================================================== ---- xen-3.3.1-testing.orig/xen/drivers/cpufreq/utility.c -+++ xen-3.3.1-testing/xen/xen/drivers/cpufreq/utility.c -@@ -45,10 +45,12 @@ void px_statistic_suspend(void) - now = NOW(); - - for_each_online_cpu(cpu) { -- struct pm_px *pxpt = &px_statistic_data[cpu]; -+ struct pm_px *pxpt = px_statistic_data[cpu]; - uint64_t total_idle_ns; - uint64_t tmp_idle_ns; - -+ if ( !pxpt || !pxpt->u.pt ) -+ continue; - total_idle_ns = get_cpu_idle_time(cpu); - tmp_idle_ns = total_idle_ns - pxpt->prev_idle_wall; - -@@ -66,7 +68,10 @@ void px_statistic_resume(void) - now = NOW(); - - for_each_online_cpu(cpu) { -- struct pm_px *pxpt = &px_statistic_data[cpu]; -+ struct pm_px *pxpt = px_statistic_data[cpu]; -+ -+ if ( !pxpt ) -+ continue; - pxpt->prev_state_wall = now; - pxpt->prev_idle_wall = get_cpu_idle_time(cpu); - } -@@ -80,11 +85,14 @@ void px_statistic_update(cpumask_t cpuma - now = NOW(); - - for_each_cpu_mask(i, cpumask) { -- struct pm_px *pxpt = &px_statistic_data[i]; -- uint32_t statnum = processor_pminfo[i].perf.state_count; -+ struct pm_px *pxpt = px_statistic_data[i]; -+ struct processor_pminfo *pmpt = processor_pminfo[i]; - uint64_t total_idle_ns; - uint64_t tmp_idle_ns; - -+ if ( !pxpt || !pxpt->u.pt || !pxpt->u.trans_pt || !pmpt ) -+ continue; -+ - total_idle_ns = get_cpu_idle_time(i); - tmp_idle_ns = total_idle_ns - pxpt->prev_idle_wall; - -@@ -94,7 +102,7 @@ void px_statistic_update(cpumask_t cpuma - pxpt->u.pt[from].residency += now - pxpt->prev_state_wall; - pxpt->u.pt[from].residency -= tmp_idle_ns; - -- (*(pxpt->u.trans_pt + from*statnum + to))++; -+ (*(pxpt->u.trans_pt + from * pmpt->perf.state_count + to))++; - - pxpt->prev_state_wall = now; - pxpt->prev_idle_wall = total_idle_ns; -@@ -104,11 +112,23 @@ void px_statistic_update(cpumask_t cpuma - int px_statistic_init(int cpuid) - { - uint32_t i, count; -- struct pm_px *pxpt = &px_statistic_data[cpuid]; -- struct processor_pminfo *pmpt = &processor_pminfo[cpuid]; -+ struct pm_px *pxpt = px_statistic_data[cpuid]; -+ const struct processor_pminfo *pmpt = processor_pminfo[cpuid]; -+ -+ if ( !pmpt ) -+ return -EINVAL; - - count = pmpt->perf.state_count; - -+ if ( !pxpt ) -+ { -+ pxpt = xmalloc(struct pm_px); -+ if ( !pxpt ) -+ return -ENOMEM; -+ memset(pxpt, 0, sizeof(*pxpt)); -+ px_statistic_data[cpuid] = pxpt; -+ } -+ - pxpt->u.trans_pt = xmalloc_array(uint64_t, count * count); - if (!pxpt->u.trans_pt) - return -ENOMEM; -@@ -137,9 +157,13 @@ int px_statistic_init(int cpuid) - void px_statistic_reset(int cpuid) - { - uint32_t i, j, count; -- struct pm_px *pxpt = &px_statistic_data[cpuid]; -+ struct pm_px *pxpt = px_statistic_data[cpuid]; -+ const struct processor_pminfo *pmpt = processor_pminfo[cpuid]; - -- count = processor_pminfo[cpuid].perf.state_count; -+ if ( !pxpt || !pxpt->u.pt || !pxpt->u.trans_pt || !pmpt ) -+ return; -+ -+ count = pmpt->perf.state_count; - - for (i=0; i < count; i++) { - pxpt->u.pt[i].residency = 0; -@@ -298,9 +322,9 @@ void cpufreq_suspend(void) - - /* to protect the case when Px was not controlled by xen */ - for_each_online_cpu(cpu) { -- struct processor_performance *perf = &processor_pminfo[cpu].perf; -+ const struct processor_pminfo *pmpt = processor_pminfo[cpu]; - -- if (!(perf->init & XEN_PX_INIT)) -+ if (!pmpt || !(pmpt->perf.init & XEN_PX_INIT)) - return; - } - -@@ -318,10 +342,11 @@ int cpufreq_resume(void) - /* 1. to protect the case when Px was not controlled by xen */ - /* 2. set state and resume flag to sync cpu to right state and freq */ - for_each_online_cpu(cpu) { -- struct processor_performance *perf = &processor_pminfo[cpu].perf; -+ struct processor_pminfo *pmpt = processor_pminfo[cpu]; -+ struct processor_performance *perf = &pmpt->perf; - struct cpufreq_policy *policy = &xen_px_policy[cpu]; - -- if (!(perf->init & XEN_PX_INIT)) -+ if (!pmpt || !(perf->init & XEN_PX_INIT)) - goto err; - perf->state = 0; - policy->resume = 1; -Index: xen-3.3.1-testing/xen/arch/x86/acpi/cpu_idle.c -=================================================================== ---- xen-3.3.1-testing.orig/xen/arch/x86/acpi/cpu_idle.c -+++ xen-3.3.1-testing/xen/arch/x86/acpi/cpu_idle.c -@@ -128,7 +128,7 @@ struct acpi_processor_power - struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; - }; - --static struct acpi_processor_power processor_powers[NR_CPUS]; -+static struct acpi_processor_power *__read_mostly processor_powers[NR_CPUS]; - - static void print_acpi_power(uint32_t cpu, struct acpi_processor_power *power) - { -@@ -162,8 +162,11 @@ static void print_acpi_power(uint32_t cp - - static void dump_cx(unsigned char key) - { -- for( int i = 0; i < num_online_cpus(); i++ ) -- print_acpi_power(i, &processor_powers[i]); -+ unsigned int cpu; -+ -+ for_each_online_cpu ( cpu ) -+ if (processor_powers[cpu]) -+ print_acpi_power(cpu, processor_powers[cpu]); - } - - static int __init cpu_idle_key_init(void) -@@ -272,14 +275,12 @@ static struct { - - static void acpi_processor_idle(void) - { -- struct acpi_processor_power *power = NULL; -+ struct acpi_processor_power *power = processor_powers[smp_processor_id()]; - struct acpi_processor_cx *cx = NULL; - struct acpi_processor_cx *next_state = NULL; - int sleep_ticks = 0; - u32 t1, t2 = 0; - -- power = &processor_powers[smp_processor_id()]; -- - /* - * Interrupts must be disabled during bus mastering calculations and - * for C2/C3 transitions. -@@ -292,7 +293,7 @@ static void acpi_processor_idle(void) - return; - } - -- cx = power->state; -+ cx = power ? power->state : NULL; - if ( !cx ) - { - if ( pm_idle_save ) -@@ -947,7 +948,15 @@ long set_cx_pminfo(uint32_t cpu, struct - return -EFAULT; - } - -- acpi_power = &processor_powers[cpu_id]; -+ acpi_power = processor_powers[cpu_id]; -+ if ( !acpi_power ) -+ { -+ acpi_power = xmalloc(struct acpi_processor_power); -+ if ( !acpi_power ) -+ return -ENOMEM; -+ memset(acpi_power, 0, sizeof(*acpi_power)); -+ processor_powers[cpu_id] = acpi_power; -+ } - - init_cx_pminfo(acpi_power); - -@@ -983,18 +992,25 @@ long set_cx_pminfo(uint32_t cpu, struct - - uint32_t pmstat_get_cx_nr(uint32_t cpuid) - { -- return processor_powers[cpuid].count; -+ return processor_powers[cpuid] ? processor_powers[cpuid]->count : 0; - } - - int pmstat_get_cx_stat(uint32_t cpuid, struct pm_cx_stat *stat) - { -- struct acpi_processor_power *power = &processor_powers[cpuid]; -+ const struct acpi_processor_power *power = processor_powers[cpuid]; - struct vcpu *v = idle_vcpu[cpuid]; - uint64_t usage; - int i; - -+ if ( unlikely(!power) ) -+ { -+ stat->last = 0; -+ stat->nr = 0; -+ stat->idle_time = 0; -+ return 0; -+ } - stat->last = (power->state) ? power->state->type : 0; -- stat->nr = processor_powers[cpuid].count; -+ stat->nr = power->count; - stat->idle_time = v->runstate.time[RUNSTATE_running]; - if ( v->is_running ) - stat->idle_time += NOW() - v->runstate.state_entry_time; -Index: xen-3.3.1-testing/xen/drivers/acpi/pmstat.c -=================================================================== ---- xen-3.3.1-testing.orig/xen/drivers/acpi/pmstat.c -+++ xen-3.3.1-testing/xen/drivers/acpi/pmstat.c -@@ -41,7 +41,7 @@ - #include - #include - --struct pm_px px_statistic_data[NR_CPUS]; -+struct pm_px *__read_mostly px_statistic_data[NR_CPUS]; - - extern uint32_t pmstat_get_cx_nr(uint32_t cpuid); - extern int pmstat_get_cx_stat(uint32_t cpuid, struct pm_cx_stat *stat); -@@ -55,7 +55,7 @@ int do_get_pm_info(struct xen_sysctl_get - if ( !op || (op->cpuid >= NR_CPUS) || !cpu_online(op->cpuid) ) - return -EINVAL; - -- pmpt = &processor_pminfo[op->cpuid]; -+ pmpt = processor_pminfo[op->cpuid]; - - switch ( op->type & PMSTAT_CATEGORY_MASK ) - { -@@ -86,7 +86,7 @@ int do_get_pm_info(struct xen_sysctl_get - uint64_t now, ct; - uint64_t total_idle_ns; - uint64_t tmp_idle_ns; -- struct pm_px *pxpt = &px_statistic_data[op->cpuid]; -+ struct pm_px *pxpt = px_statistic_data[op->cpuid]; - - if ( !pxpt || !pxpt->u.pt || !pxpt->u.trans_pt ) - return -ENODATA; -Index: xen-3.3.1-testing/xen/arch/x86/platform_hypercall.c -=================================================================== ---- xen-3.3.1-testing.orig/xen/arch/x86/platform_hypercall.c -+++ xen-3.3.1-testing/xen/arch/x86/platform_hypercall.c -@@ -364,8 +364,19 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe - ret = -EINVAL; - break; - } -- pmpt = &processor_pminfo[cpuid]; -- pxpt = &processor_pminfo[cpuid].perf; -+ pmpt = processor_pminfo[cpuid]; -+ if ( !pmpt ) -+ { -+ pmpt = xmalloc(struct processor_pminfo); -+ if ( !pmpt ) -+ { -+ ret = -ENOMEM; -+ break; -+ } -+ memset(pmpt, 0, sizeof(*pmpt)); -+ processor_pminfo[cpuid] = pmpt; -+ } -+ pxpt = &pmpt->perf; - pmpt->acpi_id = xenpmpt->id; - pmpt->id = cpuid; - -Index: xen-3.3.1-testing/xen/include/acpi/cpufreq/processor_perf.h -=================================================================== ---- xen-3.3.1-testing.orig/xen/include/acpi/cpufreq/processor_perf.h -+++ xen-3.3.1-testing/xen/include/acpi/cpufreq/processor_perf.h -@@ -44,7 +44,7 @@ struct processor_pminfo { - struct processor_performance perf; - }; - --extern struct processor_pminfo processor_pminfo[NR_CPUS]; -+extern struct processor_pminfo *processor_pminfo[NR_CPUS]; - - struct px_stat { - uint8_t total; /* total Px states */ -@@ -61,6 +61,6 @@ struct pm_px { - uint64_t prev_idle_wall; - }; - --extern struct pm_px px_statistic_data[NR_CPUS]; -+extern struct pm_px *px_statistic_data[NR_CPUS]; - - #endif /* __XEN_PROCESSOR_PM_H__ */ diff --git a/x86-cpufreq-report.patch b/x86-cpufreq-report.patch index 8118a25..23f0cad 100644 --- a/x86-cpufreq-report.patch +++ b/x86-cpufreq-report.patch @@ -1,7 +1,5 @@ -Index: xen-3.4.1-testing/xen/arch/x86/platform_hypercall.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/platform_hypercall.c -+++ xen-3.4.1-testing/xen/arch/x86/platform_hypercall.c +--- 2010-01-06.orig/xen/arch/x86/platform_hypercall.c 2009-12-14 08:34:19.000000000 +0100 ++++ 2010-01-06/xen/arch/x86/platform_hypercall.c 2010-01-06 11:19:05.000000000 +0100 @@ -21,7 +21,7 @@ #include #include @@ -11,7 +9,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/platform_hypercall.c #include #include #include "cpu/mtrr/mtrr.h" -@@ -56,6 +56,7 @@ static long cpu_frequency_change_helper( +@@ -62,6 +62,7 @@ static long cpu_down_helper(void *data) ret_t do_platform_op(XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op) { ret_t ret = 0; @@ -19,47 +17,36 @@ Index: xen-3.4.1-testing/xen/arch/x86/platform_hypercall.c struct xen_platform_op curop, *op = &curop; if ( !IS_PRIV(current->domain) ) -@@ -385,6 +386,20 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe - break; - } +@@ -474,6 +475,24 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe + op->u.mem_add.epfn, + op->u.mem_add.pxm); break; + + case XENPF_get_cpu_freq: -+ if ( op->u.get_cpu_freq.vcpu >= MAX_VIRT_CPUS || ++ if ( op->u.get_cpu_freq.vcpu >= current->domain->max_vcpus || + !(v = current->domain->vcpu[op->u.get_cpu_freq.vcpu]) ) + { + ret = -EINVAL; + break; + } + -+ op->u.get_cpu_freq.freq = cpufreq_cpu_policy[v->processor] ? -+ cpufreq_cpu_policy[v->processor]->cur : 0; ++ op->u.get_cpu_freq.freq = cpufreq_cpu_policy[v->processor] ++ ? cpufreq_driver->get ++ ? cpufreq_driver->get(v->processor) ++ : cpufreq_cpu_policy[v->processor]->cur ++ : 0; + if ( copy_field_to_guest(u_xenpf_op, op, u.get_cpu_freq.freq) ) + ret = -EFAULT; + break; - ++ default: ret = -ENOSYS; -Index: xen-3.4.1-testing/xen/arch/x86/x86_64/platform_hypercall.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/x86_64/platform_hypercall.c -+++ xen-3.4.1-testing/xen/arch/x86/x86_64/platform_hypercall.c -@@ -23,6 +23,8 @@ DEFINE_XEN_GUEST_HANDLE(compat_platform_ - #define xen_processor_power_t compat_processor_power_t - #define set_cx_pminfo compat_set_cx_pminfo - -+#define xenpf_get_cpu_freq compat_pf_get_cpu_freq -+ - #define xenpf_enter_acpi_sleep compat_pf_enter_acpi_sleep - - #define COMPAT -Index: xen-3.4.1-testing/xen/include/public/platform.h -=================================================================== ---- xen-3.4.1-testing.orig/xen/include/public/platform.h -+++ xen-3.4.1-testing/xen/include/public/platform.h -@@ -312,6 +312,16 @@ struct xenpf_set_processor_pminfo { - typedef struct xenpf_set_processor_pminfo xenpf_set_processor_pminfo_t; - DEFINE_XEN_GUEST_HANDLE(xenpf_set_processor_pminfo_t); + break; +--- 2010-01-06.orig/xen/include/public/platform.h 2009-12-14 08:34:19.000000000 +0100 ++++ 2010-01-06/xen/include/public/platform.h 2010-01-06 11:22:06.000000000 +0100 +@@ -355,6 +355,14 @@ struct xenpf_mem_hotadd + uint32_t flags; + }; +#define XENPF_get_cpu_freq ('N' << 24) +struct xenpf_get_cpu_freq { @@ -68,16 +55,14 @@ Index: xen-3.4.1-testing/xen/include/public/platform.h + /* OUT variables */ + uint32_t freq; /* in kHz */ +}; -+typedef struct xenpf_get_cpu_freq xenpf_get_cpu_freq_t; -+DEFINE_XEN_GUEST_HANDLE(xenpf_get_cpu_freq_t); + struct xen_platform_op { uint32_t cmd; uint32_t interface_version; /* XENPF_INTERFACE_VERSION */ -@@ -327,6 +337,7 @@ struct xen_platform_op { - struct xenpf_change_freq change_freq; - struct xenpf_getidletime getidletime; - struct xenpf_set_processor_pminfo set_pminfo; +@@ -374,6 +382,7 @@ struct xen_platform_op { + struct xenpf_cpu_ol cpu_ol; + struct xenpf_cpu_hotadd cpu_add; + struct xenpf_mem_hotadd mem_add; + struct xenpf_get_cpu_freq get_cpu_freq; uint8_t pad[128]; } u; diff --git a/x86-extra-trap-info.patch b/x86-extra-trap-info.patch index 7715fd6..2339519 100644 --- a/x86-extra-trap-info.patch +++ b/x86-extra-trap-info.patch @@ -1,8 +1,6 @@ -Index: xen-3.4.1-testing/xen/arch/x86/x86_32/entry.S -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/x86_32/entry.S -+++ xen-3.4.1-testing/xen/arch/x86/x86_32/entry.S -@@ -401,21 +401,33 @@ ring1: /* obtain ss/esp from oldss/olde +--- 2010-01-06.orig/xen/arch/x86/x86_32/entry.S 2009-12-02 10:02:49.000000000 +0100 ++++ 2010-01-06/xen/arch/x86/x86_32/entry.S 2010-01-06 11:23:45.000000000 +0100 +@@ -403,21 +403,33 @@ ring1: /* obtain ss/esp from oldss/olde movl %eax,UREGS_eip+4(%esp) ret .section __ex_table,"a" @@ -46,11 +44,9 @@ Index: xen-3.4.1-testing/xen/arch/x86/x86_32/entry.S domain_crash_synchronous: pushl $domain_crash_synchronous_string call printk -Index: xen-3.4.1-testing/xen/arch/x86/x86_64/entry.S -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/x86_64/entry.S -+++ xen-3.4.1-testing/xen/arch/x86/x86_64/entry.S -@@ -419,17 +419,30 @@ create_bounce_frame: +--- 2010-01-06.orig/xen/arch/x86/x86_64/entry.S 2009-12-02 10:02:49.000000000 +0100 ++++ 2010-01-06/xen/arch/x86/x86_64/entry.S 2010-01-06 11:23:45.000000000 +0100 +@@ -421,17 +421,30 @@ create_bounce_frame: movq %rax,UREGS_rip+8(%rsp) ret .section __ex_table,"a" diff --git a/xen-ioapic-ack-default.diff b/x86-ioapic-ack-default.patch similarity index 51% rename from xen-ioapic-ack-default.diff rename to x86-ioapic-ack-default.patch index 26fa176..0ba9f24 100644 --- a/xen-ioapic-ack-default.diff +++ b/x86-ioapic-ack-default.patch @@ -1,20 +1,17 @@ -Change default IO-APIC ack mode for single IO-APIC systems to old-style. Jan +Change default IO-APIC ack mode for single IO-APIC systems to old-style. - -Index: xen-3.4.1-testing/xen/arch/x86/io_apic.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/io_apic.c -+++ xen-3.4.1-testing/xen/arch/x86/io_apic.c -@@ -1298,7 +1298,7 @@ static unsigned int startup_level_ioapic +--- 2010-01-06.orig/xen/arch/x86/io_apic.c 2009-12-17 12:20:22.000000000 +0100 ++++ 2010-01-06/xen/arch/x86/io_apic.c 2010-01-06 11:17:14.000000000 +0100 +@@ -1442,7 +1442,7 @@ static unsigned int startup_level_ioapic return 0; /* don't check for pending */ } --int ioapic_ack_new = 1; -+int ioapic_ack_new = -1; +-int __read_mostly ioapic_ack_new = 1; ++int __read_mostly ioapic_ack_new = -1; static void setup_ioapic_ack(char *s) { if ( !strcmp(s, "old") ) -@@ -1802,6 +1802,8 @@ void __init setup_IO_APIC(void) +@@ -1954,6 +1954,8 @@ void __init setup_IO_APIC(void) else io_apic_irqs = ~PIC_IRQS; diff --git a/x86-show-page-walk-early.patch b/x86-show-page-walk-early.patch index 14af53e..52e138e 100644 --- a/x86-show-page-walk-early.patch +++ b/x86-show-page-walk-early.patch @@ -1,8 +1,17 @@ -Index: xen-3.4.1-testing/xen/arch/x86/traps.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/traps.c -+++ xen-3.4.1-testing/xen/arch/x86/traps.c -@@ -1293,6 +1293,7 @@ asmlinkage void do_early_page_fault(stru +--- 2010-01-06.orig/xen/arch/x86/mm.c 2010-01-05 13:29:13.000000000 +0100 ++++ 2010-01-06/xen/arch/x86/mm.c 2010-01-06 11:22:26.000000000 +0100 +@@ -154,6 +154,8 @@ unsigned long __read_mostly pdx_group_va + int opt_allow_hugepage; + boolean_param("allowhugepage", opt_allow_hugepage); + ++bool_t __read_mostly mpt_valid; ++ + #define l1_disallow_mask(d) \ + ((d != dom_io) && \ + (rangeset_is_empty((d)->iomem_caps) && \ +--- 2010-01-06.orig/xen/arch/x86/traps.c 2009-12-17 12:20:22.000000000 +0100 ++++ 2010-01-06/xen/arch/x86/traps.c 2010-01-06 11:22:26.000000000 +0100 +@@ -1349,6 +1349,7 @@ asmlinkage void do_early_page_fault(stru unsigned long *stk = (unsigned long *)regs; printk("Early fatal page fault at %04x:%p (cr2=%p, ec=%04x)\n", regs->cs, _p(regs->eip), _p(cr2), regs->error_code); @@ -10,32 +19,20 @@ Index: xen-3.4.1-testing/xen/arch/x86/traps.c printk("Stack dump: "); while ( ((long)stk & ((PAGE_SIZE - 1) & ~(BYTES_PER_LONG - 1))) != 0 ) printk("%p ", _p(*stk++)); -Index: xen-3.4.1-testing/xen/arch/x86/x86_32/mm.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/x86_32/mm.c -+++ xen-3.4.1-testing/xen/arch/x86/x86_32/mm.c -@@ -38,6 +38,7 @@ extern l1_pgentry_t l1_identmap[L1_PAGET - unsigned int PAGE_HYPERVISOR = __PAGE_HYPERVISOR; - unsigned int PAGE_HYPERVISOR_NOCACHE = __PAGE_HYPERVISOR_NOCACHE; - -+int mpt_valid; - static unsigned long mpt_size; - - void *alloc_xen_pagetable(void) -@@ -103,6 +104,8 @@ void __init paging_init(void) - pg, (__PAGE_HYPERVISOR | _PAGE_PSE) & ~_PAGE_RW)); - } +--- 2010-01-06.orig/xen/arch/x86/x86_32/mm.c 2009-10-29 12:24:48.000000000 +0100 ++++ 2010-01-06/xen/arch/x86/x86_32/mm.c 2010-01-06 11:22:26.000000000 +0100 +@@ -122,6 +122,8 @@ void __init paging_init(void) + #undef CNT + #undef MFN + mpt_valid = 1; + - /* Fill with an obvious debug pattern. */ - for ( i = 0; i < (mpt_size / BYTES_PER_LONG); i++) - set_gpfn_from_mfn(i, 0x55555555); -Index: xen-3.4.1-testing/xen/arch/x86/x86_32/traps.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/x86_32/traps.c -+++ xen-3.4.1-testing/xen/arch/x86/x86_32/traps.c -@@ -160,7 +160,8 @@ void show_page_walk(unsigned long addr) + /* Create page tables for ioremap()/map_domain_page_global(). */ + for ( i = 0; i < (IOREMAP_MBYTES >> (L2_PAGETABLE_SHIFT - 20)); i++ ) + { +--- 2010-01-06.orig/xen/arch/x86/x86_32/traps.c 2009-12-02 10:02:49.000000000 +0100 ++++ 2010-01-06/xen/arch/x86/x86_32/traps.c 2010-01-06 11:22:26.000000000 +0100 +@@ -161,7 +161,8 @@ void show_page_walk(unsigned long addr) l3t += (cr3 & 0xFE0UL) >> 3; l3e = l3t[l3_table_offset(addr)]; mfn = l3e_get_pfn(l3e); @@ -45,7 +42,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/x86_32/traps.c printk(" L3[0x%03lx] = %"PRIpte" %08lx\n", l3_table_offset(addr), l3e_get_intpte(l3e), pfn); unmap_domain_page(l3t); -@@ -170,7 +171,8 @@ void show_page_walk(unsigned long addr) +@@ -172,7 +173,8 @@ void show_page_walk(unsigned long addr) l2t = map_domain_page(mfn); l2e = l2t[l2_table_offset(addr)]; mfn = l2e_get_pfn(l2e); @@ -55,7 +52,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/x86_32/traps.c printk(" L2[0x%03lx] = %"PRIpte" %08lx %s\n", l2_table_offset(addr), l2e_get_intpte(l2e), pfn, (l2e_get_flags(l2e) & _PAGE_PSE) ? "(PSE)" : ""); -@@ -182,7 +184,8 @@ void show_page_walk(unsigned long addr) +@@ -185,7 +187,8 @@ void show_page_walk(unsigned long addr) l1t = map_domain_page(mfn); l1e = l1t[l1_table_offset(addr)]; mfn = l1e_get_pfn(l1e); @@ -65,31 +62,19 @@ Index: xen-3.4.1-testing/xen/arch/x86/x86_32/traps.c printk(" L1[0x%03lx] = %"PRIpte" %08lx\n", l1_table_offset(addr), l1e_get_intpte(l1e), pfn); unmap_domain_page(l1t); -Index: xen-3.4.1-testing/xen/arch/x86/x86_64/mm.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/x86_64/mm.c -+++ xen-3.4.1-testing/xen/arch/x86/x86_64/mm.c -@@ -33,6 +33,7 @@ - #include - #include - -+int mpt_valid; - #ifdef CONFIG_COMPAT - unsigned int m2p_compat_vstart = __HYPERVISOR_COMPAT_VIRT_START; - #endif -@@ -181,6 +182,8 @@ void __init paging_init(void) - l2_ro_mpt++; - } +--- 2010-01-06.orig/xen/arch/x86/x86_64/mm.c 2010-01-05 13:29:13.000000000 +0100 ++++ 2010-01-06/xen/arch/x86/x86_64/mm.c 2010-01-06 11:22:26.000000000 +0100 +@@ -725,6 +725,8 @@ void __init paging_init(void) + #undef CNT + #undef MFN + mpt_valid = 1; + /* Create user-accessible L2 directory to map the MPT for compat guests. */ BUILD_BUG_ON(l4_table_offset(RDWR_MPT_VIRT_START) != l4_table_offset(HIRO_COMPAT_MPT_VIRT_START)); -Index: xen-3.4.1-testing/xen/arch/x86/x86_64/traps.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/x86_64/traps.c -+++ xen-3.4.1-testing/xen/arch/x86/x86_64/traps.c +--- 2010-01-06.orig/xen/arch/x86/x86_64/traps.c 2009-12-02 10:02:49.000000000 +0100 ++++ 2010-01-06/xen/arch/x86/x86_64/traps.c 2010-01-06 11:22:26.000000000 +0100 @@ -176,7 +176,8 @@ void show_page_walk(unsigned long addr) l4t = mfn_to_virt(mfn); l4e = l4t[l4_table_offset(addr)]; @@ -99,8 +84,8 @@ Index: xen-3.4.1-testing/xen/arch/x86/x86_64/traps.c + get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY; printk(" L4[0x%03lx] = %"PRIpte" %016lx\n", l4_table_offset(addr), l4e_get_intpte(l4e), pfn); - if ( !(l4e_get_flags(l4e) & _PAGE_PRESENT) ) -@@ -185,7 +186,8 @@ void show_page_walk(unsigned long addr) + if ( !(l4e_get_flags(l4e) & _PAGE_PRESENT) || +@@ -186,7 +187,8 @@ void show_page_walk(unsigned long addr) l3t = mfn_to_virt(mfn); l3e = l3t[l3_table_offset(addr)]; mfn = l3e_get_pfn(l3e); @@ -110,7 +95,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/x86_64/traps.c printk(" L3[0x%03lx] = %"PRIpte" %016lx%s\n", l3_table_offset(addr), l3e_get_intpte(l3e), pfn, (l3e_get_flags(l3e) & _PAGE_PSE) ? " (PSE)" : ""); -@@ -196,7 +198,8 @@ void show_page_walk(unsigned long addr) +@@ -198,7 +200,8 @@ void show_page_walk(unsigned long addr) l2t = mfn_to_virt(mfn); l2e = l2t[l2_table_offset(addr)]; mfn = l2e_get_pfn(l2e); @@ -120,7 +105,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/x86_64/traps.c printk(" L2[0x%03lx] = %"PRIpte" %016lx %s\n", l2_table_offset(addr), l2e_get_intpte(l2e), pfn, (l2e_get_flags(l2e) & _PAGE_PSE) ? "(PSE)" : ""); -@@ -207,7 +210,8 @@ void show_page_walk(unsigned long addr) +@@ -210,7 +213,8 @@ void show_page_walk(unsigned long addr) l1t = mfn_to_virt(mfn); l1e = l1t[l1_table_offset(addr)]; mfn = l1e_get_pfn(l1e); @@ -130,15 +115,14 @@ Index: xen-3.4.1-testing/xen/arch/x86/x86_64/traps.c printk(" L1[0x%03lx] = %"PRIpte" %016lx\n", l1_table_offset(addr), l1e_get_intpte(l1e), pfn); } -Index: xen-3.4.1-testing/xen/include/asm-x86/mm.h -=================================================================== ---- xen-3.4.1-testing.orig/xen/include/asm-x86/mm.h -+++ xen-3.4.1-testing/xen/include/asm-x86/mm.h -@@ -412,6 +412,7 @@ TYPE_SAFE(unsigned long,mfn); - #define machine_to_phys_mapping ((unsigned long *)RDWR_MPT_VIRT_START) - #define INVALID_M2P_ENTRY (~0UL) - #define VALID_M2P(_e) (!((_e) & (1UL<<(BITS_PER_LONG-1)))) -+extern int mpt_valid; +--- 2010-01-06.orig/xen/include/asm-x86/mm.h 2009-12-17 12:20:22.000000000 +0100 ++++ 2010-01-06/xen/include/asm-x86/mm.h 2010-01-06 11:23:39.000000000 +0100 +@@ -443,6 +443,8 @@ TYPE_SAFE(unsigned long,mfn); + #define SHARED_M2P_ENTRY (~0UL - 1UL) + #define SHARED_M2P(_e) ((_e) == SHARED_M2P_ENTRY) ++extern bool_t mpt_valid; ++ #ifdef CONFIG_COMPAT #define compat_machine_to_phys_mapping ((unsigned int *)RDWR_COMPAT_MPT_VIRT_START) + #define set_gpfn_from_mfn(mfn, pfn) ({ \ diff --git a/x86_64-5Tb.patch b/x86_64-5Tb.patch deleted file mode 100644 index 5a1b1b3..0000000 --- a/x86_64-5Tb.patch +++ /dev/null @@ -1,153 +0,0 @@ -Index: xen-3.4.1-testing/xen/arch/x86/boot/head.S -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/boot/head.S -+++ xen-3.4.1-testing/xen/arch/x86/boot/head.S -@@ -33,7 +33,7 @@ ENTRY(start) - /* Checksum: must be the negated sum of the first two fields. */ - .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) - -- .section .init.text -+ .section .init.text, "ax" - - .Lbad_cpu_msg: .asciz "ERR: Not a 64-bit CPU!" - .Lbad_ldr_msg: .asciz "ERR: Not a Multiboot bootloader!" -@@ -128,13 +128,13 @@ __start: - loop 1b - /* Initialise L3 xen-map page directory entry. */ - mov $(sym_phys(l2_xenmap)+7),%eax -- mov %eax,sym_phys(l3_xenmap) + (50*8) -+ mov %eax,sym_phys(l3_xenmap) + l3_table_offset(XEN_VIRT_START)*8 - /* Hook identity-map and xen-map L3 tables into PML4. */ - mov $(sym_phys(l3_identmap)+7),%eax - mov %eax,sym_phys(idle_pg_table) + ( 0*8) /* PML4[ 0]: 1:1 map */ -- mov %eax,sym_phys(idle_pg_table) + (262*8) /* PML4[262]: 1:1 map */ -+ mov %eax,sym_phys(idle_pg_table) + l4_table_offset(DIRECTMAP_VIRT_START)*8 - mov $(sym_phys(l3_xenmap)+7),%eax -- mov %eax,sym_phys(idle_pg_table) + (261*8) /* PML4[261]: xen map */ -+ mov %eax,sym_phys(idle_pg_table) + l4_table_offset(XEN_VIRT_START)*8 - #else - /* Initialize low and high mappings of memory with 2MB pages */ - mov $sym_phys(idle_pg_table_l2),%edi -Index: xen-3.4.1-testing/xen/arch/x86/e820.c -=================================================================== ---- xen-3.4.1-testing.orig/xen/arch/x86/e820.c -+++ xen-3.4.1-testing/xen/arch/x86/e820.c -@@ -467,15 +467,19 @@ static void __init machine_specific_memo - "can be accessed by Xen in 32-bit mode."); - #else - { -- unsigned long limit, mpt_limit, pft_limit; -+ unsigned long limit, mpt_limit, ro_mpt_limit, pft_limit; - - limit = DIRECTMAP_VIRT_END - DIRECTMAP_VIRT_START; - mpt_limit = ((RDWR_MPT_VIRT_END - RDWR_MPT_VIRT_START) - / sizeof(unsigned long)) << PAGE_SHIFT; -+ ro_mpt_limit = ((RO_MPT_VIRT_END - RO_MPT_VIRT_START) -+ / sizeof(unsigned long)) << PAGE_SHIFT; - pft_limit = ((FRAMETABLE_VIRT_END - FRAMETABLE_VIRT_START) - / sizeof(struct page_info)) << PAGE_SHIFT; - if ( limit > mpt_limit ) - limit = mpt_limit; -+ if ( limit > ro_mpt_limit ) -+ limit = ro_mpt_limit; - if ( limit > pft_limit ) - limit = pft_limit; - clip_to_limit(limit, -Index: xen-3.4.1-testing/xen/include/asm-x86/config.h -=================================================================== ---- xen-3.4.1-testing.orig/xen/include/asm-x86/config.h -+++ xen-3.4.1-testing/xen/include/asm-x86/config.h -@@ -124,10 +124,12 @@ extern unsigned int video_mode, video_fl - #define PML4_ADDR(_slot) \ - ((((_slot ## UL) >> 8) * 0xffff000000000000UL) | \ - (_slot ## UL << PML4_ENTRY_BITS)) -+#define GB(_gb) (_gb ## UL << 30) - #else - #define PML4_ENTRY_BYTES (1 << PML4_ENTRY_BITS) - #define PML4_ADDR(_slot) \ - (((_slot >> 8) * 0xffff000000000000) | (_slot << PML4_ENTRY_BITS)) -+#define GB(_gb) (_gb << 30) - #endif - - /* -@@ -151,21 +153,19 @@ extern unsigned int video_mode, video_fl - * 0xffff828000000000 - 0xffff8283ffffffff [16GB, 2^34 bytes, PML4:261] - * Machine-to-phys translation table. - * 0xffff828400000000 - 0xffff8287ffffffff [16GB, 2^34 bytes, PML4:261] -- * Page-frame information array. -- * 0xffff828800000000 - 0xffff828bffffffff [16GB, 2^34 bytes, PML4:261] - * ioremap()/fixmap area. -- * 0xffff828c00000000 - 0xffff828c3fffffff [1GB, 2^30 bytes, PML4:261] -+ * 0xffff828800000000 - 0xffff82883fffffff [1GB, 2^30 bytes, PML4:261] - * Compatibility machine-to-phys translation table. -- * 0xffff828c40000000 - 0xffff828c7fffffff [1GB, 2^30 bytes, PML4:261] -+ * 0xffff828840000000 - 0xffff82887fffffff [1GB, 2^30 bytes, PML4:261] - * High read-only compatibility machine-to-phys translation table. -- * 0xffff828c80000000 - 0xffff828cbfffffff [1GB, 2^30 bytes, PML4:261] -+ * 0xffff828880000000 - 0xffff8288bfffffff [1GB, 2^30 bytes, PML4:261] - * Xen text, static data, bss. -- * 0xffff828cc0000000 - 0xffff82ffffffffff [461GB, PML4:261] -+ * 0xffff8288c0000000 - 0xffff82ffffffffff [221GB, PML4:261] - * Reserved for future use. -- * 0xffff830000000000 - 0xffff83ffffffffff [1TB, 2^40 bytes, PML4:262-263] -+ * 0xffff82c000000000 - 0xffff82ffffffffff [256GB, 2^38 bytes, PML4:261] -+ * Page-frame information array. -+ * 0xffff830000000000 - 0xffff87ffffffffff [5TB, 5*2^40 bytes, PML4:262-271] - * 1:1 direct mapping of all physical memory. -- * 0xffff840000000000 - 0xffff87ffffffffff [4TB, 2^42 bytes, PML4:264-271] -- * Reserved for future use. - * 0xffff880000000000 - 0xffffffffffffffff [120TB, PML4:272-511] - * Guest-defined use. - * -@@ -206,25 +206,25 @@ extern unsigned int video_mode, video_fl - #define PERDOMAIN_MBYTES ((unsigned long)GDT_LDT_MBYTES) - /* Slot 261: machine-to-phys conversion table (16GB). */ - #define RDWR_MPT_VIRT_START (PML4_ADDR(261)) --#define RDWR_MPT_VIRT_END (RDWR_MPT_VIRT_START + (16UL<<30)) --/* Slot 261: page-frame information array (16GB). */ --#define FRAMETABLE_VIRT_START (RDWR_MPT_VIRT_END) --#define FRAMETABLE_VIRT_END (FRAMETABLE_VIRT_START + (16UL<<30)) -+#define RDWR_MPT_VIRT_END (RDWR_MPT_VIRT_START + GB(16)) - /* Slot 261: ioremap()/fixmap area (16GB). */ --#define IOREMAP_VIRT_START (FRAMETABLE_VIRT_END) --#define IOREMAP_VIRT_END (IOREMAP_VIRT_START + (16UL<<30)) -+#define IOREMAP_VIRT_START RDWR_MPT_VIRT_END -+#define IOREMAP_VIRT_END (IOREMAP_VIRT_START + GB(16)) - /* Slot 261: compatibility machine-to-phys conversion table (1GB). */ - #define RDWR_COMPAT_MPT_VIRT_START IOREMAP_VIRT_END --#define RDWR_COMPAT_MPT_VIRT_END (RDWR_COMPAT_MPT_VIRT_START + (1UL << 30)) -+#define RDWR_COMPAT_MPT_VIRT_END (RDWR_COMPAT_MPT_VIRT_START + GB(1)) - /* Slot 261: high read-only compat machine-to-phys conversion table (1GB). */ - #define HIRO_COMPAT_MPT_VIRT_START RDWR_COMPAT_MPT_VIRT_END --#define HIRO_COMPAT_MPT_VIRT_END (HIRO_COMPAT_MPT_VIRT_START + (1UL << 30)) -+#define HIRO_COMPAT_MPT_VIRT_END (HIRO_COMPAT_MPT_VIRT_START + GB(1)) - /* Slot 261: xen text, static data and bss (1GB). */ - #define XEN_VIRT_START (HIRO_COMPAT_MPT_VIRT_END) --#define XEN_VIRT_END (XEN_VIRT_START + (1UL << 30)) --/* Slot 262-263: A direct 1:1 mapping of all of physical memory. */ -+#define XEN_VIRT_END (XEN_VIRT_START + GB(1)) -+/* Slot 261: page-frame information array (256GB). */ -+#define FRAMETABLE_VIRT_END DIRECTMAP_VIRT_START -+#define FRAMETABLE_VIRT_START (FRAMETABLE_VIRT_END - GB(256)) -+/* Slot 262-271: A direct 1:1 mapping of all of physical memory. */ - #define DIRECTMAP_VIRT_START (PML4_ADDR(262)) --#define DIRECTMAP_VIRT_END (DIRECTMAP_VIRT_START + PML4_ENTRY_BYTES*2) -+#define DIRECTMAP_VIRT_END (DIRECTMAP_VIRT_START + PML4_ENTRY_BYTES*10) - - #ifndef __ASSEMBLY__ - -Index: xen-3.4.1-testing/xen/include/asm-x86/x86_64/page.h -=================================================================== ---- xen-3.4.1-testing.orig/xen/include/asm-x86/x86_64/page.h -+++ xen-3.4.1-testing/xen/include/asm-x86/x86_64/page.h -@@ -16,8 +16,8 @@ - #define L4_PAGETABLE_ENTRIES (1<magic, sizeof(si->magic), "xen-3.0-x86_%d%s", - elf_64bit(&elf) ? 64 : 32, parms.pae ? "p" : ""); - -+ count = d->tot_pages; -+#ifdef __x86_64__ -+ /* Set up the phys->machine table if not part of the initial mapping. */ -+ if ( parms.p2m_base != UNSET_ADDR ) -+ { -+ unsigned long va = vphysmap_start; -+ -+ if ( v_start <= vphysmap_end && vphysmap_start <= v_end ) -+ panic("DOM0 P->M table overlaps initial mapping"); -+ -+ while ( va < vphysmap_end ) -+ { -+ if ( d->tot_pages + ((round_pgup(vphysmap_end) - va) -+ >> PAGE_SHIFT) + 3 > nr_pages ) -+ panic("Dom0 allocation too small for initial P->M table.\n"); -+ -+ l4tab = l4start + l4_table_offset(va); -+ if ( !l4e_get_intpte(*l4tab) ) -+ { -+ page = alloc_domheap_pages(d, 0, 0); -+ if ( !page ) -+ break; -+ /* No mapping, PGC_allocated + page-table page. */ -+ page->count_info = PGC_allocated | 2; -+ page->u.inuse.type_info = -+ PGT_l3_page_table | PGT_validated | 1; -+ clear_page(page_to_virt(page)); -+ *l4tab = l4e_from_page(page, L4_PROT); -+ } -+ l3tab = page_to_virt(l4e_get_page(*l4tab)); -+ l3tab += l3_table_offset(va); -+ if ( !l3e_get_intpte(*l3tab) ) -+ { -+ if ( cpu_has_page1gb && -+ !(va & ((1UL << L3_PAGETABLE_SHIFT) - 1)) && -+ vphysmap_end >= va + (1UL << L3_PAGETABLE_SHIFT) && -+ (page = alloc_domheap_pages(d, -+ L3_PAGETABLE_SHIFT - -+ PAGE_SHIFT, -+ 0)) != NULL ) -+ { -+ *l3tab = l3e_from_page(page, -+ L1_PROT|_PAGE_DIRTY|_PAGE_PSE); -+ va += 1UL << L3_PAGETABLE_SHIFT; -+ continue; -+ } -+ else if ( (page = alloc_domheap_pages(d, 0, 0)) == NULL ) -+ break; -+ else -+ { -+ /* No mapping, PGC_allocated + page-table page. */ -+ page->count_info = PGC_allocated | 2; -+ page->u.inuse.type_info = -+ PGT_l2_page_table | PGT_validated | 1; -+ clear_page(page_to_virt(page)); -+ *l3tab = l3e_from_page(page, L3_PROT); -+ } -+ } -+ l2tab = page_to_virt(l3e_get_page(*l3tab)); -+ l2tab += l2_table_offset(va); -+ if ( !l2e_get_intpte(*l2tab) ) -+ { -+ if ( !(va & ((1UL << L2_PAGETABLE_SHIFT) - 1)) && -+ vphysmap_end >= va + (1UL << L2_PAGETABLE_SHIFT) && -+ (page = alloc_domheap_pages(d, -+ L2_PAGETABLE_SHIFT - -+ PAGE_SHIFT, -+ 0)) != NULL ) -+ { -+ *l2tab = l2e_from_page(page, -+ L1_PROT|_PAGE_DIRTY|_PAGE_PSE); -+ va += 1UL << L2_PAGETABLE_SHIFT; -+ continue; -+ } -+ else if ( (page = alloc_domheap_pages(d, 0, 0)) == NULL ) -+ break; -+ else -+ { -+ /* No mapping, PGC_allocated + page-table page. */ -+ page->count_info = PGC_allocated | 2; -+ page->u.inuse.type_info = -+ PGT_l1_page_table | PGT_validated | 1; -+ clear_page(page_to_virt(page)); -+ *l2tab = l2e_from_page(page, L2_PROT); -+ } -+ } -+ l1tab = page_to_virt(l2e_get_page(*l2tab)); -+ l1tab += l1_table_offset(va); -+ BUG_ON(l1e_get_intpte(*l1tab)); -+ page = alloc_domheap_pages(d, 0, 0); -+ if ( !page ) -+ break; -+ *l1tab = l1e_from_page(page, L1_PROT|_PAGE_DIRTY); -+ va += PAGE_SIZE; -+ va &= PAGE_MASK; -+ } -+ if ( !page ) -+ panic("Not enough RAM for DOM0 P->M table.\n"); -+ } -+#endif -+ - /* Write the phys->machine and machine->phys table entries. */ -- for ( pfn = 0; pfn < d->tot_pages; pfn++ ) -+ for ( pfn = 0; pfn < count; pfn++ ) - { - mfn = pfn + alloc_spfn; - #ifndef NDEBUG -@@ -755,6 +869,26 @@ int __init construct_dom0( - ((unsigned int *)vphysmap_start)[pfn] = mfn; - set_gpfn_from_mfn(mfn, pfn); - } -+ si->first_p2m_pfn = pfn; -+ si->nr_p2m_frames = d->tot_pages - count; -+ list_for_each_entry ( page, &d->page_list, list ) -+ { -+ mfn = page_to_mfn(page); -+ if ( get_gpfn_from_mfn(mfn) >= count ) -+ { -+ BUG_ON(is_pv_32bit_domain(d)); -+ if ( !page->u.inuse.type_info && -+ !get_page_and_type(page, d, PGT_writable_page) ) -+ BUG(); -+ ((unsigned long *)vphysmap_start)[pfn] = mfn; -+ set_gpfn_from_mfn(mfn, pfn); -+ ++pfn; -+#ifndef NDEBUG -+ ++alloc_epfn; -+#endif -+ } -+ } -+ BUG_ON(pfn != d->tot_pages); - while ( pfn < nr_pages ) - { - if ( (page = alloc_chunk(d, nr_pages - d->tot_pages)) == NULL ) ---- 2009-01-08.orig/xen/arch/x86/mm.c 2009-01-08 11:44:11.000000000 +0100 -+++ 2009-01-08/xen/arch/x86/mm.c 2009-01-08 10:56:30.000000000 +0100 -@@ -1013,7 +1013,8 @@ static int put_page_from_l2e(l2_pgentry_ - { - unsigned long mfn = l2e_get_pfn(l2e), m = mfn; - int writeable = l2e_get_flags(l2e) & _PAGE_RW; -- ASSERT(opt_allow_hugepage && !(mfn & (L1_PAGETABLE_ENTRIES-1))); -+ -+ ASSERT(!(mfn & (L1_PAGETABLE_ENTRIES-1))); - do { - put_data_page(mfn_to_page(m), writeable); - } while ( m++ < (mfn + (L1_PAGETABLE_ENTRIES-1)) ); -@@ -1031,14 +1032,28 @@ static int __put_page_type(struct page_i - static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn, - int partial, int preemptible) - { -- if ( (l3e_get_flags(l3e) & _PAGE_PRESENT) && -- (l3e_get_pfn(l3e) != pfn) ) -+ if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) || (l3e_get_pfn(l3e) == pfn) ) -+ return 1; -+ -+#ifdef __x86_64__ -+ if ( unlikely(l3e_get_flags(l3e) & _PAGE_PSE) ) - { -- if ( unlikely(partial > 0) ) -- return __put_page_type(l3e_get_page(l3e), preemptible); -- return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible); -+ unsigned long mfn = l3e_get_pfn(l3e); -+ int writeable = l3e_get_flags(l3e) & _PAGE_RW; -+ -+ ASSERT(!(mfn & ((1UL << (L3_PAGETABLE_SHIFT - PAGE_SHIFT)) - 1))); -+ do { -+ put_data_page(mfn_to_page(mfn), writeable); -+ } while ( ++mfn & ((1UL << (L3_PAGETABLE_SHIFT - PAGE_SHIFT)) - 1) ); -+ -+ return 0; - } -- return 1; -+#endif -+ -+ if ( unlikely(partial > 0) ) -+ return __put_page_type(l3e_get_page(l3e), preemptible); -+ -+ return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible); - } - - #if CONFIG_PAGING_LEVELS >= 4 ---- 2009-01-08.orig/xen/common/libelf/libelf-dominfo.c 2009-01-08 11:44:11.000000000 +0100 -+++ 2009-01-08/xen/common/libelf/libelf-dominfo.c 2009-01-08 10:56:30.000000000 +0100 -@@ -90,6 +90,7 @@ int elf_xen_parse_note(struct elf_binary - [XEN_ELFNOTE_ENTRY] = { "ENTRY", 0}, - [XEN_ELFNOTE_HYPERCALL_PAGE] = { "HYPERCALL_PAGE", 0}, - [XEN_ELFNOTE_VIRT_BASE] = { "VIRT_BASE", 0}, -+ [XEN_ELFNOTE_INIT_P2M] = { "INIT_P2M", 0}, - [XEN_ELFNOTE_PADDR_OFFSET] = { "PADDR_OFFSET", 0}, - [XEN_ELFNOTE_HV_START_LOW] = { "HV_START_LOW", 0}, - [XEN_ELFNOTE_XEN_VERSION] = { "XEN_VERSION", 1}, -@@ -164,6 +165,9 @@ int elf_xen_parse_note(struct elf_binary - case XEN_ELFNOTE_ENTRY: - parms->virt_entry = val; - break; -+ case XEN_ELFNOTE_INIT_P2M: -+ parms->p2m_base = val; -+ break; - case XEN_ELFNOTE_PADDR_OFFSET: - parms->elf_paddr_offset = val; - break; -@@ -392,6 +396,7 @@ static int elf_xen_addr_calc_check(struc - elf_msg(elf, " virt_kstart = 0x%" PRIx64 "\n", parms->virt_kstart); - elf_msg(elf, " virt_kend = 0x%" PRIx64 "\n", parms->virt_kend); - elf_msg(elf, " virt_entry = 0x%" PRIx64 "\n", parms->virt_entry); -+ elf_msg(elf, " p2m_base = 0x%" PRIx64 "\n", parms->p2m_base); - - if ( (parms->virt_kstart > parms->virt_kend) || - (parms->virt_entry < parms->virt_kstart) || -@@ -403,6 +408,15 @@ static int elf_xen_addr_calc_check(struc - return -1; - } - -+ if ( (parms->p2m_base != UNSET_ADDR) && -+ (parms->p2m_base >= parms->virt_kstart) && -+ (parms->p2m_base < parms->virt_kend) ) -+ { -+ elf_err(elf, "%s: ERROR: P->M table base is out of bounds.\n", -+ __FUNCTION__); -+ return -1; -+ } -+ - return 0; - } - -@@ -422,6 +436,7 @@ int elf_xen_parse(struct elf_binary *elf - parms->virt_entry = UNSET_ADDR; - parms->virt_hypercall = UNSET_ADDR; - parms->virt_hv_start_low = UNSET_ADDR; -+ parms->p2m_base = UNSET_ADDR; - parms->elf_paddr_offset = UNSET_ADDR; - - /* Find and parse elf notes. */ ---- 2009-01-08.orig/xen/include/public/elfnote.h 2009-01-08 11:44:11.000000000 +0100 -+++ 2009-01-08/xen/include/public/elfnote.h 2009-01-08 10:56:30.000000000 +0100 -@@ -162,9 +162,20 @@ - #define XEN_ELFNOTE_SUSPEND_CANCEL 14 - - /* -+ * The (non-default) location the initial phys-to-machine map should be -+ * placed at by the hypervisor (Dom0) or the tools (DomU). -+ * The kernel must be prepared for this mapping to be established using -+ * large pages, despite such otherwise not being available to guests. -+ * The kernel must also be able to handle the page table pages used for -+ * this mapping not being accessible through the initial mapping. -+ * (Only x86-64 supports this at present.) -+ */ -+#define XEN_ELFNOTE_INIT_P2M 15 -+ -+/* - * The number of the highest elfnote defined. - */ --#define XEN_ELFNOTE_MAX XEN_ELFNOTE_SUSPEND_CANCEL -+#define XEN_ELFNOTE_MAX XEN_ELFNOTE_INIT_P2M - - /* - * System information exported through crash notes. ---- 2009-01-08.orig/xen/include/public/libelf.h 2009-01-08 11:44:11.000000000 +0100 -+++ 2009-01-08/xen/include/public/libelf.h 2009-01-08 10:56:30.000000000 +0100 -@@ -232,6 +232,7 @@ struct elf_dom_parms { - uint64_t virt_entry; - uint64_t virt_hypercall; - uint64_t virt_hv_start_low; -+ uint64_t p2m_base; - uint64_t elf_paddr_offset; - uint32_t f_supported[XENFEAT_NR_SUBMAPS]; - uint32_t f_required[XENFEAT_NR_SUBMAPS]; ---- 2009-01-08.orig/xen/include/public/xen.h 2009-01-08 11:44:11.000000000 +0100 -+++ 2009-01-08/xen/include/public/xen.h 2009-01-08 10:56:30.000000000 +0100 -@@ -513,6 +513,7 @@ typedef struct shared_info shared_info_t - * a. relocated kernel image - * b. initial ram disk [mod_start, mod_len] - * c. list of allocated page frames [mfn_list, nr_pages] -+ * (unless relocated due to XEN_ELFNOTE_INIT_P2M) - * d. start_info_t structure [register ESI (x86)] - * e. bootstrap page tables [pt_base, CR3 (x86)] - * f. bootstrap stack [register ESP (x86)] -@@ -554,6 +555,9 @@ struct start_info { - unsigned long mod_start; /* VIRTUAL address of pre-loaded module. */ - unsigned long mod_len; /* Size (bytes) of pre-loaded module. */ - int8_t cmd_line[MAX_GUEST_CMDLINE]; -+ /* The pfn range here covers both page table and p->m table frames. */ -+ unsigned long first_p2m_pfn;/* 1st pfn forming initial P->M table. */ -+ unsigned long nr_p2m_frames;/* # of pfns forming initial P->M table. */ - }; - typedef struct start_info start_info_t; - diff --git a/xen-3.4.1-testing-src.tar.bz2 b/xen-3.4.1-testing-src.tar.bz2 deleted file mode 100644 index d0d013b..0000000 --- a/xen-3.4.1-testing-src.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cfe5b96404bdcaa218a6b1beb21e59cf203fa3a5b3d96c46ec5406e4ca0853e0 -size 22567950 diff --git a/xen-4.0.0-testing-src.tar.bz2 b/xen-4.0.0-testing-src.tar.bz2 new file mode 100644 index 0000000..42c0e76 --- /dev/null +++ b/xen-4.0.0-testing-src.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e09d164603872500120d70e947b329525b920f45ce924c3661057cdff3fb97bd +size 23209042 diff --git a/xen-api-auth.patch b/xen-api-auth.patch index fa25838..c2407e1 100644 --- a/xen-api-auth.patch +++ b/xen-api-auth.patch @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/python/xen/xend/XendAuthSessions.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendAuthSessions.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendAuthSessions.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendAuthSessions.py +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendAuthSessions.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendAuthSessions.py @@ -84,7 +84,7 @@ class XendAuthSessions: # if PAM doesn't exist, let's ignore it return False diff --git a/xen-changeset.diff b/xen-changeset.diff index 45e24f4..358de73 100644 --- a/xen-changeset.diff +++ b/xen-changeset.diff @@ -1,12 +1,12 @@ -Index: xen-3.4.1-testing/xen/Makefile +Index: xen-4.0.0-testing/xen/Makefile =================================================================== ---- xen-3.4.1-testing.orig/xen/Makefile -+++ xen-3.4.1-testing/xen/Makefile +--- xen-4.0.0-testing.orig/xen/Makefile ++++ xen-4.0.0-testing/xen/Makefile @@ -1,3 +1,4 @@ +export XEN_CHANGESET = unavailable # This is the correct place to edit the build version. # All other places this is stored (eg. compile.h) should be autogenerated. - export XEN_VERSION = 3 + export XEN_VERSION = 4 @@ -82,7 +83,7 @@ delete-unfresh-files: @rm -f $@1 $@2 diff --git a/xen-config.diff b/xen-config.diff index 6956cce..3c187e5 100644 --- a/xen-config.diff +++ b/xen-config.diff @@ -1,14 +1,17 @@ -Index: xen-3.4.1-testing/Config.mk +Index: xen-4.0.0-testing/Config.mk =================================================================== ---- xen-3.4.1-testing.orig/Config.mk -+++ xen-3.4.1-testing/Config.mk -@@ -124,14 +124,14 @@ QEMU_REMOTE=http://xenbits.xensource.com +--- xen-4.0.0-testing.orig/Config.mk ++++ xen-4.0.0-testing/Config.mk +@@ -148,7 +148,7 @@ QEMU_REMOTE=http://xenbits.xensource.com # Specify which qemu-dm to use. This may be `ioemu' to use the old # Mercurial in-tree version, or a local directory, or a git URL. # CONFIG_QEMU ?= ../qemu-xen.git -CONFIG_QEMU ?= $(QEMU_REMOTE) -+CONFIG_QEMU ?= ioemu-remote ++CONFIG_QEMU ?= ioemu-remote + QEMU_TAG := xen-4.0.0-rc1 + #QEMU_TAG ?= 2621a102cd74cd6691bed30f638581639fcb141d +@@ -164,9 +164,9 @@ CONFIG_OCAML_XENSTORED ?= n # Optional components XENSTAT_XENTOP ?= y VTPM_TOOLS ?= n @@ -20,3 +23,21 @@ Index: xen-3.4.1-testing/Config.mk --include $(XEN_ROOT)/.config +#-include $(XEN_ROOT)/.config +Index: xen-4.0.0-testing/tools/libxc/Makefile +=================================================================== +--- xen-4.0.0-testing.orig/tools/libxc/Makefile ++++ xen-4.0.0-testing/tools/libxc/Makefile +@@ -169,10 +169,10 @@ zlib-options = $(shell \ + fi) | grep $(1)) + endif + +-xc_dom_bzimageloader.o: CFLAGS += $(call zlib-options,D) +-xc_dom_bzimageloader.opic: CFLAGS += $(call zlib-options,D) ++#xc_dom_bzimageloader.o: CFLAGS += $(call zlib-options,D) ++#xc_dom_bzimageloader.opic: CFLAGS += $(call zlib-options,D) + +-libxenguest.so.$(MAJOR).$(MINOR): LDFLAGS += $(call zlib-options,l) ++#libxenguest.so.$(MAJOR).$(MINOR): LDFLAGS += $(call zlib-options,l) + libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so + $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $(GUEST_PIC_OBJS) -lz -lxenctrl $(PTHREAD_LIBS) + diff --git a/xen-destdir.diff b/xen-destdir.diff index 114f745..1789319 100644 --- a/xen-destdir.diff +++ b/xen-destdir.diff @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/docs/Makefile +Index: xen-4.0.0-testing/docs/Makefile =================================================================== ---- xen-3.4.1-testing.orig/docs/Makefile -+++ xen-3.4.1-testing/docs/Makefile +--- xen-4.0.0-testing.orig/docs/Makefile ++++ xen-4.0.0-testing/docs/Makefile @@ -90,7 +90,8 @@ install: all $(INSTALL_DIR) $(DESTDIR)$(MANDIR) cp -dR man1 $(DESTDIR)$(MANDIR) @@ -22,10 +22,10 @@ Index: xen-3.4.1-testing/docs/Makefile + ln -sf $*.html html.done/$*/index.html + rm -rf html/ + -Index: xen-3.4.1-testing/tools/security/Makefile +Index: xen-4.0.0-testing/tools/security/Makefile =================================================================== ---- xen-3.4.1-testing.orig/tools/security/Makefile -+++ xen-3.4.1-testing/tools/security/Makefile +--- xen-4.0.0-testing.orig/tools/security/Makefile ++++ xen-4.0.0-testing/tools/security/Makefile @@ -60,8 +60,8 @@ install: all $(ACM_CONFIG_FILE) $(INSTALL_DATA) $(ACM_INST_HTML) $(DESTDIR)$(ACM_SECGEN_HTMLDIR) $(INSTALL_DIR) $(DESTDIR)$(ACM_SECGEN_CGIDIR) @@ -37,24 +37,24 @@ Index: xen-3.4.1-testing/tools/security/Makefile else .PHONY: all all: -Index: xen-3.4.1-testing/tools/pygrub/Makefile +Index: xen-4.0.0-testing/tools/pygrub/Makefile =================================================================== ---- xen-3.4.1-testing.orig/tools/pygrub/Makefile -+++ xen-3.4.1-testing/tools/pygrub/Makefile +--- xen-4.0.0-testing.orig/tools/pygrub/Makefile ++++ xen-4.0.0-testing/tools/pygrub/Makefile @@ -11,7 +11,7 @@ build: .PHONY: install install: all CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install \ - $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force + --prefix="/usr" --root="$(DESTDIR)" --force + $(INSTALL_PYTHON_PROG) src/pygrub $(DESTDIR)/$(BINDIR)/pygrub $(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot - .PHONY: clean -Index: xen-3.4.1-testing/tools/python/Makefile +Index: xen-4.0.0-testing/tools/python/Makefile =================================================================== ---- xen-3.4.1-testing.orig/tools/python/Makefile -+++ xen-3.4.1-testing/tools/python/Makefile -@@ -56,7 +56,7 @@ refresh-po: $(POTFILE) +--- xen-4.0.0-testing.orig/tools/python/Makefile ++++ xen-4.0.0-testing/tools/python/Makefile +@@ -60,7 +60,7 @@ refresh-po: $(POTFILE) .PHONY: install install: install-messages install-dtd CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install \ @@ -62,11 +62,11 @@ Index: xen-3.4.1-testing/tools/python/Makefile + --prefix="/usr" --root="$(DESTDIR)" --force install-dtd: all - $(INSTALL_DIR) $(DESTDIR)$(DOCDIR) -Index: xen-3.4.1-testing/tools/xenstore/Makefile + $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR) +Index: xen-4.0.0-testing/tools/xenstore/Makefile =================================================================== ---- xen-3.4.1-testing.orig/tools/xenstore/Makefile -+++ xen-3.4.1-testing/tools/xenstore/Makefile +--- xen-4.0.0-testing.orig/tools/xenstore/Makefile ++++ xen-4.0.0-testing/tools/xenstore/Makefile @@ -10,6 +10,7 @@ CFLAGS += $(CFLAGS_libxenctrl) CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod @@ -75,8 +75,8 @@ Index: xen-3.4.1-testing/tools/xenstore/Makefile XENSTORED_OBJS = xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o tdb.o hashtable.o -@@ -30,7 +31,7 @@ endif - all: libxenstore.so libxenstore.a xenstored clients xs_tdb_dump +@@ -35,7 +36,7 @@ endif + all: $(ALL_TARGETS) .PHONY: clients -clients: xenstore $(CLIENTS) xenstore-control @@ -84,7 +84,7 @@ Index: xen-3.4.1-testing/tools/xenstore/Makefile ifeq ($(CONFIG_SunOS),y) xenstored_probes.h: xenstored_probes.d -@@ -50,6 +51,9 @@ xenstored: $(XENSTORED_OBJS) +@@ -55,6 +56,9 @@ xenstored: $(XENSTORED_OBJS) $(CLIENTS): xenstore ln -f xenstore $@ @@ -94,7 +94,7 @@ Index: xen-3.4.1-testing/tools/xenstore/Makefile xenstore: xenstore_client.o $(LIBXENSTORE) $(CC) $(CFLAGS) $(LDFLAGS) $< -L. -lxenstore $(SOCKET_LIBS) -o $@ -@@ -77,7 +81,7 @@ clean: +@@ -82,7 +86,7 @@ clean: rm -f *.a *.o *.opic *.so* xenstored_probes.h rm -f xenstored xs_random xs_stress xs_crashme rm -f xs_tdb_dump xenstore-control @@ -103,15 +103,15 @@ Index: xen-3.4.1-testing/tools/xenstore/Makefile $(RM) $(DEPS) .PHONY: TAGS -@@ -92,6 +96,7 @@ tarball: clean - install: all - $(INSTALL_DIR) $(DESTDIR)/var/run/xenstored +@@ -100,6 +104,7 @@ ifneq ($(CONFIG_OCAML_XENSTORED),y) $(INSTALL_DIR) $(DESTDIR)/var/lib/xenstored + $(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR) + endif + $(INSTALL_DIR) $(DESTDIR)/bin $(INSTALL_DIR) $(DESTDIR)$(BINDIR) $(INSTALL_DIR) $(DESTDIR)$(SBINDIR) $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR) -@@ -101,6 +106,9 @@ install: all +@@ -108,6 +113,9 @@ endif set -e ; for c in $(CLIENTS) ; do \ ln -f $(DESTDIR)$(BINDIR)/xenstore $(DESTDIR)$(BINDIR)/$${c} ; \ done @@ -121,12 +121,12 @@ Index: xen-3.4.1-testing/tools/xenstore/Makefile $(INSTALL_DIR) $(DESTDIR)$(LIBDIR) $(INSTALL_PROG) libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR) ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR) -Index: xen-3.4.1-testing/tools/hotplug/Linux/Makefile +Index: xen-4.0.0-testing/tools/hotplug/Linux/Makefile =================================================================== ---- xen-3.4.1-testing.orig/tools/hotplug/Linux/Makefile -+++ xen-3.4.1-testing/tools/hotplug/Linux/Makefile -@@ -40,18 +40,6 @@ endif - UDEV_RULES_DIR = /etc/udev +--- xen-4.0.0-testing.orig/tools/hotplug/Linux/Makefile ++++ xen-4.0.0-testing/tools/hotplug/Linux/Makefile +@@ -38,18 +38,6 @@ endif + UDEV_RULES_DIR = $(CONFIG_DIR)/udev UDEV_RULES = xen-backend.rules xend.rules -DI = $(if $(DISTDIR),$(shell readlink -f $(DISTDIR)),) @@ -144,7 +144,7 @@ Index: xen-3.4.1-testing/tools/hotplug/Linux/Makefile .PHONY: all all: -@@ -59,15 +47,15 @@ all: +@@ -57,16 +45,16 @@ all: build: .PHONY: install @@ -153,17 +153,19 @@ Index: xen-3.4.1-testing/tools/hotplug/Linux/Makefile .PHONY: install-initd install-initd: - [ -d $(DESTDIR)/etc/init.d ] || $(INSTALL_DIR) $(DESTDIR)/etc/init.d -- [ -d $(DESTDIR)/etc/sysconfig ] || $(INSTALL_DIR) $(DESTDIR)/etc/sysconfig + [ -d $(DESTDIR)$(CONFIG_DIR)/init.d ] || $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/init.d +- [ -d $(DESTDIR)$(CONFIG_DIR)/sysconfig ] || $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/sysconfig + [ -d $(DESTDIR)/var/adm/fillup-templates ] || $(INSTALL_DIR) $(DESTDIR)/var/adm/fillup-templates/ - $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)/etc/init.d - $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)/etc/init.d -- $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)/etc/sysconfig/xendomains + $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d +- $(INSTALL_PROG) $(XEND_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xend ++ $(INSTALL_PROG) $(XEND_SYSCONFIG) $(DESTDIR)/var/adm/fillup-templates/ + $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d +- $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xendomains + $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)/var/adm/fillup-templates/ .PHONY: install-scripts install-scripts: -@@ -97,8 +85,7 @@ install-udev: +@@ -96,8 +84,7 @@ install-udev: $(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)/rules.d set -e; for i in $(UDEV_RULES); \ do \ diff --git a/xen-disable-libxl.diff b/xen-disable-libxl.diff new file mode 100644 index 0000000..3d7bb6f --- /dev/null +++ b/xen-disable-libxl.diff @@ -0,0 +1,13 @@ +Index: xen-4.0.0-testing/tools/Makefile +=================================================================== +--- xen-4.0.0-testing.orig/tools/Makefile ++++ xen-4.0.0-testing/tools/Makefile +@@ -33,7 +33,7 @@ SUBDIRS-$(CONFIG_Linux) += fs-back + SUBDIRS-$(CONFIG_NetBSD) += fs-back + SUBDIRS-$(CONFIG_IOEMU) += ioemu-dir + SUBDIRS-y += xenpmd +-SUBDIRS-y += libxl ++#SUBDIRS-y += libxl + SUBDIRS-y += remus + SUBDIRS-$(CONFIG_X86) += xenpaging + diff --git a/xen-disable-qemu-monitor.diff b/xen-disable-qemu-monitor.diff index dbccbda..e3cdbc6 100644 --- a/xen-disable-qemu-monitor.diff +++ b/xen-disable-qemu-monitor.diff @@ -5,11 +5,11 @@ the "sendkey" command, among other useful things), remove all console commands that can read/write dom0's state. -Index: xen-3.4.1-testing/tools/ioemu-remote/monitor.c +Index: xen-4.0.0-testing/tools/ioemu-remote/monitor.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/monitor.c -+++ xen-3.4.1-testing/tools/ioemu-remote/monitor.c -@@ -1481,6 +1481,7 @@ static const term_cmd_t term_cmds[] = { +--- xen-4.0.0-testing.orig/tools/ioemu-remote/monitor.c ++++ xen-4.0.0-testing/tools/ioemu-remote/monitor.c +@@ -1497,6 +1497,7 @@ static const term_cmd_t term_cmds[] = { "device|all", "commit changes to the disk images (if -snapshot is used) or backing files" }, { "info", "s?", do_info, "subcommand", "show various information about the system state" }, @@ -17,7 +17,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/monitor.c { "q|quit", "", do_quit, "", "quit the emulator" }, { "eject", "-fB", do_eject, -@@ -1493,6 +1494,7 @@ static const term_cmd_t term_cmds[] = { +@@ -1509,6 +1510,7 @@ static const term_cmd_t term_cmds[] = { "filename", "output logs to 'filename'" }, { "log", "s", do_log, "item1[,...]", "activate logging of the specified items to '/tmp/qemu.log'" }, @@ -25,22 +25,18 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/monitor.c { "savevm", "s?", do_savevm, "tag|id", "save a VM snapshot. If no tag or id are provided, a new snapshot is created" }, { "loadvm", "s", do_loadvm, -@@ -1522,12 +1524,14 @@ static const term_cmd_t term_cmds[] = { +@@ -1538,8 +1540,10 @@ static const term_cmd_t term_cmds[] = { "", "reset the system" }, { "system_powerdown", "", do_system_powerdown, "", "send system power down event" }, +#ifdef CONFIG_TRUSTED_CLIENT { "sum", "ii", do_sum, "addr size", "compute the checksum of a memory region" }, ++#endif { "usb_add", "s", do_usb_add, "device", "add USB device (e.g. 'host:bus.addr' or 'host:vendor_id:product_id')" }, { "usb_del", "s", do_usb_del, - "device", "remove USB device 'bus.addr'" }, -+#endif - #ifdef CONFIG_PHP_DEBUG - { "pci_add", "s", do_pci_add, - "device", "insert PCI pass-through device by BDF,e.g. (dom, bus, dev, func) by hex '0x0, 0x3, 0x0, 0x0'" }, -@@ -1542,6 +1546,7 @@ static const term_cmd_t term_cmds[] = { +@@ -1558,6 +1562,7 @@ static const term_cmd_t term_cmds[] = { "state", "change mouse button state (1=L, 2=M, 4=R)" }, { "mouse_set", "i", do_mouse_set, "index", "set which mouse device receives events" }, @@ -48,7 +44,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/monitor.c #ifdef HAS_AUDIO { "wavcapture", "si?i?i?", do_wav_capture, "path [frequency bits channels]", -@@ -1549,6 +1554,7 @@ static const term_cmd_t term_cmds[] = { +@@ -1565,6 +1570,7 @@ static const term_cmd_t term_cmds[] = { #endif { "stopcapture", "i", do_stop_capture, "capture index", "stop capture" }, @@ -56,7 +52,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/monitor.c { "memsave", "lis", do_memory_save, "addr size file", "save to disk virtual memory dump starting at 'addr' of size 'size'", }, { "pmemsave", "lis", do_physical_memory_save, -@@ -1628,6 +1634,7 @@ static const term_cmd_t info_cmds[] = { +@@ -1646,6 +1652,7 @@ static const term_cmd_t info_cmds[] = { "", "show KVM information", }, { "usb", "", usb_info, "", "show guest USB devices", }, @@ -64,7 +60,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/monitor.c { "usbhost", "", usb_host_info, "", "show host USB devices", }, { "profile", "", do_info_profile, -@@ -1659,6 +1666,7 @@ static const term_cmd_t info_cmds[] = { +@@ -1677,6 +1684,7 @@ static const term_cmd_t info_cmds[] = { { "migrate", "", do_info_migrate, "", "show migration status" }, { "balloon", "", do_info_balloon, "", "show balloon information" }, diff --git a/xen-disable-xenpaging.diff b/xen-disable-xenpaging.diff new file mode 100644 index 0000000..1fae149 --- /dev/null +++ b/xen-disable-xenpaging.diff @@ -0,0 +1,13 @@ +Index: xen-4.0.0-testing/tools/Makefile +=================================================================== +--- xen-4.0.0-testing.orig/tools/Makefile ++++ xen-4.0.0-testing/tools/Makefile +@@ -35,7 +35,7 @@ SUBDIRS-$(CONFIG_IOEMU) += ioemu-dir + SUBDIRS-y += xenpmd + #SUBDIRS-y += libxl + SUBDIRS-y += remus +-SUBDIRS-$(CONFIG_X86) += xenpaging ++#SUBDIRS-$(CONFIG_X86) += xenpaging + + # These don't cross-compile + ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH)) diff --git a/xen-domUloader.diff b/xen-domUloader.diff index 4943134..c5fb14c 100644 --- a/xen-domUloader.diff +++ b/xen-domUloader.diff @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/python/xen/util/blkif.py +Index: xen-4.0.0-testing/tools/python/xen/util/blkif.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/util/blkif.py -+++ xen-3.4.1-testing/tools/python/xen/util/blkif.py -@@ -71,23 +71,24 @@ def blkdev_segment(name): +--- xen-4.0.0-testing.orig/tools/python/xen/util/blkif.py ++++ xen-4.0.0-testing/tools/python/xen/util/blkif.py +@@ -71,8 +71,8 @@ def blkdev_segment(name): 'type' : 'Disk' } return val @@ -12,8 +12,9 @@ Index: xen-3.4.1-testing/tools/python/xen/util/blkif.py + fn = typ = taptype = None if uname.find(":") != -1: (typ, fn) = uname.split(":", 1) - if typ in ("phy", "drbd") and not fn.startswith("/"): - fn = "/dev/%s" %(fn,) + +@@ -88,15 +88,16 @@ def _parse_uname(uname): + if typ == "tap": (taptype, fn) = fn.split(":", 1) - return (fn, taptype) @@ -28,15 +29,15 @@ Index: xen-3.4.1-testing/tools/python/xen/util/blkif.py def blkdev_uname_to_taptype(uname): """Take a blkdev uname and return the blktap type.""" - return _parse_uname(uname)[1] -+ return parse_uname(uname)[1][0] ++ return parse_uname(uname)[1] def mount_mode(name): mode = None -Index: xen-3.4.1-testing/tools/python/xen/xend/server/DevController.py +Index: xen-4.0.0-testing/tools/python/xen/xend/server/DevController.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/server/DevController.py -+++ xen-3.4.1-testing/tools/python/xen/xend/server/DevController.py -@@ -593,6 +593,31 @@ class DevController: +--- xen-4.0.0-testing.orig/tools/python/xen/xend/server/DevController.py ++++ xen-4.0.0-testing/tools/python/xen/xend/server/DevController.py +@@ -592,6 +592,31 @@ class DevController: return (Missing, None) @@ -68,10 +69,10 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/server/DevController.py def backendPath(self, backdom, devid): """Construct backend path given the backend domain and device id. -Index: xen-3.4.1-testing/tools/python/xen/xend/XendBootloader.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendBootloader.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendBootloader.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendBootloader.py +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendBootloader.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendBootloader.py @@ -12,7 +12,7 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # @@ -81,7 +82,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendBootloader.py import random import shlex from xen.xend import sxp -@@ -38,8 +38,25 @@ def bootloader(blexec, disk, dom, quiet +@@ -38,8 +38,25 @@ def bootloader(blexec, disk, dom, quiet msg = "Bootloader isn't executable" log.error(msg) raise VmError(msg) @@ -109,20 +110,20 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendBootloader.py log.error(msg) raise VmError(msg) -Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -35,7 +35,7 @@ from types import StringTypes +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py +@@ -37,7 +37,7 @@ from types import StringTypes import xen.lowlevel.xc - from xen.util import asserts + from xen.util import asserts, auxbin -from xen.util.blkif import blkdev_uname_to_file, blkdev_uname_to_taptype +from xen.util.blkif import parse_uname import xen.util.xsm.xsm as security from xen.util import xsconstants - -@@ -2135,6 +2135,10 @@ class XendDomainInfo: + from xen.util import mkdir +@@ -2320,6 +2320,10 @@ class XendDomainInfo: deviceClass, config = self.info['devices'].get(dev_uuid) self._waitForDevice(deviceClass, config['devid']) @@ -133,19 +134,25 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py def _waitForDevice_destroy(self, deviceClass, devid, backpath): return self.getDeviceController(deviceClass).waitForDevice_destroy( devid, backpath) -@@ -2893,9 +2897,19 @@ class XendDomainInfo: +@@ -3206,7 +3210,7 @@ class XendDomainInfo: devtype = devinfo[0] disk = devinfo[1]['uname'] - fn = blkdev_uname_to_file(disk) -- taptype = blkdev_uname_to_taptype(disk) -- mounted = devtype == 'tap' and taptype != 'aio' and taptype != 'sync' and not os.stat(fn).st_rdev + (fn, types) = parse_uname(disk) -+ + + # If this is a drbd volume, check if we need to activate it + if disk.find(":") != -1: +@@ -3217,8 +3221,17 @@ class XendDomainInfo: + if state == 'Secondary': + os.system('/sbin/drbdadm primary ' + diskname) + +- taptype = blkdev_uname_to_taptype(disk) +- mounted = devtype in ['tap', 'tap2'] and taptype != 'aio' and taptype != 'sync' and not os.stat(fn).st_rdev + def _shouldMount(types): + if types[0] in ('file', 'phy'): + return False -+ if types[0] == 'tap': ++ if types[0] == 'tap' or types[0] == 'tap2': + if types[1] in ('aio', 'sync'): + return False + else: @@ -156,27 +163,26 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py if mounted: # This is a file, not a device. pygrub can cope with a # file if it's raw, but if it's QCOW or other such formats -@@ -2911,7 +2925,9 @@ class XendDomainInfo: +@@ -3234,7 +3247,8 @@ class XendDomainInfo: from xen.xend import XendDomain dom0 = XendDomain.instance().privilegedDomain() - dom0._waitForDeviceUUID(dom0.create_vbd(vbd, disk)) + vbd_uuid = dom0.create_vbd(vbd, disk) -+ dom0._waitForDeviceUUID(vbd_uuid) + dom0._waitForDeviceFrontUUID(vbd_uuid) fn = BOOTLOADER_LOOPBACK_DEVICE try: -@@ -2921,8 +2937,10 @@ class XendDomainInfo: +@@ -3244,8 +3258,10 @@ class XendDomainInfo: if mounted: log.info("Unmounting %s from %s." % (fn, BOOTLOADER_LOOPBACK_DEVICE)) - - dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEVICE) -+ if devtype == 'tap': -+ dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEVICE) ++ if devtype in ['tap', 'tap2']: ++ dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEVICE, rm_cfg = True) + else: -+ dom0.destroyDevice('vbd', BOOTLOADER_LOOPBACK_DEVICE) ++ dom0.destroyDevice('vbd', BOOTLOADER_LOOPBACK_DEVICE, rm_cfg = True) if blcfg is None: msg = "Had a bootloader specified, but can't find disk" diff --git a/xen-fixme-doc.diff b/xen-fixme-doc.diff index 4dfdf36..031ab21 100644 --- a/xen-fixme-doc.diff +++ b/xen-fixme-doc.diff @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/docs/man/xmdomain.cfg.pod.5 +Index: xen-4.0.0-testing/docs/man/xmdomain.cfg.pod.5 =================================================================== ---- xen-3.4.1-testing.orig/docs/man/xmdomain.cfg.pod.5 -+++ xen-3.4.1-testing/docs/man/xmdomain.cfg.pod.5 +--- xen-4.0.0-testing.orig/docs/man/xmdomain.cfg.pod.5 ++++ xen-4.0.0-testing/docs/man/xmdomain.cfg.pod.5 @@ -335,16 +335,10 @@ at hda1, which is the root filesystem. =item I @@ -19,16 +19,16 @@ Index: xen-3.4.1-testing/docs/man/xmdomain.cfg.pod.5 =back =head1 SEE ALSO -Index: xen-3.4.1-testing/docs/man/xm.pod.1 +Index: xen-4.0.0-testing/docs/man/xm.pod.1 =================================================================== ---- xen-3.4.1-testing.orig/docs/man/xm.pod.1 -+++ xen-3.4.1-testing/docs/man/xm.pod.1 +--- xen-4.0.0-testing.orig/docs/man/xm.pod.1 ++++ xen-4.0.0-testing/docs/man/xm.pod.1 @@ -297,7 +297,8 @@ scheduling by the Xen hypervisor. =item B -FIXME: Why would you ever see this state? -+The guest has requested to be shutdown, rebooted or suspended, and the ++The guest has requested to be shutdown, rebooted or suspended, and the +domain is in the process of being destroyed in response. =item B diff --git a/xen-hvm-default-bridge.diff b/xen-hvm-default-bridge.diff index fee063e..bcb0660 100644 --- a/xen-hvm-default-bridge.diff +++ b/xen-hvm-default-bridge.diff @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/ioemu-remote/net.h +Index: xen-4.0.0-testing/tools/ioemu-remote/net.h =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/net.h -+++ xen-3.4.1-testing/tools/ioemu-remote/net.h +--- xen-4.0.0-testing.orig/tools/ioemu-remote/net.h ++++ xen-4.0.0-testing/tools/ioemu-remote/net.h @@ -107,8 +107,8 @@ void net_host_device_add(const char *dev void net_host_device_remove(int vlan_id, const char *device); @@ -13,10 +13,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/net.h #endif #ifdef __sun__ #define SMBD_COMMAND "/usr/sfw/sbin/smbd" -Index: xen-3.4.1-testing/tools/ioemu-remote/net.c +Index: xen-4.0.0-testing/tools/ioemu-remote/net.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/net.c -+++ xen-3.4.1-testing/tools/ioemu-remote/net.c +--- xen-4.0.0-testing.orig/tools/ioemu-remote/net.c ++++ xen-4.0.0-testing/tools/ioemu-remote/net.c @@ -1759,9 +1759,10 @@ int net_client_init(const char *device, } if (get_param_value(script_arg, sizeof(script_arg), "scriptarg", p) == 0 && @@ -30,11 +30,11 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/net.c } } else #endif -Index: xen-3.4.1-testing/tools/python/xen/xend/image.py +Index: xen-4.0.0-testing/tools/python/xen/xend/image.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/image.py -+++ xen-3.4.1-testing/tools/python/xen/xend/image.py -@@ -830,14 +830,16 @@ class HVMImageHandler(ImageHandler): +--- xen-4.0.0-testing.orig/tools/python/xen/xend/image.py ++++ xen-4.0.0-testing/tools/python/xen/xend/image.py +@@ -912,11 +912,13 @@ class HVMImageHandler(ImageHandler): mac = devinfo.get('mac') if mac is None: raise VmError("MAC address not specified or generated.") @@ -42,22 +42,19 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/image.py + bridge = devinfo.get('bridge', None) model = devinfo.get('model', 'rtl8139') ret.append("-net") - ret.append("nic,vlan=%d,macaddr=%s,model=%s" % - (nics, mac, model)) - ret.append("-net") -- ret.append("tap,vlan=%d,ifname=tap%d.%d,bridge=%s" % -- (nics, self.vm.getDomid(), nics-1, bridge)) -+ net = "tap,vlan=%d,ifname=tap%d.%d" % (nics, self.vm.getDomid(), nics-1) +- ret.append("nic,vlan=%d,macaddr=%s,model=%s" % +- (nics, mac, model)) ++ net = "nic,vlan=%d,macaddr=%s,model=%s" % (nics, mac, model) + if bridge: + net += ",bridge=%s" % bridge + ret.append(net) - - if nics == 0: - ret.append("-net") -Index: xen-3.4.1-testing/tools/ioemu-remote/i386-dm/qemu-ifup + vifname = devinfo.get('vifname') + if vifname: + vifname = "tap-" + vifname +Index: xen-4.0.0-testing/tools/ioemu-remote/i386-dm/qemu-ifup-Linux =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/i386-dm/qemu-ifup -+++ xen-3.4.1-testing/tools/ioemu-remote/i386-dm/qemu-ifup +--- xen-4.0.0-testing.orig/tools/ioemu-remote/i386-dm/qemu-ifup-Linux ++++ xen-4.0.0-testing/tools/ioemu-remote/i386-dm/qemu-ifup-Linux @@ -1,36 +1,22 @@ #!/bin/sh diff --git a/xen-hvm-default-pae.diff b/xen-hvm-default-pae.diff index 057d4ad..804e407 100644 --- a/xen-hvm-default-pae.diff +++ b/xen-hvm-default-pae.diff @@ -1,10 +1,10 @@ PAE must be on for 64-on-64 to work at all. -Index: xen-3.4.1-testing/tools/python/xen/xend/image.py +Index: xen-4.0.0-testing/tools/python/xen/xend/image.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/image.py -+++ xen-3.4.1-testing/tools/python/xen/xend/image.py -@@ -941,7 +941,7 @@ class X86_HVM_ImageHandler(HVMImageHandl +--- xen-4.0.0-testing.orig/tools/python/xen/xend/image.py ++++ xen-4.0.0-testing/tools/python/xen/xend/image.py +@@ -1030,7 +1030,7 @@ class X86_HVM_ImageHandler(HVMImageHandl def configure(self, vmConfig): HVMImageHandler.configure(self, vmConfig) diff --git a/xen-ioemu-hvm-pv-support.diff b/xen-ioemu-hvm-pv-support.diff index 1a81fa4..a066ac7 100644 --- a/xen-ioemu-hvm-pv-support.diff +++ b/xen-ioemu-hvm-pv-support.diff @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_platform.c +Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_platform.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_platform.c -+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_platform.c +--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/xen_platform.c ++++ xen-4.0.0-testing/tools/ioemu-remote/hw/xen_platform.c @@ -30,6 +30,8 @@ #include "qemu-xen.h" #include "net.h" @@ -11,7 +11,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_platform.c #include #include -@@ -331,11 +333,51 @@ static void xen_platform_ioport_writeb(v +@@ -335,11 +337,51 @@ static void xen_platform_ioport_writeb(v } } diff --git a/xen-max-free-mem.diff b/xen-max-free-mem.diff index 0c2c493..b5ca22a 100644 --- a/xen-max-free-mem.diff +++ b/xen-max-free-mem.diff @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/python/xen/xend/XendNode.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendNode.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendNode.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendNode.py -@@ -809,11 +809,35 @@ class XendNode: +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendNode.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendNode.py +@@ -907,15 +907,39 @@ class XendNode: info['cpu_mhz'] = info['cpu_khz'] / 1000 @@ -10,7 +10,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendNode.py - info['total_memory'] = info['total_memory'] / 1024 - info['free_memory'] = info['free_memory'] / 1024 - info['node_to_cpu'] = self.format_node_to_cpu(info) -- info['node_to_memory'] = self.format_node_to_memory(info) +- info['node_to_memory'] = \ + configured_floor = xendoptions().get_dom0_min_mem() * 1024 + from xen.xend import balloon + try: @@ -30,8 +30,11 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendNode.py + info['free_memory'] = info['free_memory'] / 1024 + info['max_free_memory'] = info['max_free_memory'] / 1024 + info['node_to_cpu'] = self.format_node_to_cpu(info) -+ info['node_to_memory'] = self.format_node_to_memory(info) -+ ++ info['node_to_memory'] = \ + self.format_node_to_memory(info, 'node_to_memory') + info['node_to_dma32_mem'] = \ + self.format_node_to_memory(info, 'node_to_dma32_mem') + + # FIXME: These are hard-coded to be the inverse of the getXenMemory + # functions in image.py. Find a cleaner way. + info['max_para_memory'] = info['max_free_memory'] - 4 @@ -40,10 +43,11 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendNode.py + info['max_hvm_memory'] = int((info['max_free_memory']-12) * (1-2.4/1024)) + if info['max_hvm_memory'] < 0: + info['max_hvm_memory'] = 0 - ++ ITEM_ORDER = ['nr_cpus', 'nr_nodes', -@@ -824,6 +848,9 @@ class XendNode: + 'cores_per_socket', +@@ -925,6 +949,9 @@ class XendNode: 'virt_caps', 'total_memory', 'free_memory', @@ -51,13 +55,13 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendNode.py + 'max_para_memory', + 'max_hvm_memory', 'node_to_cpu', - 'node_to_memory' - ] -Index: xen-3.4.1-testing/tools/python/xen/xend/balloon.py + 'node_to_memory', + 'node_to_dma32_mem' +Index: xen-4.0.0-testing/tools/python/xen/xend/balloon.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/balloon.py -+++ xen-3.4.1-testing/tools/python/xen/xend/balloon.py -@@ -41,6 +41,8 @@ SLEEP_TIME_GROWTH = 0.1 +--- xen-4.0.0-testing.orig/tools/python/xen/xend/balloon.py ++++ xen-4.0.0-testing/tools/python/xen/xend/balloon.py +@@ -43,6 +43,8 @@ SLEEP_TIME_GROWTH = 0.1 # label actually shown in the PROC_XEN_BALLOON file. #labels = { 'current' : 'Current allocation', # 'target' : 'Requested target', @@ -66,7 +70,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/balloon.py # 'low-balloon' : 'Low-mem balloon', # 'high-balloon' : 'High-mem balloon', # 'limit' : 'Xen hard limit' } -@@ -67,6 +69,23 @@ def get_dom0_target_alloc(): +@@ -69,6 +71,23 @@ def get_dom0_target_alloc(): raise VmError('Failed to query target memory allocation of dom0.') return kb @@ -90,13 +94,13 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/balloon.py def free(need_mem, dominfo): """Balloon out memory from the privileged domain so that there is the specified required amount (in KiB) free. -Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -1295,6 +1295,27 @@ class XendDomainInfo: - dev_str_list = dev_str_list + [dev_str] - return dev_str_list +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py +@@ -1452,6 +1452,27 @@ class XendDomainInfo: + pci_conf = self.info['devices'][dev_uuid][1] + return map(pci_dict_to_bdf_str, pci_conf['devs']) + def capAndSetMemoryTarget(self, target): + """Potentially lowers the requested target to the largest possible @@ -122,11 +126,11 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py def setMemoryTarget(self, target): """Set the memory target of this domain. @param target: In MiB. -Index: xen-3.4.1-testing/tools/python/xen/xend/server/SrvDomain.py +Index: xen-4.0.0-testing/tools/python/xen/xend/server/SrvDomain.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/server/SrvDomain.py -+++ xen-3.4.1-testing/tools/python/xen/xend/server/SrvDomain.py -@@ -172,7 +172,7 @@ class SrvDomain(SrvDir): +--- xen-4.0.0-testing.orig/tools/python/xen/xend/server/SrvDomain.py ++++ xen-4.0.0-testing/tools/python/xen/xend/server/SrvDomain.py +@@ -173,7 +173,7 @@ class SrvDomain(SrvDir): def op_mem_target_set(self, _, req): diff --git a/xen-no-dummy-nfs-ip.diff b/xen-no-dummy-nfs-ip.diff index 1762ac0..c833618 100644 --- a/xen-no-dummy-nfs-ip.diff +++ b/xen-no-dummy-nfs-ip.diff @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/python/xen/xm/create.py +Index: xen-4.0.0-testing/tools/python/xen/xm/create.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xm/create.py -+++ xen-3.4.1-testing/tools/python/xen/xm/create.py -@@ -1160,9 +1160,8 @@ def preprocess_access_control(vals): +--- xen-4.0.0-testing.orig/tools/python/xen/xm/create.py ++++ xen-4.0.0-testing/tools/python/xen/xm/create.py +@@ -1321,9 +1321,8 @@ def preprocess_access_control(vals): def preprocess_ip(vals): if vals.ip or vals.dhcp != 'off': diff --git a/xen-paths.diff b/xen-paths.diff index 454bc05..6fa0817 100644 --- a/xen-paths.diff +++ b/xen-paths.diff @@ -1,20 +1,20 @@ -Index: xen-3.4.1-testing/tools/python/xen/xm/create.py +Index: xen-4.0.0-testing/tools/python/xen/xm/create.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xm/create.py -+++ xen-3.4.1-testing/tools/python/xen/xm/create.py -@@ -72,7 +72,7 @@ gopts.opt('quiet', short='q', +--- xen-4.0.0-testing.orig/tools/python/xen/xm/create.py ++++ xen-4.0.0-testing/tools/python/xen/xm/create.py +@@ -73,7 +73,7 @@ gopts.opt('quiet', short='q', use="Quiet.") gopts.opt('path', val='PATH', -- fn=set_value, default='.:/etc/xen', -+ fn=set_value, default='.:/etc/xen/vm', +- fn=set_value, default='.:' + auxbin.xen_configdir(), ++ fn=set_value, default='.:' + auxbin.xen_configdir() + "/vm", use="Search path for configuration scripts. " "The value of PATH is a colon-separated directory list.") -Index: xen-3.4.1-testing/docs/man/xm.pod.1 +Index: xen-4.0.0-testing/docs/man/xm.pod.1 =================================================================== ---- xen-3.4.1-testing.orig/docs/man/xm.pod.1 -+++ xen-3.4.1-testing/docs/man/xm.pod.1 +--- xen-4.0.0-testing.orig/docs/man/xm.pod.1 ++++ xen-4.0.0-testing/docs/man/xm.pod.1 @@ -77,7 +77,7 @@ in the config file. See L format, and possible options used in either the configfile or for I. @@ -33,10 +33,10 @@ Index: xen-3.4.1-testing/docs/man/xm.pod.1 soon as it is run. =item I -Index: xen-3.4.1-testing/docs/man/xmdomain.cfg.pod.5 +Index: xen-4.0.0-testing/docs/man/xmdomain.cfg.pod.5 =================================================================== ---- xen-3.4.1-testing.orig/docs/man/xmdomain.cfg.pod.5 -+++ xen-3.4.1-testing/docs/man/xmdomain.cfg.pod.5 +--- xen-4.0.0-testing.orig/docs/man/xmdomain.cfg.pod.5 ++++ xen-4.0.0-testing/docs/man/xmdomain.cfg.pod.5 @@ -4,9 +4,9 @@ xmdomain.cfg - xm domain config file for =head1 SYNOPSIS diff --git a/xen-qemu-iscsi-fix.patch b/xen-qemu-iscsi-fix.patch index 5bf0307..256c02a 100644 --- a/xen-qemu-iscsi-fix.patch +++ b/xen-qemu-iscsi-fix.patch @@ -1,17 +1,17 @@ -Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c +Index: xen-4.0.0-testing/tools/ioemu-remote/xenstore.c =================================================================== ---- xen-3.4.1-testing.orig/tools/ioemu-remote/xenstore.c -+++ xen-3.4.1-testing/tools/ioemu-remote/xenstore.c -@@ -313,7 +313,7 @@ void xenstore_parse_domain_config(int hv +--- xen-4.0.0-testing.orig/tools/ioemu-remote/xenstore.c ++++ xen-4.0.0-testing/tools/ioemu-remote/xenstore.c +@@ -398,7 +398,7 @@ void xenstore_parse_domain_config(int hv char *buf = NULL; char *fpath = NULL, *bpath = NULL, *btype = NULL, *dev = NULL, *params = NULL, *drv = NULL; -- int i, any_hdN = 0, ret, is_tap; -+ int i, j, any_hdN = 0, ret, is_tap; +- int i, ret, is_tap; ++ int i, j, ret, is_tap; unsigned int len, num, hd_index, pci_devid = 0; BlockDriverState *bs; BlockDriver *format; -@@ -400,12 +400,7 @@ void xenstore_parse_domain_config(int hv +@@ -485,12 +485,7 @@ void xenstore_parse_domain_config(int hv continue; free(danger_type); danger_type = xs_read(xsh, XBT_NULL, danger_buf, &len); @@ -25,18 +25,18 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c /* read the name of the device */ if (pasprintf(&buf, "%s/type", bpath) == -1) continue; -@@ -413,6 +408,35 @@ void xenstore_parse_domain_config(int hv +@@ -498,6 +493,35 @@ void xenstore_parse_domain_config(int hv drv = xs_read(xsh, XBT_NULL, buf, &len); if (drv == NULL) continue; + + free(params); -+ if (!strcmp(drv,"iscsi") || !strcmp(drv, "npiv")) -+ { ++ if (!strcmp(drv,"iscsi") || !strcmp(drv, "npiv") || ++ !strcmp(drv,"dmmd")) { + if (pasprintf(&buf, "%s/node", bpath) == -1) + continue; + -+ /* wait for block-[iscsi|npiv] script to complete and populate the ++ /* wait for block-[iscsi|npiv|dmmd] script to complete and populate the + * node entry. try 30 times (30 secs) */ + for (j = 0; j < 30; j++) { + params = xs_read(xsh, XBT_NULL, buf, &len); diff --git a/xen-rpmoptflags.diff b/xen-rpmoptflags.diff index ef10a4f..1079766 100644 --- a/xen-rpmoptflags.diff +++ b/xen-rpmoptflags.diff @@ -1,19 +1,19 @@ -Index: xen-3.4.1-testing/tools/blktap/drivers/Makefile +Index: xen-4.0.0-testing/tools/blktap/drivers/Makefile =================================================================== ---- xen-3.4.1-testing.orig/tools/blktap/drivers/Makefile -+++ xen-3.4.1-testing/tools/blktap/drivers/Makefile -@@ -5,7 +5,6 @@ IBIN = blktapctrl tapdisk - QCOW_UTIL = img2qcow qcow2raw qcow-create +--- xen-4.0.0-testing.orig/tools/blktap/drivers/Makefile ++++ xen-4.0.0-testing/tools/blktap/drivers/Makefile +@@ -6,7 +6,6 @@ QCOW_UTIL = img2qcow qcow2raw qcow-cr LIBAIO_DIR = ../../libaio/src + MEMSHR_DIR = ../../memshr -CFLAGS += -Werror CFLAGS += -Wno-unused CFLAGS += -I../lib CFLAGS += $(CFLAGS_libxenctrl) -Index: xen-3.4.1-testing/Config.mk +Index: xen-4.0.0-testing/Config.mk =================================================================== ---- xen-3.4.1-testing.orig/Config.mk -+++ xen-3.4.1-testing/Config.mk +--- xen-4.0.0-testing.orig/Config.mk ++++ xen-4.0.0-testing/Config.mk @@ -14,7 +14,7 @@ SHELL ?= /bin/sh # Tools to run on system hosting the build diff --git a/xen-tightvnc-args.diff b/xen-tightvnc-args.diff deleted file mode 100644 index 90b7e52..0000000 --- a/xen-tightvnc-args.diff +++ /dev/null @@ -1,14 +0,0 @@ -Index: xen-3.3.1-testing/tools/python/xen/xm/create.py -=================================================================== ---- xen-3.3.1-testing.orig/tools/python/xen/xm/create.py -+++ xen-3.3.1-testing/tools/python/xen/xm/create.py -@@ -1137,8 +1137,7 @@ def spawn_vnc(display): - returns the port that the vncviewer is listening on and sets the global - vncpid. On failure, returns 0. Note that vncviewer is daemonized. - """ -- vncargs = (["vncviewer", "-log", "*:stdout:0", -- "-listen", "%d" % (VNC_BASE_PORT + display) ]) -+ vncargs = (["vncviewer", "-listen", "%d" % (display) ]) - global vncpid - vncpid = utils.daemonize("vncviewer", vncargs) - if vncpid == 0: diff --git a/xen-warnings.diff b/xen-warnings.diff index 33abba1..cd136c8 100644 --- a/xen-warnings.diff +++ b/xen-warnings.diff @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/misc/miniterm/miniterm.c +Index: xen-4.0.0-testing/tools/misc/miniterm/miniterm.c =================================================================== ---- xen-3.4.1-testing.orig/tools/misc/miniterm/miniterm.c -+++ xen-3.4.1-testing/tools/misc/miniterm/miniterm.c +--- xen-4.0.0-testing.orig/tools/misc/miniterm/miniterm.c ++++ xen-4.0.0-testing/tools/misc/miniterm/miniterm.c @@ -157,7 +157,7 @@ int main(int argc, char **argv) case 0: close(1); /* stdout not needed */ @@ -35,10 +35,10 @@ Index: xen-3.4.1-testing/tools/misc/miniterm/miniterm.c break; } -Index: xen-3.4.1-testing/tools/libxc/xc_dom_elfloader.c +Index: xen-4.0.0-testing/tools/libxc/xc_dom_elfloader.c =================================================================== ---- xen-3.4.1-testing.orig/tools/libxc/xc_dom_elfloader.c -+++ xen-3.4.1-testing/tools/libxc/xc_dom_elfloader.c +--- xen-4.0.0-testing.orig/tools/libxc/xc_dom_elfloader.c ++++ xen-4.0.0-testing/tools/libxc/xc_dom_elfloader.c @@ -193,8 +193,9 @@ static int xc_dom_load_elf_symtab(struct if ( load ) @@ -50,10 +50,10 @@ Index: xen-3.4.1-testing/tools/libxc/xc_dom_elfloader.c elf_section_start(elf, shdr2), size); } -Index: xen-3.4.1-testing/tools/xenstore/Makefile +Index: xen-4.0.0-testing/tools/xenstore/Makefile =================================================================== ---- xen-3.4.1-testing.orig/tools/xenstore/Makefile -+++ xen-3.4.1-testing/tools/xenstore/Makefile +--- xen-4.0.0-testing.orig/tools/xenstore/Makefile ++++ xen-4.0.0-testing/tools/xenstore/Makefile @@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR = 3.0 MINOR = 0 @@ -63,10 +63,10 @@ Index: xen-3.4.1-testing/tools/xenstore/Makefile CFLAGS += -I. CFLAGS += $(CFLAGS_libxenctrl) -Index: xen-3.4.1-testing/tools/xenstore/xenstored_core.c +Index: xen-4.0.0-testing/tools/xenstore/xenstored_core.c =================================================================== ---- xen-3.4.1-testing.orig/tools/xenstore/xenstored_core.c -+++ xen-3.4.1-testing/tools/xenstore/xenstored_core.c +--- xen-4.0.0-testing.orig/tools/xenstore/xenstored_core.c ++++ xen-4.0.0-testing/tools/xenstore/xenstored_core.c @@ -77,8 +77,8 @@ static void check_store(void); int quota_nb_entry_per_domain = 1000; @@ -91,10 +91,10 @@ Index: xen-3.4.1-testing/tools/xenstore/xenstored_core.c break; case 'T': tracefile = optarg; -Index: xen-3.4.1-testing/tools/xenstore/xenstored_domain.c +Index: xen-4.0.0-testing/tools/xenstore/xenstored_domain.c =================================================================== ---- xen-3.4.1-testing.orig/tools/xenstore/xenstored_domain.c -+++ xen-3.4.1-testing/tools/xenstore/xenstored_domain.c +--- xen-4.0.0-testing.orig/tools/xenstore/xenstored_domain.c ++++ xen-4.0.0-testing/tools/xenstore/xenstored_domain.c @@ -212,7 +212,7 @@ void handle_event(void) { evtchn_port_t port; @@ -113,10 +113,10 @@ Index: xen-3.4.1-testing/tools/xenstore/xenstored_domain.c return -1; dom0 = new_domain(NULL, 0, port); -Index: xen-3.4.1-testing/tools/xenstore/xenstored_transaction.c +Index: xen-4.0.0-testing/tools/xenstore/xenstored_transaction.c =================================================================== ---- xen-3.4.1-testing.orig/tools/xenstore/xenstored_transaction.c -+++ xen-3.4.1-testing/tools/xenstore/xenstored_transaction.c +--- xen-4.0.0-testing.orig/tools/xenstore/xenstored_transaction.c ++++ xen-4.0.0-testing/tools/xenstore/xenstored_transaction.c @@ -82,7 +82,7 @@ struct transaction struct list_head changed_domains; }; @@ -126,10 +126,10 @@ Index: xen-3.4.1-testing/tools/xenstore/xenstored_transaction.c static unsigned int generation; /* Return tdb context to use for this connection. */ -Index: xen-3.4.1-testing/tools/xenstore/xenstore_client.c +Index: xen-4.0.0-testing/tools/xenstore/xenstore_client.c =================================================================== ---- xen-3.4.1-testing.orig/tools/xenstore/xenstore_client.c -+++ xen-3.4.1-testing/tools/xenstore/xenstore_client.c +--- xen-4.0.0-testing.orig/tools/xenstore/xenstore_client.c ++++ xen-4.0.0-testing/tools/xenstore/xenstore_client.c @@ -251,7 +251,7 @@ do_chmod(char *path, struct xs_permissio char **xsval = xs_directory(xsh, xth, path, &xsval_n); @@ -139,10 +139,10 @@ Index: xen-3.4.1-testing/tools/xenstore/xenstore_client.c for (i = 0; i < xsval_n; i++) { snprintf(buf, MAX_PATH_LEN, "%s/%s", path, xsval[i]); -Index: xen-3.4.1-testing/tools/libxen/src/xen_common.c +Index: xen-4.0.0-testing/tools/libxen/src/xen_common.c =================================================================== ---- xen-3.4.1-testing.orig/tools/libxen/src/xen_common.c -+++ xen-3.4.1-testing/tools/libxen/src/xen_common.c +--- xen-4.0.0-testing.orig/tools/libxen/src/xen_common.c ++++ xen-4.0.0-testing/tools/libxen/src/xen_common.c @@ -1057,6 +1057,8 @@ static size_t size_of_member(const abstr default: assert(false); @@ -161,17 +161,29 @@ Index: xen-3.4.1-testing/tools/libxen/src/xen_common.c } -Index: xen-3.4.1-testing/tools/libxc/xc_core.c +Index: xen-4.0.0-testing/tools/blktap2/drivers/block-remus.c =================================================================== ---- xen-3.4.1-testing.orig/tools/libxc/xc_core.c -+++ xen-3.4.1-testing/tools/libxc/xc_core.c -@@ -321,7 +321,8 @@ elfnote_dump_none(void *args, dumpcore_r - struct xen_dumpcore_elfnote_none_desc none; +--- xen-4.0.0-testing.orig/tools/blktap2/drivers/block-remus.c ++++ xen-4.0.0-testing/tools/blktap2/drivers/block-remus.c +@@ -1578,7 +1578,7 @@ static int tdremus_open(td_driver_t *dri + td_flag_t flags) + { + struct tdremus_state *s = (struct tdremus_state *)driver->data; +- int rc; ++ int rc = 0; - elfnote_init(&elfnote); -- memset(&none, 0, sizeof(none)); -+ if ( sizeof(none) > 0 ) -+ memset(&none, 0, sizeof(none)); + RPRINTF("opening %s\n", name); - elfnote.descsz = sizeof(none); - elfnote.type = XEN_ELFNOTE_DUMPCORE_NONE; +Index: xen-4.0.0-testing/tools/libxl/Makefile +=================================================================== +--- xen-4.0.0-testing.orig/tools/libxl/Makefile ++++ xen-4.0.0-testing/tools/libxl/Makefile +@@ -49,7 +49,7 @@ xl.o: $(LIBCONFIG_OUTPUT)/libconfig.so x + $(CC) $(CFLAGS) -I$(LIBCONFIG_SOURCE) -c xl.c + + $(CLIENTS): xl.o libxenlight.so $(LIBCONFIG_OUTPUT)/libconfig.so +- $(CC) $(LDFLAGS) -o $@ $< $(LIBS) -L . -lxenlight -L$(LIBCONFIG_OUTPUT) -lconfig ++ $(CC) $(LDFLAGS) -o $@ $< -L . -lxenlight $(LIBS) -L$(LIBCONFIG_OUTPUT) -lconfig + + .PHONY: install + install: all diff --git a/xen-xm-top-needs-root.diff b/xen-xm-top-needs-root.diff index 208f6f4..357e55e 100644 --- a/xen-xm-top-needs-root.diff +++ b/xen-xm-top-needs-root.diff @@ -1,11 +1,11 @@ From: Charles Coffing Upstream: no -Index: xen-3.4.1-testing/tools/python/xen/xm/main.py +Index: xen-4.0.0-testing/tools/python/xen/xm/main.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xm/main.py -+++ xen-3.4.1-testing/tools/python/xen/xm/main.py -@@ -1917,6 +1917,10 @@ def xm_debug_keys(args): +--- xen-4.0.0-testing.orig/tools/python/xen/xm/main.py ++++ xen-4.0.0-testing/tools/python/xen/xm/main.py +@@ -2019,6 +2019,10 @@ def xm_debug_keys(args): def xm_top(args): arg_check(args, "top", 0) diff --git a/xen-xmexample-vti.diff b/xen-xmexample-vti.diff index d1494a3..4d4a1f4 100644 --- a/xen-xmexample-vti.diff +++ b/xen-xmexample-vti.diff @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/examples/Makefile +Index: xen-4.0.0-testing/tools/examples/Makefile =================================================================== ---- xen-3.4.1-testing.orig/tools/examples/Makefile -+++ xen-3.4.1-testing/tools/examples/Makefile -@@ -19,7 +19,6 @@ XEN_CONFIGS += xmexample.hvm +--- xen-4.0.0-testing.orig/tools/examples/Makefile ++++ xen-4.0.0-testing/tools/examples/Makefile +@@ -18,7 +18,6 @@ XEN_CONFIGS += xmexample.hvm XEN_CONFIGS += xmexample.hvm-stubdom XEN_CONFIGS += xmexample.pv-grub XEN_CONFIGS += xmexample.nbd diff --git a/xen-xmexample.diff b/xen-xmexample.diff index da2f289..60e6fcb 100644 --- a/xen-xmexample.diff +++ b/xen-xmexample.diff @@ -1,9 +1,9 @@ Change various example paths in the config files to match SUSE. -Index: xen-3.4.1-testing/tools/examples/xmexample1 +Index: xen-4.0.0-testing/tools/examples/xmexample1 =================================================================== ---- xen-3.4.1-testing.orig/tools/examples/xmexample1 -+++ xen-3.4.1-testing/tools/examples/xmexample1 +--- xen-4.0.0-testing.orig/tools/examples/xmexample1 ++++ xen-4.0.0-testing/tools/examples/xmexample1 @@ -7,11 +7,13 @@ #============================================================================ @@ -43,10 +43,10 @@ Index: xen-3.4.1-testing/tools/examples/xmexample1 #---------------------------------------------------------------------------- # Configure the behaviour when a domain exits. There are three 'reasons' -Index: xen-3.4.1-testing/tools/examples/xmexample2 +Index: xen-4.0.0-testing/tools/examples/xmexample2 =================================================================== ---- xen-3.4.1-testing.orig/tools/examples/xmexample2 -+++ xen-3.4.1-testing/tools/examples/xmexample2 +--- xen-4.0.0-testing.orig/tools/examples/xmexample2 ++++ xen-4.0.0-testing/tools/examples/xmexample2 @@ -35,11 +35,13 @@ xm_vars.var('vmid', xm_vars.check() @@ -86,10 +86,10 @@ Index: xen-3.4.1-testing/tools/examples/xmexample2 #---------------------------------------------------------------------------- # Configure the behaviour when a domain exits. There are three 'reasons' -Index: xen-3.4.1-testing/tools/examples/xmexample3 +Index: xen-4.0.0-testing/tools/examples/xmexample3 =================================================================== ---- xen-3.4.1-testing.orig/tools/examples/xmexample3 -+++ xen-3.4.1-testing/tools/examples/xmexample3 +--- xen-4.0.0-testing.orig/tools/examples/xmexample3 ++++ xen-4.0.0-testing/tools/examples/xmexample3 @@ -35,11 +35,13 @@ xm_vars.var('vmid', xm_vars.check() @@ -109,11 +109,11 @@ Index: xen-3.4.1-testing/tools/examples/xmexample3 # The domain build function. Default is 'linux'. #builder='linux' -Index: xen-3.4.1-testing/tools/examples/xmexample.hvm +Index: xen-4.0.0-testing/tools/examples/xmexample.hvm =================================================================== ---- xen-3.4.1-testing.orig/tools/examples/xmexample.hvm -+++ xen-3.4.1-testing/tools/examples/xmexample.hvm -@@ -81,7 +81,7 @@ vif = [ 'type=ioemu, bridge=xenbr0' ] +--- xen-4.0.0-testing.orig/tools/examples/xmexample.hvm ++++ xen-4.0.0-testing/tools/examples/xmexample.hvm +@@ -78,7 +78,7 @@ vif = [ 'type=ioemu, bridge=xenbr0' ] # and MODE is r for read-only, w for read-write. #disk = [ 'phy:hda1,hda1,r' ] @@ -122,10 +122,10 @@ Index: xen-3.4.1-testing/tools/examples/xmexample.hvm #---------------------------------------------------------------------------- # Configure the behaviour when a domain exits. There are three 'reasons' -Index: xen-3.4.1-testing/docs/man/xmdomain.cfg.pod.5 +Index: xen-4.0.0-testing/docs/man/xmdomain.cfg.pod.5 =================================================================== ---- xen-3.4.1-testing.orig/docs/man/xmdomain.cfg.pod.5 -+++ xen-3.4.1-testing/docs/man/xmdomain.cfg.pod.5 +--- xen-4.0.0-testing.orig/docs/man/xmdomain.cfg.pod.5 ++++ xen-4.0.0-testing/docs/man/xmdomain.cfg.pod.5 @@ -38,13 +38,13 @@ file. The kernel image for the domain. The format of the parameter is the @@ -161,10 +161,10 @@ Index: xen-3.4.1-testing/docs/man/xmdomain.cfg.pod.5 at hda1, which is the root filesystem. =item I -Index: xen-3.4.1-testing/docs/man/xm.pod.1 +Index: xen-4.0.0-testing/docs/man/xm.pod.1 =================================================================== ---- xen-3.4.1-testing.orig/docs/man/xm.pod.1 -+++ xen-3.4.1-testing/docs/man/xm.pod.1 +--- xen-4.0.0-testing.orig/docs/man/xm.pod.1 ++++ xen-4.0.0-testing/docs/man/xm.pod.1 @@ -163,8 +163,8 @@ soon as it is run. =item I diff --git a/xen.changes b/xen.changes index c7a206e..aa2f0dd 100644 --- a/xen.changes +++ b/xen.changes @@ -1,3 +1,119 @@ +------------------------------------------------------------------- +Wed Jan 6 16:50:16 EST 2010 - ksrinivasan@novell.com + +- bnc#564406 - Make the new PV drivers work with older hosts that + do not understand the new PV driver protocol. + +------------------------------------------------------------------- +Fri Dec 11 08:28:16 MST 2009 - carnold@novell.com + +- Upstream Xen version renamed to 4.0.0 in changeset 20624 & 20625. + +------------------------------------------------------------------- +Wed Dec 9 10:37:12 MST 2009 - carnold@novell.com + +- fate#307594: HP-MCBS: XEN: support NR_CPUS=256 + This is a spec file change (xen.spec) + +------------------------------------------------------------------- +Thu Dec 3 06:55:00 MST 2009 - carnold@novell.com + +- bnc#555152 - "NAME" column in xentop (SLES11) output limited to + 10 characters unlike SLES10 + The update to c/s 20572 includes this fix (at c/s 20567). + +------------------------------------------------------------------- +Tue Dec 1 17:46:20 CST 2009 - wkong@novell.com + +- Modify xen-paths.diff + +------------------------------------------------------------------- +Tue Dec 1 16:39:26 CST 2009 - wkong@novell.com + +- Merge xend-tap-fix.patch to xen-domUloader.diff + remove part of it which accepted by upstream + +------------------------------------------------------------------- +Tue Dec 1 11:08:10 MST 2009 - jfehlig@novell.com + +- Load gntdev module in xend init script similar to blkbk, + netbk, etc. + +------------------------------------------------------------------- +Thu Nov 26 11:29:51 CST 2009 - wkong@novell.com + +- Backport dmmd from sles11/xen + block-dmmd + xen-qemu-iscsi-fix.patch + xen.spec + +------------------------------------------------------------------- +Thu Nov 26 10:53:16 CST 2009 - wkong@novell.com + +- Fix regression when create_vbd for tap + xend-tap-fix.patch + +------------------------------------------------------------------- +Tue Nov 24 11:01:22 MST 2009 - carnold@novell.com + +- Temporarily disable libxl because of libconfig dependency. + +------------------------------------------------------------------- +Thu Nov 19 11:32:12 CST 2009 - wkong@novell.com + +- fate#302864 domUloader support lvm in disk + domUloader.py + Note: for test in Beta1, if not good, remove it + +------------------------------------------------------------------- +Thu Nov 19 11:23:22 CST 2009 - wkong@novell.com + +- fate#302864 domUloader support fs on whole disk + domUloader.py + +------------------------------------------------------------------- +Fri Nov 6 16:51:31 CET 2009 - carnold@suse.de + +- Turn KMPs back on now that kernel side fix is checked in. + +------------------------------------------------------------------- +Tue Oct 20 15:09:14 MDT 2009 - jfehlig@novell.com + +- fate#304415 VMM: ability to switch networking mode + Add vif-route-ifup to handle routed configurations using + sysconfig scripts. + vif-route-ifup.patch + +------------------------------------------------------------------- +Mon Oct 19 17:21:25 CST 2009 - jsong@novell.com + +- fate#307540 USB for Xen VMs + usb-add.patch + +------------------------------------------------------------------- +Mon Oct 19 17:21:00 CST 2009 - jsong@novell.com + +- fate#305545 XEN extra descriptive field within xenstore + add_des.patch + +------------------------------------------------------------------- +Mon Oct 12 12:51:50 MDT 2009 - carnold@novell.com + +- Update to Xen version 3.5.0 for the following features. + fate#304226 XEN: FlexMigration feature of VT-x2 support + fate#305004 Add SR-IOV PF and VF drivers to Vt-d enabled Xen + fate#306830 T states in Xen controlling by MSR + fate#306832 Fix for xen panic on new processors + fate#306833 Westmere and Nehalem-EX: Add support for Pause Loop exiting feature for Xen + fate#306835 Xen: server virtual power management enhacement + fate#306837 VT-d2 - PCI SIG ATS support + fate#306872 Xen: Node manager support P/T-states change when Vt-d enable + fate#306873 Xen: SMP guest live migration may fail with hap=1 on NHM + fate#306875 Westmere: LT-SX (Xen) + fate#306891 RAS features for Xen: Add support for Machine Check and CPU/Memory online/offline features + fate#307322 1GB page support in Xen + fate#307324 Xen IOMMU support + ------------------------------------------------------------------- Fri Oct 9 09:24:29 MDT 2009 - carnold@novell.com diff --git a/xen.spec b/xen.spec index 9555b78..fc8764a 100644 --- a/xen.spec +++ b/xen.spec @@ -1,7 +1,7 @@ # -# spec file for package xen (Version 3.4.1_19718_04) +# spec file for package xen (Version 4.0.0_20809_01) # -# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,10 +20,10 @@ Name: xen ExclusiveArch: %ix86 x86_64 -%define xvers 3.4 -%define xvermaj 3 -%define changeset 19718 -%define xen_build_dir xen-3.4.1-testing +%define xvers 4.0 +%define xvermaj 4 +%define changeset 20809 +%define xen_build_dir xen-4.0.0-testing %define with_kmp 1 BuildRequires: LibVNCServer-devel SDL-devel automake bin86 curl-devel dev86 graphviz latex2html libjpeg-devel libxml2-devel ncurses-devel openssl openssl-devel pciutils-devel python-devel texinfo transfig %if %suse_version >= 1030 @@ -37,14 +37,14 @@ BuildRequires: glibc-32bit glibc-devel-32bit %if %{?with_kmp}0 BuildRequires: kernel-source kernel-syms module-init-tools xorg-x11 %endif -Version: 3.4.1_19718_04 +Version: 4.0.0_20809_01 Release: 1 -License: GPL v2 only +License: GPLv2 Group: System/Kernel AutoReqProv: on PreReq: %insserv_prereq %fillup_prereq Summary: Xen Virtualization: Hypervisor (aka VMM aka Microkernel) -Source0: xen-3.4.1-testing-src.tar.bz2 +Source0: xen-4.0.0-testing-src.tar.bz2 Source2: README.SuSE Source3: boot.xen Source4: boot.local.xenU @@ -66,128 +66,108 @@ Source18: init.xen_loop Source19: xen_pvdrivers Source20: kmp_filelist %endif +Source21: block-dmmd # Xen API remote authentication sources Source23: etc_pam.d_xen-api Source24: xenapiusers # sysconfig hook script for Xen Source25: xen-updown.sh # Upstream patches -Patch0: 19614-x86-emul-lldt-ltr.patch -Patch1: 20013-xend-memleak.patch -Patch2: 20031-x86-pmode-load-seg-retry.patch -Patch3: 20035-x86-load-sreg-adjust.patch -Patch4: 20059-vmx-nmi-handling.patch -Patch5: 20077-x86-runstate-cswitch-out.patch -Patch6: 20078-x86_64-branch-emulation.patch -Patch7: 20099-pygrub-security.patch -Patch8: 20101-hvm-no-compat-virt-start.patch -Patch9: 20107-pygrub-security.patch -Patch10: 20112-x86-dom0-boot-run-timers.patch -Patch11: 20125-xc-parse-tuple-fix.patch -Patch12: 20146-pygrub-security.patch -Patch13: 20174-pygrub-security.patch -Patch14: 20201-pygrub-security.patch # Our patches -Patch100: xen-config.diff -Patch101: xend-config.diff -Patch102: xen-destdir.diff -Patch103: xen-rpmoptflags.diff -Patch104: xen-warnings.diff -Patch105: xen-changeset.diff -Patch106: xen-paths.diff -Patch107: xen-xmexample.diff -Patch108: xen-xmexample-vti.diff -Patch109: xen-fixme-doc.diff -Patch110: xen-domUloader.diff -Patch111: xen-no-dummy-nfs-ip.diff -Patch112: serial-split.patch -Patch113: xen-xm-top-needs-root.diff -Patch114: xen-tightvnc-args.diff -Patch115: xen-max-free-mem.diff -Patch116: xen-ioapic-ack-default.diff -Patch120: block-losetup-retry.diff -Patch121: block-flags.diff -Patch122: xen-hvm-default-bridge.diff -Patch123: xen-hvm-default-pae.diff -Patch124: xm-test-cleanup.diff -Patch130: tools-xc_kexec.diff -Patch131: tools-kboot.diff -Patch132: libxen_permissive.patch -Patch133: xenapi-console-protocol.patch -Patch134: xen-disable-qemu-monitor.diff -Patch135: supported_module.diff -Patch136: qemu-security-etch1.diff -Patch140: cdrom-removable.patch -Patch150: bridge-opensuse.patch -Patch151: bridge-vlan.diff -Patch152: bridge-bonding.diff -Patch153: bridge-hostonly.diff -Patch154: bridge-record-creation.patch -Patch155: xend-core-dump-loc.diff -Patch156: blktap.patch -Patch157: xen-qemu-iscsi-fix.patch -Patch158: xen-api-auth.patch -Patch159: tools-gdbserver-build.diff -Patch160: network-route.patch -# Needs to go upstream sometime, when python 2.6 is widespread -Patch161: udev-rules.patch -Patch162: ioemu-vnc-resize.patch +Patch300: xen-config.diff +Patch301: xend-config.diff +Patch302: xen-destdir.diff +Patch303: xen-rpmoptflags.diff +Patch304: xen-warnings.diff +Patch305: xen-changeset.diff +Patch306: xen-paths.diff +Patch307: xen-xmexample.diff +Patch308: xen-xmexample-vti.diff +Patch309: xen-fixme-doc.diff +Patch310: xen-domUloader.diff +Patch311: xen-no-dummy-nfs-ip.diff +Patch312: serial-split.patch +Patch313: xen-xm-top-needs-root.diff +Patch314: xen-max-free-mem.diff +Patch315: xen-disable-libxl.diff +Patch316: xen-disable-xenpaging.diff +Patch320: block-losetup-retry.diff +Patch321: block-flags.diff +Patch322: bridge-opensuse.patch +Patch323: bridge-vlan.diff +Patch324: bridge-bonding.diff +Patch325: bridge-record-creation.patch +Patch326: network-nat.patch +Patch327: udev-rules.patch +Patch328: network-route.patch +Patch329: vif-route-ifup.patch +Patch330: network-nat-open-SuSEfirewall2-FORWARD.patch +Patch340: xen-hvm-default-bridge.diff +Patch341: xen-hvm-default-pae.diff +Patch342: xm-test-cleanup.diff +Patch343: tools-xc_kexec.diff +Patch344: tools-kboot.diff +Patch345: libxen_permissive.patch +Patch346: xenapi-console-protocol.patch +Patch347: xen-disable-qemu-monitor.diff +Patch348: qemu-security-etch1.diff +Patch350: cdrom-removable.patch +Patch351: xend-core-dump-loc.diff +Patch352: blktap.patch +Patch353: xen-qemu-iscsi-fix.patch +Patch354: xen-api-auth.patch +Patch355: tools-gdbserver-build.diff +Patch356: ioemu-vnc-resize.patch +Patch357: ioemu-debuginfo.patch # Needs to go upstream -Patch163: checkpoint-rename.patch -Patch164: network-nat.patch -Patch165: ioemu-debuginfo.patch -Patch166: xm-save-check-file.patch -Patch167: xm-create-xflag.patch -Patch168: mkbuildtree.patch +Patch360: checkpoint-rename.patch +Patch361: xm-save-check-file.patch +Patch362: xm-create-xflag.patch # Patches for snapshot support -Patch200: snapshot-ioemu-save.patch -Patch201: snapshot-ioemu-restore.patch -Patch202: snapshot-ioemu-delete.patch -Patch203: snapshot-xend.patch +Patch400: snapshot-ioemu-save.patch +Patch401: snapshot-ioemu-restore.patch +Patch402: snapshot-ioemu-delete.patch +Patch403: snapshot-xend.patch # ioemu part of blktap patch series -Patch210: ioemu-blktap-fv-init.patch -Patch211: ioemu-blktap-image-format.patch -Patch212: build-tapdisk-ioemu.patch -Patch213: tapdisk-ioemu-logfile.patch -Patch214: ioemu-blktap-zero-size.patch -Patch215: tapdisk-ioemu-shutdown-fix.patch -# More random patches -Patch220: qemu-dm-segfault.patch -Patch221: blktapctrl-default-to-ioemu.patch -Patch222: ioemu-blktap-barriers.patch -Patch223: bdrv_open2_fix_flags.patch -Patch224: bdrv_open2_flags_2.patch +Patch410: ioemu-blktap-fv-init.patch +Patch411: ioemu-blktap-image-format.patch +Patch412: build-tapdisk-ioemu.patch +Patch413: tapdisk-ioemu-logfile.patch +Patch414: ioemu-blktap-zero-size.patch +Patch415: tapdisk-ioemu-shutdown-fix.patch +Patch420: blktapctrl-default-to-ioemu.patch +Patch421: ioemu-blktap-barriers.patch +# Other bug fixes or features +Patch422: bdrv_open2_fix_flags.patch +Patch423: bdrv_open2_flags_2.patch +Patch424: ioemu-7615-qcow2-fix-alloc_cluster_link_l2.patch +Patch425: ioemu-bdrv-open-CACHE_WB.patch +Patch426: xen-ioemu-hvm-pv-support.diff +Patch427: qemu-dm-segfault.patch # Jim's domain lock patch -Patch300: xend-domain-lock.patch -# Patches from Jan -Patch340: x86_64-note-init-p2m.patch -Patch341: x86-cpufreq-report.patch -Patch342: dump-exec-state.patch -Patch343: dom-print.patch -Patch344: pv-driver-build.patch -Patch345: x86-show-page-walk-early.patch -Patch346: x86-extra-trap-info.patch -Patch347: svm-lmsl.patch -Patch348: x86_64-5Tb.patch -# Other patches -Patch400: x86-alloc-cpu-structs.patch -Patch401: 32on64-extra-mem.patch -Patch402: msi-enable.patch -Patch403: xen-ioemu-hvm-pv-support.diff -Patch404: pvdrv_emulation_control.patch -Patch405: blktap-pv-cdrom.patch -Patch406: network-nat-open-SuSEfirewall2-FORWARD.patch -Patch407: ioemu-7615-qcow2-fix-alloc_cluster_link_l2.patch -Patch408: qemu-retry-be-status.patch -Patch409: ioemu-bdrv-open-CACHE_WB.patch -%if %{?with_kmp}0 -Patch450: disable_emulated_device.diff -%endif +Patch450: xend-domain-lock.patch +# Hypervisor and PV driver Patches +Patch500: svm-lmsl.patch +Patch501: 32on64-extra-mem.patch +Patch502: x86-ioapic-ack-default.patch +Patch503: x86-cpufreq-report.patch +Patch504: dump-exec-state.patch +Patch505: dom-print.patch +Patch506: pvdrv-import-shared-info.patch +Patch507: x86-show-page-walk-early.patch +Patch508: x86-extra-trap-info.patch +Patch509: pvdrv_emulation_control.patch +Patch510: blktap-pv-cdrom.patch +Patch511: pv-driver-build.patch +Patch512: supported_module.diff +Patch513: magic_ioport_compat.patch +Patch650: disable_emulated_device.diff # novell_shim patches -Patch500: hv_tools.patch -Patch501: hv_xen_base.patch -Patch502: hv_xen_extension.patch -Patch503: hv_win7_eoi_bug.patch +Patch700: hv_tools.patch +Patch701: hv_xen_base.patch +Patch702: hv_xen_extension.patch +Patch703: hv_win7_eoi_bug.patch +# Build patch Patch999: tmp_build.patch Url: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/ BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -252,7 +232,7 @@ Authors: ... %package libs -License: GPL v2 or later +License: GPLv2+ Summary: Xen Virtualization: Libraries Group: System/Kernel #Requires: xen = %{version} @@ -302,7 +282,7 @@ Authors: Ian Pratt %package tools -License: GPL v2 or later +License: GPLv2+ Summary: Xen Virtualization: Control tools for domain 0 Group: System/Kernel Requires: xen-libs = %{version} @@ -360,7 +340,7 @@ Authors: Ian Pratt %package tools-domU -License: GPL v2 or later +License: GPLv2+ Summary: Xen Virtualization: Control tools for domain U Group: System/Kernel Conflicts: xen-tools @@ -381,7 +361,7 @@ Authors: Ian Pratt %package devel -License: GPL v2 or later +License: GPLv2+ Summary: Xen Virtualization: Headers and libraries for development Group: System/Kernel Requires: xen-libs = %{version} @@ -432,7 +412,7 @@ Authors: %if %{?with_kmp}0 %package KMP -License: GPL v2 or later +License: GPLv2+ Group: System/Kernel Summary: Xen para-virtual device drivers for fully virtualized guests Conflicts: xen @@ -481,7 +461,7 @@ Xen, but is not available for release due to license restrictions. %endif %package doc-html -License: GPL v2 or later +License: GPLv2+ Summary: Xen Virtualization: HTML documentation Group: Documentation/HTML @@ -500,7 +480,7 @@ Authors: Ian Pratt %package doc-pdf -License: GPL v2 or later +License: GPLv2+ Summary: Xen Virtualization: PDF documentation Group: Documentation/Other @@ -521,87 +501,35 @@ Authors: %prep %setup -q -n %xen_build_dir -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 -%patch10 -p1 -%patch11 -p1 -%patch12 -p1 -%patch13 -p1 -%patch14 -p1 -%patch100 -p1 -%patch101 -p1 -%patch102 -p1 -%patch103 -p1 -%patch104 -p1 -%patch105 -p1 -%patch106 -p1 -%patch107 -p1 -%patch108 -p1 -%patch109 -p1 -%patch110 -p1 -%patch111 -p1 -%patch112 -p1 -%patch113 -p1 -#%patch114 -p1 - vnc patch, may no longer be applicable. -%patch115 -p1 -%patch116 -p1 -%patch120 -p1 -%patch121 -p1 -%patch122 -p1 -%patch123 -p1 -%patch124 -p1 -%patch130 -p1 -%patch131 -p1 -%patch132 -p1 -%patch133 -p1 -%patch134 -p1 -%patch135 -p1 -%patch136 -p1 -%patch140 -p1 -%patch150 -p1 -%patch151 -p1 -%patch152 -p1 -#%patch153 -p1 - hostonly -%patch154 -p1 -%patch155 -p1 -%patch156 -p1 -%patch157 -p1 -%patch158 -p1 -%patch159 -p1 -%patch160 -p1 -%patch161 -p1 -%patch162 -p1 -%patch163 -p1 -%patch164 -p1 -%patch165 -p1 -%patch166 -p1 -%patch167 -p1 -%patch168 -p1 -%patch200 -p1 -%patch201 -p1 -%patch202 -p1 -%patch203 -p1 -%patch210 -p1 -%patch211 -p1 -%patch212 -p1 -%patch213 -p1 -%patch214 -p1 -%patch215 -p1 -%patch220 -p1 -%patch221 -p1 -%patch222 -p1 -%patch223 -p1 -%patch224 -p1 %patch300 -p1 -#%patch340 -p1 - Port Later if needed +%patch301 -p1 +%patch302 -p1 +%patch303 -p1 +%patch304 -p1 +%patch305 -p1 +%patch306 -p1 +%patch307 -p1 +%patch308 -p1 +%patch309 -p1 +%patch310 -p1 +%patch311 -p1 +%patch312 -p1 +%patch313 -p1 +%patch314 -p1 +%patch315 -p1 +%patch316 -p1 +#%patch320 -p1 +#%patch321 -p1 +%patch322 -p1 +%patch323 -p1 +%patch324 -p1 +%patch325 -p1 +%patch326 -p1 +%patch327 -p1 +%patch328 -p1 +%patch329 -p1 +%patch330 -p1 +%patch340 -p1 %patch341 -p1 %patch342 -p1 %patch343 -p1 @@ -610,25 +538,55 @@ Authors: %patch346 -p1 %patch347 -p1 %patch348 -p1 -#%patch400 -p1 - Major Port or not needed -%patch401 -p1 -#%patch402 -p1 - Needed? +%patch350 -p1 +%patch351 -p1 +%patch352 -p1 +%patch353 -p1 +%patch354 -p1 +%patch355 -p1 +%patch356 -p1 +%patch357 -p1 +%patch360 -p1 +%patch361 -p1 +%patch362 -p1 +%patch400 -p1 +#%patch401 -p1 +%patch402 -p1 %patch403 -p1 -%patch404 -p1 -%patch405 -p1 -%patch406 -p1 -%patch407 -p1 -%patch408 -p1 -%patch409 -p1 -%if %{?with_kmp}0 +%patch410 -p1 +%patch411 -p1 +%patch412 -p1 +%patch413 -p1 +%patch414 -p1 +%patch415 -p1 +%patch420 -p1 +%patch421 -p1 +%patch422 -p1 +%patch423 -p1 +%patch424 -p1 +%patch425 -p1 +%patch426 -p1 +%patch427 -p1 %patch450 -p1 -%endif -%ifarch x86_64 %patch500 -p1 %patch501 -p1 %patch502 -p1 %patch503 -p1 -%endif +%patch504 -p1 +%patch505 -p1 +%patch506 -p1 +%patch507 -p1 +%patch508 -p1 +%patch509 -p1 +%patch510 -p1 +%patch511 -p1 +%patch512 -p1 +%patch513 -p1 +%patch650 -p1 +%patch700 -p1 +%patch701 -p1 +%patch702 -p1 +%patch703 -p1 %patch999 -p1 %build @@ -692,10 +650,10 @@ make -C xen install pae=y debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT install_xen make -C xen clean %else -make -C xen install max_phys_cpus=255 pae=n debug=y crash_debug=y DESTDIR=$RPM_BUILD_ROOT +make -C xen install max_phys_cpus=256 pae=n debug=y crash_debug=y DESTDIR=$RPM_BUILD_ROOT install_xen dbg make -C xen clean -make -C xen install max_phys_cpus=255 pae=n debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT +make -C xen install max_phys_cpus=256 pae=n debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT install_xen make -C xen clean %endif @@ -711,8 +669,8 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/{qcow-create,img2qcow,qcow2raw} make -C tools/misc/serial-split install \ DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} %ifarch x86_64 -mkdir -p $RPM_BUILD_ROOT/usr/lib/xen/bin/ -ln -s %{_libdir}/xen/bin/qemu-dm $RPM_BUILD_ROOT/usr/lib/xen/bin/qemu-dm +mkdir -p $RPM_BUILD_ROOT/usr/lib64/xen/bin/ +ln -s %{_libdir}/xen/bin/qemu-dm $RPM_BUILD_ROOT/usr/lib64/xen/bin/qemu-dm %endif %if %{?with_kmp}0 # pv driver modules @@ -751,7 +709,7 @@ rm -f $RPM_BUILD_ROOT/etc/xen/examples/*nbd install -m644 %SOURCE9 %SOURCE10 $RPM_BUILD_ROOT/etc/xen/examples/ # scripts rm -f $RPM_BUILD_ROOT/etc/xen/scripts/block-*nbd -install -m755 %SOURCE11 %SOURCE12 %SOURCE13 %SOURCE14 %SOURCE15 %SOURCE16 %SOURCE17 $RPM_BUILD_ROOT/etc/xen/scripts/ +install -m755 %SOURCE11 %SOURCE12 %SOURCE13 %SOURCE14 %SOURCE15 %SOURCE16 %SOURCE17 %SOURCE21 $RPM_BUILD_ROOT/etc/xen/scripts/ ln -s /etc/xen/scripts/vm-monitor $RPM_BUILD_ROOT/etc/xen/scripts/set-lock # Xen API remote authentication files install -d $RPM_BUILD_ROOT/etc/pam.d @@ -798,8 +756,10 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/netfix rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{pyver}/site-packages/*.egg-info rm -rf $RPM_BUILD_ROOT/html rm -rf $RPM_BUILD_ROOT/usr/share/doc/xen/README.* -rm -f $RPM_BUILD_ROOT/usr/share/doc/xen/create.dtd +rm -f $RPM_BUILD_ROOT/usr/share/create.dtd rm -f $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm.debug +# This is necessary because of the build of libconfig for libxl +#rm -rf $RPM_BUILD_ROOT/$RPM_BUILD_ROOT %files %defattr(-,root,root) @@ -823,6 +783,7 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm.debug %{_libdir}/libflask.so.* %{_libdir}/libfsimage.so.* %{_libdir}/libxen*.so.* +%{_libdir}/libvhd.so.* %files tools %defattr(-,root,root) @@ -835,8 +796,11 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm.debug /usr/bin/qemu-nbd-xen /usr/bin/tapdisk-ioemu /usr/bin/gdbserver-xen +/usr/bin/remus /usr/sbin/blktapctrl /usr/sbin/flask-loadpolicy +/usr/sbin/flask-getenforce +/usr/sbin/flask-setenforce /usr/sbin/rcxend /usr/sbin/rcxendomains /usr/sbin/tapdisk @@ -844,6 +808,16 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm.debug /usr/sbin/xm /usr/sbin/xsview /usr/sbin/fs-backend +/usr/sbin/gtracestat +/usr/sbin/gtraceview +/usr/sbin/lock-util +/usr/sbin/tapdisk-client +/usr/sbin/tapdisk-diff +/usr/sbin/tapdisk-stream +/usr/sbin/tapdisk2 +/usr/sbin/td-util +/usr/sbin/vhd-update +/usr/sbin/vhd-util %dir %{_libdir}/xen %dir %{_libdir}/xen/bin %ifarch x86_64 @@ -858,6 +832,7 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm.debug %{_libdir}/xen/bin/xenconsole %{_libdir}/xen/bin/xenctx %{_libdir}/xen/bin/lsevtchn +%{_libdir}/xen/bin/imqebt %{_mandir}/man1/*.1.gz %{_mandir}/man5/*.5.gz %{_mandir}/man8/*.8.gz @@ -880,8 +855,8 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm.debug /etc/xen/auto %config /etc/xen/examples /etc/xen/images -/etc/xen/qemu-ifup /etc/xen/scripts +#/etc/xen/scripts/qemu-ifup /etc/xen/README* %config /etc/xen/vm %config /etc/xen/*.sxp @@ -913,7 +888,7 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm.debug %dir %{_datadir}/xen/man/man1 %dir %{_datadir}/xen/man/man8 %dir %{_datadir}/xen/qemu -%dir %{_datadir}/xen/qemu/keymaps +#%dir %{_datadir}/xen/qemu/keymaps %{_datadir}/xen/qemu/* %{_datadir}/xen/man/man1/* %{_datadir}/xen/man/man8/* @@ -948,6 +923,8 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm.debug %{_libdir}/libfsimage.so %{_libdir}/libxen*.a %{_libdir}/libxen*.so +%{_libdir}/libvhd.a +%{_libdir}/libvhd.so /usr/bin/serial-split /usr/include/blktaplib.h /usr/include/flask.h diff --git a/xenapi-console-protocol.patch b/xenapi-console-protocol.patch index 57204be..64fa2ea 100644 --- a/xenapi-console-protocol.patch +++ b/xenapi-console-protocol.patch @@ -1,8 +1,8 @@ -Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -3571,6 +3571,14 @@ class XendDomainInfo: +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py +@@ -3896,6 +3896,14 @@ class XendDomainInfo: if not config.has_key('backend'): config['backend'] = "00000000-0000-0000-0000-000000000000" diff --git a/xend-config.diff b/xend-config.diff index 5019ae7..9f9a903 100644 --- a/xend-config.diff +++ b/xend-config.diff @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/hotplug/Linux/init.d/sysconfig.xendomains +Index: xen-4.0.0-testing/tools/hotplug/Linux/init.d/sysconfig.xendomains =================================================================== ---- xen-3.4.1-testing.orig/tools/hotplug/Linux/init.d/sysconfig.xendomains -+++ xen-3.4.1-testing/tools/hotplug/Linux/init.d/sysconfig.xendomains +--- xen-4.0.0-testing.orig/tools/hotplug/Linux/init.d/sysconfig.xendomains ++++ xen-4.0.0-testing/tools/hotplug/Linux/init.d/sysconfig.xendomains @@ -1,4 +1,4 @@ -## Path: System/xen +## Path: System/Virtualization @@ -27,10 +27,10 @@ Index: xen-3.4.1-testing/tools/hotplug/Linux/init.d/sysconfig.xendomains ## Type: integer ## Default: 300 -Index: xen-3.4.1-testing/tools/examples/xend-config.sxp +Index: xen-4.0.0-testing/tools/examples/xend-config.sxp =================================================================== ---- xen-3.4.1-testing.orig/tools/examples/xend-config.sxp -+++ xen-3.4.1-testing/tools/examples/xend-config.sxp +--- xen-4.0.0-testing.orig/tools/examples/xend-config.sxp ++++ xen-4.0.0-testing/tools/examples/xend-config.sxp @@ -58,11 +58,12 @@ diff --git a/xend-core-dump-loc.diff b/xend-core-dump-loc.diff index cf03fdf..2addd92 100644 --- a/xend-core-dump-loc.diff +++ b/xend-core-dump-loc.diff @@ -1,13 +1,13 @@ -Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -2118,7 +2118,7 @@ class XendDomainInfo: - - if not corefile: - this_time = time.strftime("%Y-%m%d-%H%M.%S", time.localtime()) -- corefile = "/var/xen/dump/%s-%s.%s.core" % (this_time, -+ corefile = "/var/lib/xen/dump/%s-%s.%s.core" % (this_time, - self.info['name_label'], self.domid) - - if os.path.isdir(corefile): +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py +@@ -2291,7 +2291,7 @@ class XendDomainInfo: + # To prohibit directory traversal + based_name = os.path.basename(self.info['name_label']) + +- coredir = "/var/xen/dump/%s" % (based_name) ++ coredir = "/var/lib/xen/dump/%s" % (based_name) + if not os.path.exists(coredir): + try: + mkdir.parents(coredir, stat.S_IRWXU) diff --git a/xend-domain-lock.patch b/xend-domain-lock.patch index 3e486f8..77c6654 100644 --- a/xend-domain-lock.patch +++ b/xend-domain-lock.patch @@ -1,13 +1,11 @@ -Index: xen-3.4.1-testing/tools/examples/xend-config.sxp +Index: xen-4.0.0-testing/tools/examples/xend-config.sxp =================================================================== ---- xen-3.4.1-testing.orig/tools/examples/xend-config.sxp -+++ xen-3.4.1-testing/tools/examples/xend-config.sxp -@@ -260,4 +260,64 @@ - - # Path where persistent domain configuration is stored. - # Default is /var/lib/xend/domains/ -+# - #(xend-domains-path /var/lib/xend/domains) +--- xen-4.0.0-testing.orig/tools/examples/xend-config.sxp ++++ xen-4.0.0-testing/tools/examples/xend-config.sxp +@@ -304,3 +304,62 @@ + # we have to realize this may incur security issue and we can't make sure the + # device assignment could really work properly even after we do this. + #(pci-passthrough-strict-check yes) + +# Domain Locking +# In a multihost environment, domain locking prevents simultaneously @@ -67,26 +65,25 @@ Index: xen-3.4.1-testing/tools/examples/xend-config.sxp +# before starting vm1 on HostA. +# +#(xend-domain-lock-utility domain-lock) -Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -30,11 +30,13 @@ import threading - import re +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py +@@ -32,11 +32,12 @@ import re import copy import os -+import stat + import stat +import shutil import traceback from types import StringTypes import xen.lowlevel.xc --from xen.util import asserts -+from xen.util import asserts, mkdir +-from xen.util import asserts, auxbin ++from xen.util import asserts, auxbin, mkdir from xen.util.blkif import parse_uname import xen.util.xsm.xsm as security from xen.util import xsconstants -@@ -452,6 +454,7 @@ class XendDomainInfo: +@@ -457,6 +458,7 @@ class XendDomainInfo: if self._stateGet() in (XEN_API_VM_POWER_STATE_HALTED, XEN_API_VM_POWER_STATE_SUSPENDED, XEN_API_VM_POWER_STATE_CRASHED): try: @@ -94,7 +91,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py XendTask.log_progress(0, 30, self._constructDomain) XendTask.log_progress(31, 60, self._initDomain) -@@ -2627,6 +2630,11 @@ class XendDomainInfo: +@@ -2933,6 +2935,11 @@ class XendDomainInfo: self._stateSet(DOM_STATE_HALTED) self.domid = None # Do not push into _stateSet()! @@ -106,7 +103,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py finally: self.refresh_shutdown_lock.release() -@@ -3993,6 +4001,74 @@ class XendDomainInfo: +@@ -4434,6 +4441,74 @@ class XendDomainInfo: def has_device(self, dev_class, dev_uuid): return (dev_uuid in self.info['%s_refs' % dev_class.lower()]) @@ -181,13 +178,13 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py def __str__(self): return '' % \ (str(self.domid), self.info['name_label'], -Index: xen-3.4.1-testing/tools/python/xen/xend/XendOptions.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendOptions.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendOptions.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendOptions.py -@@ -141,6 +141,17 @@ class XendOptions: - """Default rotation count of qemu-dm log file.""" - qemu_dm_logrotate_count = 10 +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendOptions.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendOptions.py +@@ -154,6 +154,17 @@ class XendOptions: + use loose check automatically if necessary.""" + pci_dev_assign_strict_check_default = True + """Default for the flag indicating whether xend should create + a lock file for domains when they are started.""" @@ -197,15 +194,15 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendOptions.py + xend_domain_lock_path_default = '/var/lib/xend/domains' + + """Default script to acquire/release domain lock""" -+ xend_domain_lock_utility = osdep.scripts_dir + "/domain-lock" ++ xend_domain_lock_utility = auxbin.scripts_dir() + "/domain-lock" + + def __init__(self): self.configure() -@@ -368,6 +379,24 @@ class XendOptions: - return self.get_config_int("qemu-dm-logrotate-count", - self.qemu_dm_logrotate_count) +@@ -398,6 +409,24 @@ class XendOptions: + else: + return None + def get_xend_domain_lock(self): + """Get the flag indicating whether xend should create a lock file @@ -221,18 +218,18 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendOptions.py + s = self.get_config_string('xend-domain-lock-utility') + + if s: -+ return os.path.join(osdep.scripts_dir, s) ++ return os.path.join(auxbin.scripts_dir(), s) + else: + return self.xend_domain_lock_utility + - class XendOptionsFile(XendOptions): - -Index: xen-3.4.1-testing/tools/python/xen/xend/XendCheckpoint.py + def get_vnc_tls(self): + return self.get_config_string('vnc-tls', self.xend_vnc_tls) +Index: xen-4.0.0-testing/tools/python/xen/xend/XendCheckpoint.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendCheckpoint.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendCheckpoint.py -@@ -117,6 +117,7 @@ def save(fd, dominfo, network, live, dst +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendCheckpoint.py +@@ -131,6 +131,7 @@ def save(fd, dominfo, network, live, dst dominfo.shutdown('suspend') dominfo.waitForSuspend() if line in ('suspend', 'suspended'): @@ -240,7 +237,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendCheckpoint.py dominfo.migrateDevices(network, dst, DEV_MIGRATE_STEP2, domain_name) log.info("Domain %d suspended.", dominfo.getDomid()) -@@ -401,6 +402,7 @@ def restore(xd, fd, dominfo = None, paus +@@ -408,6 +409,7 @@ def restore(xd, fd, dominfo = None, paus if not paused: dominfo.unpause() @@ -248,11 +245,11 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendCheckpoint.py return dominfo except: dominfo.destroy() -Index: xen-3.4.1-testing/tools/hotplug/Linux/Makefile +Index: xen-4.0.0-testing/tools/hotplug/Linux/Makefile =================================================================== ---- xen-3.4.1-testing.orig/tools/hotplug/Linux/Makefile -+++ xen-3.4.1-testing/tools/hotplug/Linux/Makefile -@@ -21,6 +21,7 @@ XEN_SCRIPTS += vtpm vtpm-delete +--- xen-4.0.0-testing.orig/tools/hotplug/Linux/Makefile ++++ xen-4.0.0-testing/tools/hotplug/Linux/Makefile +@@ -19,6 +19,7 @@ XEN_SCRIPTS += vtpm vtpm-delete XEN_SCRIPTS += xen-hotplug-cleanup XEN_SCRIPTS += external-device-migrate XEN_SCRIPTS += vscsi @@ -260,10 +257,10 @@ Index: xen-3.4.1-testing/tools/hotplug/Linux/Makefile XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh -Index: xen-3.4.1-testing/tools/hotplug/Linux/domain-lock +Index: xen-4.0.0-testing/tools/hotplug/Linux/domain-lock =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/hotplug/Linux/domain-lock ++++ xen-4.0.0-testing/tools/hotplug/Linux/domain-lock @@ -0,0 +1,83 @@ +#!/bin/bash + @@ -348,10 +345,10 @@ Index: xen-3.4.1-testing/tools/hotplug/Linux/domain-lock + get_status $vm_path + ;; +esac -Index: xen-3.4.1-testing/tools/hotplug/Linux/vm-monitor +Index: xen-4.0.0-testing/tools/hotplug/Linux/vm-monitor =================================================================== --- /dev/null -+++ xen-3.4.1-testing/tools/hotplug/Linux/vm-monitor ++++ xen-4.0.0-testing/tools/hotplug/Linux/vm-monitor @@ -0,0 +1,41 @@ +#!/bin/bash + diff --git a/xm-create-xflag.patch b/xm-create-xflag.patch index 51971a7..9eab9f5 100644 --- a/xm-create-xflag.patch +++ b/xm-create-xflag.patch @@ -1,17 +1,17 @@ -Index: xen-3.4.1-testing/tools/python/xen/xm/create.py +Index: xen-4.0.0-testing/tools/python/xen/xm/create.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xm/create.py -+++ xen-3.4.1-testing/tools/python/xen/xm/create.py -@@ -37,7 +37,7 @@ from xen.xend.server.DevConstants import +--- xen-4.0.0-testing.orig/tools/python/xen/xm/create.py ++++ xen-4.0.0-testing/tools/python/xen/xm/create.py +@@ -36,7 +36,7 @@ from xen.xend.server.DevConstants import from xen.util import blkif from xen.util import vscsi_util import xen.util.xsm.xsm as security -from xen.xm.main import serverType, SERVER_XEN_API, get_single_vm +from xen.xm.main import serverType, SERVER_XEN_API, SERVER_LEGACY_XMLRPC, get_single_vm - from xen.util import utils - - from xen.xm.opts import * -@@ -1351,7 +1351,7 @@ def main(argv): + from xen.util import utils, auxbin + from xen.util.pci import dev_dict_to_sxp, \ + parse_pci_name_extended, PciDeviceParseError +@@ -1512,7 +1512,7 @@ def main(argv): except IOError, exn: raise OptionError("Cannot read file %s: %s" % (config, exn[1])) @@ -20,7 +20,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xm/create.py from xen.xm.xenapi_create import sxp2xml sxp2xml_inst = sxp2xml() doc = sxp2xml_inst.convert_sxp_to_xml(config, transient=True) -@@ -1359,7 +1359,7 @@ def main(argv): +@@ -1520,7 +1520,7 @@ def main(argv): if opts.vals.dryrun and not opts.is_xml: SXPPrettyPrint.prettyprint(config) diff --git a/xm-save-check-file.patch b/xm-save-check-file.patch index 3d8fa83..1ea10f6 100644 --- a/xm-save-check-file.patch +++ b/xm-save-check-file.patch @@ -1,9 +1,9 @@ -Index: xen-3.4.1-testing/tools/python/xen/xend/XendAPI.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendAPI.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendAPI.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendAPI.py -@@ -1817,10 +1817,10 @@ class XendAPI(object): - bool(live), port, node, ssl) +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendAPI.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendAPI.py +@@ -1922,10 +1922,10 @@ class XendAPI(object): + bool(live), port, node, ssl, bool(chs)) return xen_api_success_void() - def VM_save(self, _, vm_ref, dest, checkpoint): @@ -15,20 +15,20 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendAPI.py return xen_api_success_void() def VM_restore(self, _, src, paused): -Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomain.py +Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomain.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xend/XendDomain.py -+++ xen-3.4.1-testing/tools/python/xen/xend/XendDomain.py -@@ -1380,7 +1380,7 @@ class XendDomain: - finally: - sock.close() +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomain.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendDomain.py +@@ -1484,7 +1484,7 @@ class XendDomain: + pass + sock.close() - def domain_save(self, domid, dst, checkpoint=False): + def domain_save(self, domid, dst, checkpoint=False, force=False): """Start saving a domain to file. @param domid: Domain ID or Name -@@ -1396,6 +1396,9 @@ class XendDomain: +@@ -1500,6 +1500,9 @@ class XendDomain: if not dominfo: raise XendInvalidDomain(str(domid)) @@ -38,11 +38,11 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomain.py if dominfo.getDomid() == DOM0_ID: raise XendError("Cannot save privileged domain %s" % str(domid)) if dominfo._stateGet() != DOM_STATE_RUNNING: -Index: xen-3.4.1-testing/tools/python/xen/xm/main.py +Index: xen-4.0.0-testing/tools/python/xen/xm/main.py =================================================================== ---- xen-3.4.1-testing.orig/tools/python/xen/xm/main.py -+++ xen-3.4.1-testing/tools/python/xen/xm/main.py -@@ -118,7 +118,7 @@ SUBCOMMAND_HELP = { +--- xen-4.0.0-testing.orig/tools/python/xen/xm/main.py ++++ xen-4.0.0-testing/tools/python/xen/xm/main.py +@@ -120,7 +120,7 @@ SUBCOMMAND_HELP = { 'reset' : ('', 'Reset a domain.'), 'restore' : (' [-p]', 'Restore a domain from a saved state.'), @@ -51,7 +51,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xm/main.py 'Save a domain state to restore later.'), 'shutdown' : (' [-waRH]', 'Shutdown a domain.'), 'top' : ('', 'Monitor a host and the domains in real time.'), -@@ -275,6 +275,7 @@ SUBCOMMAND_OPTIONS = { +@@ -314,6 +314,7 @@ SUBCOMMAND_OPTIONS = { ), 'save': ( ('-c', '--checkpoint', 'Leave domain running after creating snapshot'), @@ -59,7 +59,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xm/main.py ), 'restore': ( ('-p', '--paused', 'Do not unpause domain after restoring it'), -@@ -726,18 +727,21 @@ def xm_event_monitor(args): +@@ -816,18 +817,21 @@ def xm_event_monitor(args): def xm_save(args): @@ -83,7 +83,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xm/main.py if len(params) != 2: err("Wrong number of parameters") -@@ -751,9 +755,9 @@ def xm_save(args): +@@ -841,9 +845,9 @@ def xm_save(args): sys.exit(1) if serverType == SERVER_XEN_API: diff --git a/xm-test-cleanup.diff b/xm-test-cleanup.diff index fae83b0..f6d1edc 100644 --- a/xm-test-cleanup.diff +++ b/xm-test-cleanup.diff @@ -1,7 +1,7 @@ -Index: xen-3.4.1-testing/tools/xm-test/tests/save/01_save_basic_pos.py +Index: xen-4.0.0-testing/tools/xm-test/tests/save/01_save_basic_pos.py =================================================================== ---- xen-3.4.1-testing.orig/tools/xm-test/tests/save/01_save_basic_pos.py -+++ xen-3.4.1-testing/tools/xm-test/tests/save/01_save_basic_pos.py +--- xen-4.0.0-testing.orig/tools/xm-test/tests/save/01_save_basic_pos.py ++++ xen-4.0.0-testing/tools/xm-test/tests/save/01_save_basic_pos.py @@ -35,3 +35,9 @@ if s != 0: # Make sure it's gone if isDomainRunning(domain.getName()):