rpms/xen/devel xen-hvm-kernel-boot-nonrelocatable.patch, 1.1, 1.2 xen-hvm-kernel-boot-relocatable.patch, 1.1, 1.2 xen-hvm-kernel-boot-xend.patch, 1.1, 1.2 sources, 1.49, 1.50 xen-initscript.patch, 1.8, 1.9 xen.spec, 1.199, 1.200 pygrub-manykernels.patch, 1.1, NONE xen-3.1.0-no-xenapi-docs.patch, 1.1, NONE xen-blktap-no-aio-epoll.patch, 1.3, NONE xen-block-readonly.patch, 1.1, NONE xen-console-log.patch, 1.2, NONE xen-hvm-save-paths.patch, 1.1, NONE xen-net-bridge.patch, 1.3, NONE xen-pvfb-01-qemu-fv-machine.patch, 1.2, NONE xen-pvfb-02-qemu-pv-machine.patch, 1.3, NONE xen-pvfb-03-xenfb-remove.patch, 1.2, NONE xen-pvfb-04-compat.patch, 1.5, NONE xen-qemu-iohandler-delete.patch, 1.1, NONE xen-qemu-vnc-authentication.patch, 1.4, NONE xen-qemu-vnc-revert-password.patch, 1.2, NONE xen-qemu-vnc-x509-certs.patch, 1.2, NONE xen-xs-transactions.patch, 1.3, NONE

Daniel P. Berrange (berrange) fedora-extras-commits at redhat.com
Thu Jan 10 21:37:49 UTC 2008


Author: berrange

Update of /cvs/pkgs/rpms/xen/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31424

Modified Files:
	sources xen-initscript.patch xen.spec 
Added Files:
	xen-hvm-kernel-boot-nonrelocatable.patch 
	xen-hvm-kernel-boot-relocatable.patch 
	xen-hvm-kernel-boot-xend.patch 
Removed Files:
	pygrub-manykernels.patch xen-3.1.0-no-xenapi-docs.patch 
	xen-blktap-no-aio-epoll.patch xen-block-readonly.patch 
	xen-console-log.patch xen-hvm-save-paths.patch 
	xen-net-bridge.patch xen-pvfb-01-qemu-fv-machine.patch 
	xen-pvfb-02-qemu-pv-machine.patch 
	xen-pvfb-03-xenfb-remove.patch xen-pvfb-04-compat.patch 
	xen-qemu-iohandler-delete.patch 
	xen-qemu-vnc-authentication.patch 
	xen-qemu-vnc-revert-password.patch 
	xen-qemu-vnc-x509-certs.patch xen-xs-transactions.patch 
Log Message:
Update to Xen 3.2 rc5 changeset 16701

xen-hvm-kernel-boot-nonrelocatable.patch:

Index: xen-hvm-kernel-boot-nonrelocatable.patch
===================================================================
RCS file: xen-hvm-kernel-boot-nonrelocatable.patch
diff -N xen-hvm-kernel-boot-nonrelocatable.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ xen-hvm-kernel-boot-nonrelocatable.patch	10 Jan 2008 21:37:26 -0000	1.2
@@ -0,0 +1,111 @@
+--- xen-unstable-16606.orig/tools/ioemu/hw/pc.c	2007-12-18 14:15:17.000000000 -0500
++++ xen-unstable-16606/tools/ioemu/hw/pc.c	2007-12-18 23:53:56.000000000 -0500
+@@ -417,6 +417,90 @@ static void generate_bootsect(uint32_t g
+     bdrv_set_boot_sector(bs_table[0], bootsect, sizeof(bootsect));
+ }
+ 
++/*
++ * Evil helper for non-relocatable kernels
++ *
++ * So it works out like this:
++ *
++ *  0x100000  - Xen HVM firmware lives here. Kernel wants to boot here
++ *
++ * You can't both live there and HVM firmware is needed first, thus
++ * our plan is
++ *
++ *  0x200000              - kernel is loaded here by QEMU
++ *  0x200000+kernel_size  - helper code is put here by QEMU
++ *
++ * code32_switch in kernel header is set to point at out helper
++ * code at 0x200000+kernel_size
++ *
++ * Our helper basically does memmove(0x100000,0x200000,kernel_size)
++ * and then jmps to  0x1000000.
++ *
++ * So we've overwritten the HVM firmware (which was no longer
++ * needed) and the non-relocatable kernel can happily boot
++ * at its usual address.
++ *
++ * Simple, eh ?
++ *
++ * Well the assembler needed to do this is fairly short:
++ *
++ *  # Load segments
++ *    cld                         
++ *    cli                         
++ *    movl $0x18,%eax
++ *    mov %ax,%ds                 
++ *    mov %ax,%es                 
++ *    mov %ax,%fs                 
++ *    mov %ax,%gs                 
++ *    mov %ax,%ss                 
++ *
++ *  # Move the kernel into position
++ *    xor    %edx,%edx            
++ *_doloop:                        
++ *    movzbl 0x600000(%edx),%eax  
++ *    mov    %al,0x100000(%edx)   
++ *    add    $0x1,%edx            
++ *    cmp    $0x500000,%edx       
++ *    jne    _doloop              
++ *
++ *  # start kernel
++ *    xorl %ebx,%ebx              
++ *    mov    $0x100000,%ecx       
++ *    jmp    *%ecx                
++ *
++ */
++static void setup_relocator(target_phys_addr_t addr, target_phys_addr_t src, target_phys_addr_t dst, size_t len)
++{
++  /* Now this assembler corresponds to follow machine code, with our args from QEMU spliced in :-) */
++  unsigned char buf[] = {
++    /* Load segments */
++    0xfc,                         /* cld               */
++    0xfa,                         /* cli               */ 
++    0xb8, 0x18, 0x00, 0x00, 0x00, /* mov    $0x18,%eax */
++    0x8e, 0xd8,                   /* mov    %eax,%ds   */
++    0x8e, 0xc0,                   /* mov    %eax,%es   */
++    0x8e, 0xe0,                   /* mov    %eax,%fs   */
++    0x8e, 0xe8,                   /* mov    %eax,%gs   */
++    0x8e, 0xd0,                   /* mov    %eax,%ss   */
++    0x31, 0xd2,                   /* xor    %edx,%edx  */
++  
++    /* Move the kernel into position */
++    0x0f, 0xb6, 0x82, (src&0xff), ((src>>8)&0xff), ((src>>16)&0xff), ((src>>24)&0xff), /*   movzbl $src(%edx),%eax */
++    0x88, 0x82, (dst&0xff), ((dst>>8)&0xff), ((dst>>16)&0xff), ((dst>>24)&0xff),       /*   mov    %al,$dst(%edx)  */
++    0x83, 0xc2, 0x01,                                                                  /*   add    $0x1,%edx       */
++    0x81, 0xfa, (len&0xff), ((len>>8)&0xff), ((len>>16)&0xff), ((len>>24)&0xff),       /*   cmp    $len,%edx       */
++    0x75, 0xe8,                                                                        /*   jne    13 <_doloop>    */
++
++    /* Start kernel */
++    0x31, 0xdb,                                                                        /*   xor    %ebx,%ebx       */
++    0xb9, (dst&0xff), ((dst>>8)&0xff), ((dst>>16)&0xff), ((dst>>24)&0xff),             /*   mov    $dst,%ecx  */
++    0xff, 0xe1,                                                                        /*   jmp    *%ecx           */
++  };
++  cpu_physical_memory_rw(addr, buf, sizeof(buf), 1);
++  fprintf(stderr, "qemu: helper at 0x%x of size %d bytes, to move kernel of %d bytes from 0x%x to 0x%x\n",
++	  (int)addr, (int)sizeof(buf), (int)len, (int)src, (int)dst);
++}
++
+ 
+ static long get_file_size(FILE *f)
+ {
+@@ -597,8 +681,15 @@ static void load_linux(const char *kerne
+ 	    stl_p(header+0x214, reloc_prot_addr);
+ 	    fprintf(stderr, "qemu: kernel is relocatable\n");
+ 	} else {
+-	    fprintf(stderr, "qemu: unable to load non-relocatable kernel\n");
+-	    exit(1);
++	    /* Setup a helper which moves  kernel back to
++	     * its expected addr after firmware has got out
++	     * of the way. We put a helper at  reloc_prot_addr+kernel_size.
++	     * It moves kernel from reloc_prot_addr to prot_addr and
++	     * then jumps to prot_addr. Yes this is sick.
++	     */
++	    fprintf(stderr, "qemu: kernel is NOT relocatable\n");
++	    stl_p(header+0x214, reloc_prot_addr + kernel_size);
++	    setup_relocator(reloc_prot_addr + kernel_size, reloc_prot_addr, prot_addr, kernel_size);
+ 	}
+     }
+ 

