ia64/xen-unstable

changeset 11228:639c5eff0f5a

[qemu patches] Update patches for changeset 11206:fc3e7e65b953.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author Christian Limpach <Christian.Limpach@xensource.com>
date Sun Aug 20 23:34:17 2006 +0100 (2006-08-20)
parents fc3e7e65b953
children 78673ba510ed
files tools/ioemu/patches/qemu-bootorder tools/ioemu/patches/series
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/ioemu/patches/qemu-bootorder	Sun Aug 20 23:34:17 2006 +0100
     1.3 @@ -0,0 +1,166 @@
     1.4 +Index: ioemu/vl.c
     1.5 +===================================================================
     1.6 +--- ioemu.orig/vl.c	2006-08-20 22:22:36.000000000 +0100
     1.7 ++++ ioemu/vl.c	2006-08-20 23:22:25.000000000 +0100
     1.8 +@@ -124,7 +124,7 @@
     1.9 + int vncunused;
    1.10 + const char* keyboard_layout = NULL;
    1.11 + int64_t ticks_per_sec;
    1.12 +-int boot_device = 'c';
    1.13 ++char *boot_device = NULL;
    1.14 + uint64_t ram_size;
    1.15 + int pit_min_timer_count = 0;
    1.16 + int nb_nics;
    1.17 +@@ -6057,14 +6057,14 @@
    1.18 +                 break;
    1.19 + #endif /* !CONFIG_DM */
    1.20 +             case QEMU_OPTION_boot:
    1.21 +-                boot_device = optarg[0];
    1.22 +-                if (boot_device != 'a' && 
    1.23 ++                boot_device = strdup(optarg);
    1.24 ++                if (strspn(boot_device, "acd"
    1.25 + #ifdef TARGET_SPARC
    1.26 +-		    // Network boot
    1.27 +-		    boot_device != 'n' &&
    1.28 ++                           "n"
    1.29 + #endif
    1.30 +-                    boot_device != 'c' && boot_device != 'd') {
    1.31 +-                    fprintf(stderr, "qemu: invalid boot device '%c'\n", boot_device);
    1.32 ++                        ) != strlen(boot_device)) {
    1.33 ++                    fprintf(stderr, "qemu: invalid boot device in '%s'\n",
    1.34 ++                            boot_device);
    1.35 +                     exit(1);
    1.36 +                 }
    1.37 +                 break;
    1.38 +@@ -6328,6 +6328,7 @@
    1.39 +         fd_filename[0] == '\0')
    1.40 +         help();
    1.41 +     
    1.42 ++#if 0
    1.43 +     /* boot to cd by default if no hard disk */
    1.44 +     if (hd_filename[0] == '\0' && boot_device == 'c') {
    1.45 +         if (fd_filename[0] != '\0')
    1.46 +@@ -6335,6 +6336,7 @@
    1.47 +         else
    1.48 +             boot_device = 'd';
    1.49 +     }
    1.50 ++#endif
    1.51 + #endif /* !CONFIG_DM */
    1.52 + 
    1.53 +     setvbuf(stdout, NULL, _IOLBF, 0);
    1.54 +@@ -6593,6 +6595,7 @@
    1.55 +                   ds, fd_filename, snapshot,
    1.56 +                   kernel_filename, kernel_cmdline, initrd_filename,
    1.57 +                   timeoffset);
    1.58 ++    free(boot_device);
    1.59 + 
    1.60 +     /* init USB devices */
    1.61 +     if (usb_enabled) {
    1.62 +Index: ioemu/vl.h
    1.63 +===================================================================
    1.64 +--- ioemu.orig/vl.h	2006-08-20 22:22:36.000000000 +0100
    1.65 ++++ ioemu/vl.h	2006-08-20 23:22:25.000000000 +0100
    1.66 +@@ -575,7 +575,7 @@
    1.67 + #ifndef QEMU_TOOL
    1.68 + 
    1.69 + typedef void QEMUMachineInitFunc(uint64_t ram_size, int vga_ram_size, 
    1.70 +-                                 int boot_device,
    1.71 ++                                 char *boot_device,
    1.72 +              DisplayState *ds, const char **fd_filename, int snapshot,
    1.73 +              const char *kernel_filename, const char *kernel_cmdline,
    1.74 +              const char *initrd_filename, time_t timeoffset);
    1.75 +@@ -1020,7 +1020,7 @@
    1.76 +                     uint32_t start, uint32_t count);
    1.77 + int PPC_NVRAM_set_params (m48t59_t *nvram, uint16_t NVRAM_size,
    1.78 +                           const unsigned char *arch,
    1.79 +-                          uint32_t RAM_size, int boot_device,
    1.80 ++                          uint32_t RAM_size, char *boot_device,
    1.81 +                           uint32_t kernel_image, uint32_t kernel_size,
    1.82 +                           const char *cmdline,
    1.83 +                           uint32_t initrd_image, uint32_t initrd_size,
    1.84 +Index: ioemu/hw/pc.c
    1.85 +===================================================================
    1.86 +--- ioemu.orig/hw/pc.c	2006-08-20 22:22:36.000000000 +0100
    1.87 ++++ ioemu/hw/pc.c	2006-08-20 23:22:25.000000000 +0100
    1.88 +@@ -158,8 +158,23 @@
    1.89 +     rtc_set_memory(s, info_ofs + 8, sectors);
    1.90 + }
    1.91 + 
    1.92 ++static int get_bios_disk(char *boot_device, int index) {
    1.93 ++
    1.94 ++    if (index < strlen(boot_device)) {
    1.95 ++        switch (boot_device[index]) {
    1.96 ++        case 'a':
    1.97 ++            return 0x01;            /* floppy */
    1.98 ++        case 'c':
    1.99 ++            return 0x02;            /* hard drive */
   1.100 ++        case 'd':
   1.101 ++            return 0x03;            /* cdrom */
   1.102 ++        }
   1.103 ++    }
   1.104 ++    return 0x00;                /* no device */
   1.105 ++}
   1.106 ++
   1.107 + /* hd_table must contain 4 block drivers */
   1.108 +-static void cmos_init(uint64_t ram_size, int boot_device, BlockDriverState **hd_table, time_t timeoffset)
   1.109 ++static void cmos_init(uint64_t ram_size, char *boot_device, BlockDriverState **hd_table, time_t timeoffset)
   1.110 + {
   1.111 +     RTCState *s = rtc_state;
   1.112 +     int val;
   1.113 +@@ -205,21 +220,14 @@
   1.114 +     rtc_set_memory(s, 0x34, val);
   1.115 +     rtc_set_memory(s, 0x35, val >> 8);
   1.116 +     
   1.117 +-    switch(boot_device) {
   1.118 +-    case 'a':
   1.119 +-    case 'b':
   1.120 +-        rtc_set_memory(s, 0x3d, 0x01); /* floppy boot */
   1.121 +-        if (!fd_bootchk)
   1.122 +-            rtc_set_memory(s, 0x38, 0x01); /* disable signature check */
   1.123 +-        break;
   1.124 +-    default:
   1.125 +-    case 'c':
   1.126 +-        rtc_set_memory(s, 0x3d, 0x02); /* hard drive boot */
   1.127 +-        break;
   1.128 +-    case 'd':
   1.129 +-        rtc_set_memory(s, 0x3d, 0x03); /* CD-ROM boot */
   1.130 +-        break;
   1.131 +-    }
   1.132 ++    if (boot_device == NULL) {
   1.133 ++        /* default to hd, then cd, then floppy. */
   1.134 ++        boot_device = "cda";
   1.135 ++    }
   1.136 ++    rtc_set_memory(s, 0x3d, get_bios_disk(boot_device, 0) |
   1.137 ++                   (get_bios_disk(boot_device, 1) << 4));
   1.138 ++    rtc_set_memory(s, 0x38, (get_bios_disk(boot_device, 2) << 4) |
   1.139 ++                   (!fd_bootchk ? 0x00 : 0x01));
   1.140 + 
   1.141 +     /* floppy type */
   1.142 + 
   1.143 +@@ -617,7 +625,7 @@
   1.144 + #define NOBIOS 1
   1.145 + 
   1.146 + /* PC hardware initialisation */
   1.147 +-static void pc_init1(uint64_t ram_size, int vga_ram_size, int boot_device,
   1.148 ++static void pc_init1(uint64_t ram_size, int vga_ram_size, char *boot_device,
   1.149 +                      DisplayState *ds, const char **fd_filename, int snapshot,
   1.150 +                      const char *kernel_filename, const char *kernel_cmdline,
   1.151 +                      const char *initrd_filename, time_t timeoffset,
   1.152 +@@ -919,7 +927,7 @@
   1.153 +     }
   1.154 + }
   1.155 + 
   1.156 +-static void pc_init_pci(uint64_t ram_size, int vga_ram_size, int boot_device,
   1.157 ++static void pc_init_pci(uint64_t ram_size, int vga_ram_size, char *boot_device,
   1.158 +                         DisplayState *ds, const char **fd_filename, 
   1.159 +                         int snapshot, 
   1.160 +                         const char *kernel_filename, 
   1.161 +@@ -933,7 +941,7 @@
   1.162 +              initrd_filename, timeoffset, 1);
   1.163 + }
   1.164 + 
   1.165 +-static void pc_init_isa(uint64_t ram_size, int vga_ram_size, int boot_device,
   1.166 ++static void pc_init_isa(uint64_t ram_size, int vga_ram_size, char *boot_device,
   1.167 +                         DisplayState *ds, const char **fd_filename, 
   1.168 +                         int snapshot, 
   1.169 +                         const char *kernel_filename, 
     2.1 --- a/tools/ioemu/patches/series	Sun Aug 20 23:33:28 2006 +0100
     2.2 +++ b/tools/ioemu/patches/series	Sun Aug 20 23:34:17 2006 +0100
     2.3 @@ -43,3 +43,4 @@ qemu-fix-write-to-disk-synchronous
     2.4  xen-support-buffered-ioreqs
     2.5  qemu-daemonize
     2.6  xen-platform-device
     2.7 +qemu-bootorder