xen-hvm-kernel-boot-relocatable.patch:

Index: xen-hvm-kernel-boot-relocatable.patch
===================================================================
RCS file: xen-hvm-kernel-boot-relocatable.patch
diff -N xen-hvm-kernel-boot-relocatable.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ xen-hvm-kernel-boot-relocatable.patch	10 Jan 2008 21:37:26 -0000	1.2
@@ -0,0 +1,380 @@
+diff -rup xen-unstable-16606.orig/tools/ioemu/hw/pc.c xen-unstable-16606.new/tools/ioemu/hw/pc.c
+--- xen-unstable-16606.orig/tools/ioemu/hw/pc.c	2007-12-17 17:52:29.000000000 -0500
++++ xen-unstable-16606.new/tools/ioemu/hw/pc.c	2007-12-17 17:53:51.000000000 -0500
+@@ -31,10 +31,8 @@
+ #define VGABIOS_CIRRUS_FILENAME "vgabios-cirrus.bin"
+ #define LINUX_BOOT_FILENAME "linux_boot.bin"
+ 
+-#define KERNEL_LOAD_ADDR     0x00100000
+-#define INITRD_LOAD_ADDR     0x00600000
+-#define KERNEL_PARAMS_ADDR   0x00090000
+-#define KERNEL_CMDLINE_ADDR  0x00099000
++/* Leave a chunk of memory at the top of RAM for the BIOS ACPI tables.  */
++#define ACPI_DATA_SIZE        0x10000
+ 
+ static fdctrl_t *floppy_controller;
+ static RTCState *rtc_state;
+@@ -363,36 +361,271 @@ void bochs_bios_init(void)
+     register_ioport_write(0x503, 1, 1, bochs_bios_write, NULL);
+ }
+ 
++/* Generate an initial boot sector which sets state and jump to
++   a specified vector */
++static void generate_bootsect(uint32_t gpr[8], uint16_t segs[6], uint16_t ip)
++{
++    uint8_t bootsect[512], *p;
++    int i;
++
++    if (bs_table[0] == NULL) {
++        fprintf(stderr, "A disk image must be given for 'hda' when booting "
++                "a Linux kernel\n");
++        exit(1);
++    }
++
++    memset(bootsect, 0, sizeof(bootsect));
++
++    /* Copy the MSDOS partition table if possible */
++    bdrv_read(bs_table[0], 0, bootsect, 1);
++
++    /* Make sure we have a partition signature */
++    bootsect[510] = 0x55;
++    bootsect[511] = 0xaa;
++
++    /* Actual code */
++    p = bootsect;
++    *p++ = 0xfa;                /* CLI */
++    *p++ = 0xfc;                /* CLD */
++
++    for (i = 0; i < 6; i++) {
++        if (i == 1)             /* Skip CS */
++            continue;
+ 
+-int load_kernel(const char *filename, uint8_t *addr, 
+-                uint8_t *real_addr)
++        *p++ = 0xb8;            /* MOV AX,imm16 */
++        *p++ = segs[i];
++        *p++ = segs[i] >> 8;
++        *p++ = 0x8e;            /* MOV <seg>,AX */
++        *p++ = 0xc0 + (i << 3);
++    }
++
++    for (i = 0; i < 8; i++) {
++        *p++ = 0x66;            /* 32-bit operand size */
++        *p++ = 0xb8 + i;        /* MOV <reg>,imm32 */
++        *p++ = gpr[i];
++        *p++ = gpr[i] >> 8;
++        *p++ = gpr[i] >> 16;
++        *p++ = gpr[i] >> 24;
++    }
++
++    *p++ = 0xea;                /* JMP FAR */
++    *p++ = ip;                  /* IP */
++    *p++ = ip >> 8;
++    *p++ = segs[1];             /* CS */
++    *p++ = segs[1] >> 8;
++
++    bdrv_set_boot_sector(bs_table[0], bootsect, sizeof(bootsect));
++}
++
++
++static long get_file_size(FILE *f)
+ {
+-    int fd, size;
+-    int setup_sects;
++    long where, size;
++
++    /* XXX: on Unix systems, using fstat() probably makes more sense */
++
++    where = ftell(f);
++    fseek(f, 0, SEEK_END);
++    size = ftell(f);
++    fseek(f, where, SEEK_SET);
+ 
+-    fd = open(filename, O_RDONLY | O_BINARY);
+-    if (fd < 0)
+-        return -1;
+-
+-    /* load 16 bit code */
+-    if (read(fd, real_addr, 512) != 512)
+-        goto fail;
+-    setup_sects = real_addr[0x1F1];
+-    if (!setup_sects)
+-        setup_sects = 4;
+-    if (read(fd, real_addr + 512, setup_sects * 512) != 
+-        setup_sects * 512)
+-        goto fail;
+-    
+-    /* load 32 bit code */
+-    size = read(fd, addr, 16 * 1024 * 1024);
+-    if (size < 0)
+-        goto fail;
+-    close(fd);
+     return size;
+- fail:
+-    close(fd);
+-    return -1;
++}
++
++static int fread2guest(target_phys_addr_t dst_addr, size_t nbytes, FILE *f)
++{
++    size_t offset = 0;
++    while (nbytes) {
++        uint8_t buf[4096];
++	size_t count = nbytes > sizeof(buf) ? sizeof(buf) : nbytes;
++	if (fread(buf, 1, count, f) != count)
++	    return -1;
++
++	cpu_physical_memory_rw(dst_addr+offset, buf, count, 1);
++	offset += count;
++	nbytes -= count;
++    }
++    return 0;
++}
++
++static void load_linux(const char *kernel_filename,
++                       const char *initrd_filename,
++                       const char *kernel_cmdline)
++{
++    uint16_t protocol;
++    uint32_t gpr[8];
++    uint16_t seg[6];
++    uint16_t real_seg;
++    int setup_size, kernel_size, initrd_size, cmdline_size;
++    uint32_t initrd_max;
++    uint8_t header[1024];
++    target_phys_addr_t real_addr, reloc_prot_addr, prot_addr, cmdline_addr, initrd_addr;
++    size_t ncmdline;
++    FILE *f, *fi;
++
++    /* Align to 16 bytes as a paranoia measure */
++    cmdline_size = (strlen(kernel_cmdline)+16) & ~15;
++
++    /* load the kernel header */
++    f = fopen(kernel_filename, "rb");
++    if (!f || !(kernel_size = get_file_size(f)) ||
++        fread(header, 1, 1024, f) != 1024) {
++        fprintf(stderr, "qemu: could not load kernel '%s'\n",
++                kernel_filename);
++        exit(1);
++    }
++
++    /* kernel protocol version */
++    fprintf(stderr, "header magic: %#x\n", ldl_p(header+0x202));
++    if (ldl_p(header+0x202) == 0x53726448)
++        protocol = lduw_p(header+0x206);
++    else
++        protocol = 0;
++    fprintf(stderr, "header protocol: %x\n", protocol);
++    if (protocol < 0x200 || !(header[0x211] & 0x01)) {
++        /* Low kernel */
++        real_addr    = 0x90000;
++        cmdline_addr = 0x9a000 - cmdline_size;
++        prot_addr    = 0x10000;
++	reloc_prot_addr = prot_addr;
++    } else if (protocol < 0x202) {
++        /* High but ancient kernel */
++        real_addr    = 0x90000;
++        cmdline_addr = 0x9a000 - cmdline_size;
++        prot_addr    = 0x100000;
++	reloc_prot_addr = 0x200000;
++    } else {
++        /* High and recent kernel */
++        real_addr    = 0x10000;
++        cmdline_addr = 0x20000;
++        prot_addr    = 0x100000;
++	reloc_prot_addr = 0x200000;
++    }
++
++    fprintf(stderr,
++            "qemu: real_addr     = %#zx\n"
++            "qemu: cmdline_addr  = %#zx\n"
++            "qemu: prot_addr     = %#zx\n",
++            real_addr,
++            cmdline_addr,
++            prot_addr);
++
++    /* highest address for loading the initrd */
++    if (protocol >= 0x203)
++        initrd_max = ldl_p(header+0x22c);
++    else
++        initrd_max = 0x37ffffff;
++
++    if (initrd_max >= ram_size-ACPI_DATA_SIZE)
++        initrd_max = ram_size-ACPI_DATA_SIZE-1;
++
++
++    /* kernel command line */
++    ncmdline = strlen(kernel_cmdline);
++    if (ncmdline > 4095) {
++        ncmdline = 4095;
++	((uint8_t*)kernel_cmdline)[4095] = '\0';
++    }
++    fprintf(stderr, "qemu: kernel_cmdline: %#zx ('%s')\n", ncmdline, kernel_cmdline);
++    cpu_physical_memory_rw(cmdline_addr, (uint8_t*)kernel_cmdline, ncmdline+1, 1);
++
++    if (protocol >= 0x202) {
++        stl_p(header+0x228, cmdline_addr);
++    } else {
++        stw_p(header+0x20, 0xA33F);
++        stw_p(header+0x22, cmdline_addr-real_addr);
++    }
++
++    /* loader type */
++    /* High nybble = B reserved for Qemu; low nybble is revision number.
++       If this code is substantially changed, you may want to consider
++       incrementing the revision. */
++    if (protocol >= 0x200)
++        header[0x210] = 0xB0;
++
++    /* heap */
++    if (protocol >= 0x201) {
++        header[0x211] |= 0x80;  /* CAN_USE_HEAP */
++        stw_p(header+0x224, cmdline_addr-real_addr-0x200);
++    }
++
++    /* load initrd */
++    if (initrd_filename) {
++        if (protocol < 0x200) {
++            fprintf(stderr, "qemu: linux kernel too old to load a ram disk\n");
++            exit(1);
++        }
++
++        fi = fopen(initrd_filename, "rb");
++        if (!fi) {
++            fprintf(stderr, "qemu: could not load initial ram disk '%s'\n",
++                    initrd_filename);
++            exit(1);
++        }
++
++        initrd_size = get_file_size(fi);
++        initrd_addr = ((initrd_max-initrd_size) & ~4095);
++
++        fprintf(stderr, "qemu: loading initrd (%#x bytes) at %#zx\n",
++                initrd_size, initrd_addr);
++
++	if (fread2guest(initrd_addr, initrd_size, fi) < 0) {
++	    fprintf(stderr, "qemu: read error on initial ram disk '%s'\n",
++		    initrd_filename);
++	    exit(1);
++	}
++        fclose(fi);
++
++        stl_p(header+0x218, initrd_addr);
++        stl_p(header+0x21c, initrd_size);
++    }
++
++
++    setup_size = header[0x1f1];
++    if (setup_size == 0)
++        setup_size = 4;
++
++    setup_size = (setup_size+1)*512;
++    kernel_size -= setup_size;  /* Size of protected-mode code */
++
++    /* Urgh, Xen's HVM firmware lives at 0x100000, but that's also the
++     * address Linux wants to start life at prior to relocatable support
++     */
++    if (prot_addr != reloc_prot_addr) {
++        if (protocol >= 0x205 && (header[0x234] & 1)) {
++	    /* Relocatable automatically */
++	    stl_p(header+0x214, reloc_prot_addr);
++	    fprintf(stderr, "qemu: kernel is relocatable\n");
++	} else {
++	    fprintf(stderr, "qemu: unable to load non-relocatable kernel\n");
++	    exit(1);
++	}
++    }
++
++
++    fprintf(stderr, "qemu: loading kernel real mode (%#x bytes) at %#zx\n",
++	    setup_size-1024, real_addr);
++    fprintf(stderr, "qemu: loading kernel protected mode (%#x bytes) at %#zx\n",
++	    kernel_size, reloc_prot_addr);
++
++    /* store the finalized header and load the rest of the kernel */
++    cpu_physical_memory_rw(real_addr, header, 1024, 1);
++    if (fread2guest(real_addr+1024, setup_size-1024, f) < 0 ||
++        fread2guest(reloc_prot_addr, kernel_size, f) < 0) {
++	fprintf(stderr, "qemu: loading kernel protected mode (%#x bytes) at %#zx\n",
++		kernel_size, reloc_prot_addr);
++	exit(1);
++    }
++    fclose(f);
++
++    /* generate bootsector to set up the initial register state */
++    real_seg = (real_addr) >> 4;
++    seg[0] = seg[2] = seg[3] = seg[4] = seg[4] = real_seg;
++    seg[1] = real_seg+0x20;     /* CS */
++    memset(gpr, 0, sizeof gpr);
++    gpr[4] = cmdline_addr-real_addr-16; /* SP (-16 is paranoia) */
++
++    generate_bootsect(gpr, seg, 0);
+ }
+ 
+ static void main_cpu_reset(void *opaque)
+@@ -577,63 +810,8 @@ static void pc_init1(uint64_t ram_size, 
+     
+     bochs_bios_init();
+ 
+-#ifndef CONFIG_DM
+-    if (linux_boot) {
+-        uint8_t bootsect[512];
+-        uint8_t old_bootsect[512];
+-
+-        if (bs_table[0] == NULL) {
+-            fprintf(stderr, "A disk image must be given for 'hda' when booting a Linux kernel\n");
+-            exit(1);
+-        }
+-        snprintf(buf, sizeof(buf), "%s/%s", bios_dir, LINUX_BOOT_FILENAME);
+-        ret = load_image(buf, bootsect);
+-        if (ret != sizeof(bootsect)) {
+-            fprintf(stderr, "qemu: could not load linux boot sector '%s'\n",
+-                    buf);
+-            exit(1);
+-        }
+-
+-        if (bdrv_read(bs_table[0], 0, old_bootsect, 1) >= 0) {
+-            /* copy the MSDOS partition table */
+-            memcpy(bootsect + 0x1be, old_bootsect + 0x1be, 0x40);
+-        }
+-
+-        bdrv_set_boot_sector(bs_table[0], bootsect, sizeof(bootsect));
+-
+-        /* now we can load the kernel */
+-        ret = load_kernel(kernel_filename, 
+-                          phys_ram_base + KERNEL_LOAD_ADDR,
+-                          phys_ram_base + KERNEL_PARAMS_ADDR);
+-        if (ret < 0) {
+-            fprintf(stderr, "qemu: could not load kernel '%s'\n", 
+-                    kernel_filename);
+-            exit(1);
+-        }
+-        
+-        /* load initrd */
+-        initrd_size = 0;
+-        if (initrd_filename) {
+-            initrd_size = load_image(initrd_filename, phys_ram_base + INITRD_LOAD_ADDR);
+-            if (initrd_size < 0) {
+-                fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", 
+-                        initrd_filename);
+-                exit(1);
+-            }
+-        }
+-        if (initrd_size > 0) {
+-            stl_raw(phys_ram_base + KERNEL_PARAMS_ADDR + 0x218, INITRD_LOAD_ADDR);
+-            stl_raw(phys_ram_base + KERNEL_PARAMS_ADDR + 0x21c, initrd_size);
+-        }
+-        pstrcpy(phys_ram_base + KERNEL_CMDLINE_ADDR, 4096,
+-                kernel_cmdline);
+-        stw_raw(phys_ram_base + KERNEL_PARAMS_ADDR + 0x20, 0xA33F);
+-        stw_raw(phys_ram_base + KERNEL_PARAMS_ADDR + 0x22,
+-                KERNEL_CMDLINE_ADDR - KERNEL_PARAMS_ADDR);
+-        /* loader type */
+-        stw_raw(phys_ram_base + KERNEL_PARAMS_ADDR + 0x210, 0x01);
+-    }
+-#endif /* !CONFIG_DM */
++    if (linux_boot)
++        load_linux(kernel_filename, initrd_filename, kernel_cmdline);
+ 
+     if (pci_enabled) {
+         pci_bus = i440fx_init(&i440fx_state);

xen-hvm-kernel-boot-xend.patch:

Index: xen-hvm-kernel-boot-xend.patch
===================================================================
RCS file: xen-hvm-kernel-boot-xend.patch
diff -N xen-hvm-kernel-boot-xend.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ xen-hvm-kernel-boot-xend.patch	10 Jan 2008 21:37:26 -0000	1.2
@@ -0,0 +1,122 @@
+diff -rup xen-unstable-16606.orig/tools/python/xen/xend/image.py xen-unstable-16606.new/tools/python/xen/xend/image.py
+--- xen-unstable-16606.orig/tools/python/xen/xend/image.py	2007-12-17 17:52:29.000000000 -0500
++++ xen-unstable-16606.new/tools/python/xen/xend/image.py	2007-12-17 18:17:31.000000000 -0500
+@@ -127,7 +127,7 @@ class ImageHandler:
+         """
+         # Set params and call buildDomain().
+ 
+-        if not os.path.isfile(self.kernel):
++        if self.kernel and not os.path.isfile(self.kernel):
+             raise VmError('Kernel image does not exist: %s' % self.kernel)
+         if self.ramdisk and not os.path.isfile(self.ramdisk):
+             raise VmError('Kernel ramdisk does not exist: %s' % self.ramdisk)
+@@ -187,6 +187,10 @@ class ImageHandler:
+     def parseDeviceModelArgs(self, vmConfig):
+         ret = ["-domain-name", str(self.vm.info['name_label'])]
+ 
++        # Tell QEMU how large the guest's memory allocation is
++        # to help it when loading the initrd (if neccessary)
++        ret += ["-m", str(self.getRequiredInitialReservation() / 1024)]
++
+         # Find RFB console device, and if it exists, make QEMU enable
+         # the VNC console.
+         if int(vmConfig['platform'].get('nographic', 0)) != 0:
+@@ -410,8 +414,7 @@ class HVMImageHandler(ImageHandler):
+     def configure(self, vmConfig):
+         ImageHandler.configure(self, vmConfig)
+ 
+-        if not self.kernel:
+-            self.kernel = '/usr/lib/xen/boot/hvmloader'
++        self.loader = vmConfig['platform'].get('loader')
+ 
+         info = xc.xeninfo()
+         if 'hvm' not in info['xen_caps']:
+@@ -434,6 +437,17 @@ class HVMImageHandler(ImageHandler):
+         ret = ImageHandler.parseDeviceModelArgs(self, vmConfig)
+         ret = ret + ['-vcpus', str(self.vm.getVCpuCount())]
+ 
++        if self.kernel and self.kernel != "/usr/lib/xen/boot/hvmloader":
++            log.debug("kernel         = %s", self.kernel)
++            ret = ret + ['-kernel', self.kernel]
++        if self.ramdisk:
++            log.debug("ramdisk        = %s", self.ramdisk)
++            ret = ret + ['-initrd', self.ramdisk]
++        if self.cmdline:
++            log.debug("cmdline        = %s", self.cmdline)
++            ret = ret + ['-append', self.cmdline]
++
++
+         dmargs = [ 'boot', 'fda', 'fdb', 'soundhw',
+                    'localtime', 'serial', 'stdvga', 'isa',
+                    'acpi', 'usb', 'usbdevice', 'pci' ]
+@@ -509,7 +523,7 @@ class HVMImageHandler(ImageHandler):
+         mem_mb = self.getRequiredInitialReservation() / 1024
+ 
+         log.debug("domid          = %d", self.vm.getDomid())
+-        log.debug("image          = %s", self.kernel)
++        log.debug("image          = %s", self.loader)
+         log.debug("store_evtchn   = %d", store_evtchn)
+         log.debug("memsize        = %d", mem_mb)
+         log.debug("vcpus          = %d", self.vm.getVCpuCount())
+@@ -517,7 +531,7 @@ class HVMImageHandler(ImageHandler):
+         log.debug("apic           = %d", self.apic)
+ 
+         rc = xc.hvm_build(domid          = self.vm.getDomid(),
+-                          image          = self.kernel,
++                          image          = self.loader,
+                           memsize        = mem_mb,
+                           vcpus          = self.vm.getVCpuCount(),
+                           acpi           = self.acpi,
+diff -rup xen-unstable-16606.orig/tools/python/xen/xend/XendConfig.py xen-unstable-16606.new/tools/python/xen/xend/XendConfig.py
+--- xen-unstable-16606.orig/tools/python/xen/xend/XendConfig.py	2007-12-17 17:52:29.000000000 -0500
++++ xen-unstable-16606.new/tools/python/xen/xend/XendConfig.py	2007-12-17 18:26:30.000000000 -0500
+@@ -124,7 +124,7 @@ XENAPI_CFG_TO_LEGACY_CFG = {
+ LEGACY_CFG_TO_XENAPI_CFG = reverse_dict(XENAPI_CFG_TO_LEGACY_CFG)
+ 
+ # Platform configuration keys.
+-XENAPI_PLATFORM_CFG = [ 'acpi', 'apic', 'boot', 'device_model', 'display', 
++XENAPI_PLATFORM_CFG = [ 'acpi', 'apic', 'boot', 'device_model', 'loader', 'display', 
+                         'fda', 'fdb', 'keymap', 'isa', 'localtime', 'monitor', 
+                         'nographic', 'pae', 'rtc_timeoffset', 'serial', 'sdl',
+                         'soundhw','stdvga', 'usb', 'usbdevice', 'vnc',
+@@ -402,6 +402,17 @@ class XendConfig(dict):
+                 self['platform']['device_model'] = xen.util.auxbin.pathTo("qemu-dm")
+ 
+         if self.is_hvm():
++            if 'loader' not in self['platform']:
++                log.debug("No loader present")
++                # Old configs may have hvmloder set as PV_kernel param,
++                # so lets migrate them....
++                if self['PV_kernel'] == "/usr/lib/xen/boot/hvmloader":
++                    self['platform']['loader'] = self['PV_kernel']
++                    log.debug("Loader copied from kernel %s" % str(self['platform']['loader']))
++                else:
++                    self['platform']['loader'] = "/usr/lib/xen/boot/hvmloader"
++                    log.debug("Loader %s" % str(self['platform']['loader']))
++
+             # Compatibility hack, can go away soon.
+             if 'soundhw' not in self['platform'] and \
+                self['platform'].get('enable_audio'):
+diff -rup xen-unstable-16606.orig/tools/python/xen/xm/create.py xen-unstable-16606.new/tools/python/xen/xm/create.py
+--- xen-unstable-16606.orig/tools/python/xen/xm/create.py	2007-12-17 17:52:29.000000000 -0500
++++ xen-unstable-16606.new/tools/python/xen/xm/create.py	2007-12-17 18:28:06.000000000 -0500
+@@ -158,6 +158,10 @@ gopts.var('ramdisk', val='FILE',
+           fn=set_value, default='',
+           use="Path to ramdisk.")
+ 
++gopts.var('loader', val='FILE',
++          fn=set_value, default='',
++          use="Path to HVM firmware.")
++
+ gopts.var('features', val='FEATURES',
+           fn=set_value, default='',
+           use="Features to enable in guest kernel")
+@@ -552,6 +556,8 @@ def configure_image(vals):
+         config_image.append([ 'kernel', os.path.abspath(vals.kernel) ])
+     if vals.ramdisk:
+         config_image.append([ 'ramdisk', os.path.abspath(vals.ramdisk) ])
++    if vals.loader:
++        config_image.append([ 'loader', os.path.abspath(vals.loader) ])
+     if vals.cmdline_ip:
+         cmdline_ip = strip('ip=', vals.cmdline_ip)
+         config_image.append(['ip', cmdline_ip])


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/xen/devel/sources,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- sources	1 Dec 2007 22:07:49 -0000	1.49
+++ sources	10 Jan 2008 21:37:26 -0000	1.50
@@ -1 +1 @@
-14a7d4220ec5f4fc4fcecb7feb548f76  xen-3.1.2-src.tgz
+352aa610761be3cae89f9e7caa4f0feb  xen-unstable-16701.tgz

xen-initscript.patch:

Index: xen-initscript.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xen/devel/xen-initscript.patch,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- xen-initscript.patch	12 Jun 2007 13:50:13 -0000	1.8
+++ xen-initscript.patch	10 Jan 2008 21:37:26 -0000	1.9
@@ -1,6 +1,6 @@
-diff -rup xen-3.1.0-src/tools/examples/init.d/xend xen-3.1.0-src.new/tools/examples/init.d/xend
---- xen-3.1.0-src/tools/examples/init.d/xend	2007-05-31 12:14:19.000000000 -0400
-+++ xen-3.1.0-src.new/tools/examples/init.d/xend	2007-05-31 17:53:29.000000000 -0400
+diff -rup xen-unstable-16606.orig/tools/examples/init.d/xend xen-unstable-16606.new/tools/examples/init.d/xend
+--- xen-unstable-16606.orig/tools/examples/init.d/xend	2007-12-13 04:31:03.000000000 -0500
++++ xen-unstable-16606.new/tools/examples/init.d/xend	2007-12-14 12:22:16.000000000 -0500
 @@ -19,48 +19,161 @@
  # Description:       Starts and stops the Xen control daemon.
  ### END INIT INFO
@@ -186,10 +186,10 @@
 -exit $?
 +exit $RETVAL
  
-diff -rup xen-3.1.0-src/tools/misc/xend xen-3.1.0-src.new/tools/misc/xend
---- xen-3.1.0-src/tools/misc/xend	2007-05-31 13:10:49.000000000 -0400
-+++ xen-3.1.0-src.new/tools/misc/xend	2007-05-31 13:44:14.000000000 -0400
-@@ -8,123 +8,16 @@
+diff -rup xen-unstable-16606.orig/tools/misc/xend xen-unstable-16606.new/tools/misc/xend
+--- xen-unstable-16606.orig/tools/misc/xend	2007-12-13 04:31:03.000000000 -0500
++++ xen-unstable-16606.new/tools/misc/xend	2007-12-14 12:24:23.000000000 -0500
+@@ -8,142 +8,15 @@
  """Xen management daemon.
     Provides console server and HTTP management api.
  
@@ -208,6 +208,8 @@
 -   On Solaris, the daemons are SMF managed, and you should not attempt
 -   to start xend by hand.
  """
+-import fcntl
+-import glob
 -import os
 -import os.path
  import sys
@@ -216,14 +218,14 @@
 -import time
 -import commands
 -
--result = commands.getstatusoutput(os.path.join(os.path.dirname(sys.argv[0]),
--                                               'xen-python-path'))
--if result[0] != 0:
--    print >>sys.stderr, result[1]
--    sys.exit(1)
+-xpp = os.path.join(os.path.dirname(sys.argv[0]), 'xen-python-path')
+-if os.path.exists(xpp):
+-    result = commands.getstatusoutput(xpp)
+-    if result[0] != 0:
+-        print >>sys.stderr, result[1]
+-        sys.exit(1)
+-    sys.path.append(result[1])
 -
--sys.path.append(result[1])
- 
  from xen.xend.server import SrvDaemon
  
 -class CheckError(ValueError):
@@ -261,6 +263,23 @@
 -        raise CheckError("invalid user")
 -
 -def start_xenstored():
+-    pidfname = "/var/run/xenstore.pid"
+-    try:
+-        f = open(pidfname, "a")
+-        try:
+-            fcntl.lockf(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
+-            rootdir = os.getenv("XENSTORED_ROOTDIR") or "/var/lib/xenstored"
+-            for i in glob.glob(rootdir + "/tdb*"):
+-                try:
+-                    os.unlink(i)
+-                except:
+-                    pass
+-            os.unlink(pidfname)
+-        except:
+-            pass
+-        f.close()
+-    except:
+-        pass
 -    XENSTORED_TRACE = os.getenv("XENSTORED_TRACE")
 -    cmd = "xenstored --pid-file /var/run/xenstore.pid"
 -    if XENSTORED_TRACE:
@@ -314,21 +333,21 @@
  
  if __name__ == '__main__':
      sys.exit(main())
-diff -rup xen-3.1.0-src/tools/python/xen/xend/osdep.py xen-3.1.0-src.new/tools/python/xen/xend/osdep.py
---- xen-3.1.0-src/tools/python/xen/xend/osdep.py	2007-05-18 10:45:21.000000000 -0400
-+++ xen-3.1.0-src.new/tools/python/xen/xend/osdep.py	2007-05-31 13:13:07.000000000 -0400
-@@ -25,7 +25,7 @@ _scripts_dir = {
- }
+diff -rup xen-unstable-16606.orig/tools/python/xen/xend/osdep.py xen-unstable-16606.new/tools/python/xen/xend/osdep.py
+--- xen-unstable-16606.orig/tools/python/xen/xend/osdep.py	2007-12-13 04:31:03.000000000 -0500
++++ xen-unstable-16606.new/tools/python/xen/xend/osdep.py	2007-12-14 12:25:03.000000000 -0500
+@@ -26,7 +26,7 @@ _scripts_dir = {
  
  _xend_autorestart = {
+     "NetBSD": True,
 -    "Linux": True,
 +    "Linux": False,
      "SunOS": False,
  }
  
-diff -rup xen-3.1.0-src/tools/python/xen/xend/server/SrvDaemon.py xen-3.1.0-src.new/tools/python/xen/xend/server/SrvDaemon.py
---- xen-3.1.0-src/tools/python/xen/xend/server/SrvDaemon.py	2007-05-18 10:45:21.000000000 -0400
-+++ xen-3.1.0-src.new/tools/python/xen/xend/server/SrvDaemon.py	2007-05-31 14:36:23.000000000 -0400
+diff -rup xen-unstable-16606.orig/tools/python/xen/xend/server/SrvDaemon.py xen-unstable-16606.new/tools/python/xen/xend/server/SrvDaemon.py
+--- xen-unstable-16606.orig/tools/python/xen/xend/server/SrvDaemon.py	2007-12-13 04:31:03.000000000 -0500
++++ xen-unstable-16606.new/tools/python/xen/xend/server/SrvDaemon.py	2007-12-14 12:22:16.000000000 -0500
 @@ -109,7 +109,14 @@ class Daemon:
          # Fork, this allows the group leader to exit,
          # which means the child can never again regain control of the


Index: xen.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xen/devel/xen.spec,v
retrieving revision 1.199
retrieving revision 1.200
diff -u -r1.199 -r1.200
--- xen.spec	13 Dec 2007 21:43:13 -0000	1.199
+++ xen.spec	10 Jan 2008 21:37:26 -0000	1.200
@@ -1,29 +1,31 @@
 %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
 
-# For official stable release, use these two tags
-%define base_version 3.1.2
-%define base_release 3
-%define base_hv_abi  3.1
+# Always set these 3 tags
+%define base_version 3.2.0
+%define base_release 1
+
+# Hypervisor ABI
+%define hv_abi  3.2
+# Whether to build -hypervisor pacakges
+%define hv_build 1
 
 # For testing upstream dev trees run either
 #    hg archive -t tgz ../xen-unstable-[changeset].tgz
 # Or
 #    hg archive -t tgz ../xen-3.1-testing-[changeset].tgz
 #
-# And then set....
+# And set 'base_version' the release number that the current
+# dev tree is targetted to become,
 
-# The version that the dev tree will become when released
-#define base_version 3.2.0
-
-# The changeset synced to
-#define changeset 16606
+# For dev trees, also set the changeset synced to
+%define changeset 16701
 
 # Name of the tree (ie the arg to hg archive, without .tgz suffix)
-#define tree unstable
+%define tree unstable
 #define tree 3.1-testing
 
 # If upstream tree is also in release candidate stage, add this tag
-#define relcandidate 1
+%define relcandidate 5
 
 
 
@@ -40,9 +42,7 @@
 
 
 %define release_prefix %{?changeset:0}%{!?changeset:%{base_release}}
-%define release_postfix %{?changeset:%{?relcandidate:.rc%{relcandidate}}.dev%{changeset}}
-%define hv_build %{?changeset:1}%{!?changeset:0}
-%define hv_abi %{?changeset:%{base_version}-%{changeset}}%{!?changeset:%{base_hv_abi}}
+%define release_postfix %{?changeset:%{?relcandidate:.rc%{relcandidate}}.dev%{changeset}.%{base_release}}
 %define version_tag %{base_version}
 %define release_tag %{release_prefix}%{?dist}%{release_postfix}
 %define directory_tag xen-%{?changeset:%{tree}-%{changeset}}%{!?tree:%{base_version}-src}
@@ -62,15 +62,11 @@
 Source4: %{name}.logrotate
 Patch1: xen-initscript.patch
 Patch3: xen-compile-fixes.patch
-Patch6: xen-net-bridge.patch
+Patch5: xen-hvm-kernel-boot-xend.patch
+Patch6: xen-hvm-kernel-boot-relocatable.patch
+Patch7: xen-hvm-kernel-boot-nonrelocatable.patch
 Patch13: xen-dumpdir.patch
-Patch18: xen-block-readonly.patch
-
-Patch20: xen-blktap-no-aio-epoll.patch
-Patch26: xen-hvm-save-paths.patch
-Patch27: xen-console-log.patch
 
-Patch34: xen-3.1.0-no-xenapi-docs.patch
 Patch36: xen-qemu-bootmenu.patch
 
 # Patches to modify the default config of xend
@@ -78,22 +74,6 @@
 Patch102: xen-3.0.2-config-allow-unix-server.patch
 Patch103: xen-3.0.2-config-disable-reloc.patch
 
-Patch160: xen-pvfb-01-qemu-fv-machine.patch
-Patch161: xen-pvfb-02-qemu-pv-machine.patch
-Patch162: xen-pvfb-03-xenfb-remove.patch
-Patch163: xen-pvfb-04-compat.patch
-
-Patch164: xen-qemu-vnc-revert-password.patch
-
-Patch165: xen-qemu-iohandler-delete.patch
-Patch166: xen-qemu-vnc-authentication.patch
-Patch167: xen-qemu-vnc-x509-certs.patch
-
-Patch251: pygrub-manykernels.patch
-
-# Performance fix for listing domains
-Patch280: xen-xs-transactions.patch
-
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 BuildRequires: transfig libidn-devel zlib-devel texi2html SDL-devel curl-devel
 BuildRequires: libX11-devel python-devel ghostscript tetex-latex 
@@ -168,15 +148,11 @@
 %setup -q -n %{directory_tag}
 %patch1 -p1 -b .init
 %patch3 -p1 -b .compile
+%patch5 -p1
 %patch6 -p1
+%patch7 -p1
 %patch13 -p1
-%patch18 -p1
-
-%patch20 -p1
-%patch26 -p1
-%patch27 -p1
 
-%patch34 -p1
 %patch36 -p1
 
 # config patches
@@ -184,26 +160,6 @@
 %patch102 -p1
 %patch103 -p1
 
-# Switch to QEMU for paravirt VNC server
-%patch160 -p1
-%patch161 -p1
-%patch162 -p1
-%patch163 -p1
-
-# Remove old VNC password code
-%patch164 -p1
-
-# Add new TLS code
-%patch165 -p1
-%patch166 -p1
-%patch167 -p1
-
-# upstream patches
-%patch251 -p1
-
-# performance patch
-%patch280 -p1
-
 %build
 %if %{hv_build}
 CFLAGS="$RPM_OPT_FLAGS" %{__make} XENFB_TOOLS=y XEN_PYTHON_NATIVE_INSTALL=1 DESTDIR=%{buildroot} tools docs xen
@@ -233,8 +189,8 @@
 %if %{hv_build}
 # install the hypervisor
 install -d 755 %{buildroot}/boot/
-install -m 644 xen/xen.gz %{buildroot}/boot/xen-%{version}-%{release}.gz
-install -m 644 xen/xen-syms %{buildroot}/boot/xen-syms-%{version}-%{release}
+install -m 644 xen/xen.gz %{buildroot}/boot/xen-%{hv_abi}.gz
+install -m 644 xen/xen-syms %{buildroot}/boot/xen-syms-%{hv_abi}
 %endif
 
 ### fixing start-script dir
@@ -345,6 +301,9 @@
 %{_libdir}/*.a
 
 %changelog
+* Thu Jan 10 2008 Daniel P. Berrange <berrange at redhat.com> - 3.2.0-0.fc9.rc5.dev16701.1
+- Rebase to Xen 3.2 rc5 changeset 16701
+
 * Thu Dec 13 2007 Daniel P. Berrange <berrange at redhat.com> - 3.1.2-3.fc9
 - Re-factor to make it easier to test dev trees in RPMs
 - Include hypervisor build if doing a dev RPM


--- pygrub-manykernels.patch DELETED ---


--- xen-3.1.0-no-xenapi-docs.patch DELETED ---


--- xen-blktap-no-aio-epoll.patch DELETED ---


--- xen-block-readonly.patch DELETED ---


--- xen-console-log.patch DELETED ---


--- xen-hvm-save-paths.patch DELETED ---


--- xen-net-bridge.patch DELETED ---


--- xen-pvfb-01-qemu-fv-machine.patch DELETED ---


--- xen-pvfb-02-qemu-pv-machine.patch DELETED ---


--- xen-pvfb-03-xenfb-remove.patch DELETED ---


--- xen-pvfb-04-compat.patch DELETED ---


--- xen-qemu-iohandler-delete.patch DELETED ---


--- xen-qemu-vnc-authentication.patch DELETED ---


--- xen-qemu-vnc-revert-password.patch DELETED ---


--- xen-qemu-vnc-x509-certs.patch DELETED ---


--- xen-xs-transactions.patch DELETED ---




More information about the fedora-extras-commits mailing list