1 | Index: ioemu/vl.c |
---|
2 | =================================================================== |
---|
3 | --- ioemu.orig/vl.c 2007-05-03 15:20:45.000000000 +0100 |
---|
4 | +++ ioemu/vl.c 2007-05-03 15:20:45.000000000 +0100 |
---|
5 | @@ -116,7 +116,7 @@ |
---|
6 | void *ioport_opaque[MAX_IOPORTS]; |
---|
7 | IOPortReadFunc *ioport_read_table[3][MAX_IOPORTS]; |
---|
8 | IOPortWriteFunc *ioport_write_table[3][MAX_IOPORTS]; |
---|
9 | -BlockDriverState *bs_table[MAX_DISKS], *fd_table[MAX_FD]; |
---|
10 | +BlockDriverState *bs_table[MAX_DISKS + MAX_SCSI_DISKS], *fd_table[MAX_FD]; |
---|
11 | int vga_ram_size; |
---|
12 | int bios_size; |
---|
13 | static DisplayState display_state; |
---|
14 | @@ -1396,7 +1396,7 @@ |
---|
15 | case 's': |
---|
16 | { |
---|
17 | int i; |
---|
18 | - for (i = 0; i < MAX_DISKS; i++) { |
---|
19 | + for (i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) { |
---|
20 | if (bs_table[i]) |
---|
21 | bdrv_commit(bs_table[i]); |
---|
22 | } |
---|
23 | @@ -6057,7 +6057,7 @@ |
---|
24 | int snapshot, linux_boot; |
---|
25 | const char *initrd_filename; |
---|
26 | #ifndef CONFIG_DM |
---|
27 | - const char *hd_filename[MAX_DISKS]; |
---|
28 | + const char *hd_filename[MAX_DISKS + MAX_SCSI_DISKS]; |
---|
29 | #endif /* !CONFIG_DM */ |
---|
30 | const char *fd_filename[MAX_FD]; |
---|
31 | const char *kernel_filename, *kernel_cmdline; |
---|
32 | @@ -6126,7 +6126,7 @@ |
---|
33 | for(i = 0; i < MAX_FD; i++) |
---|
34 | fd_filename[i] = NULL; |
---|
35 | #ifndef CONFIG_DM |
---|
36 | - for(i = 0; i < MAX_DISKS; i++) |
---|
37 | + for(i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) |
---|
38 | hd_filename[i] = NULL; |
---|
39 | #endif /* !CONFIG_DM */ |
---|
40 | ram_size = DEFAULT_RAM_SIZE * 1024 * 1024; |
---|
41 | @@ -6724,7 +6724,7 @@ |
---|
42 | } |
---|
43 | |
---|
44 | /* open the virtual block devices */ |
---|
45 | - for(i = 0; i < MAX_DISKS; i++) { |
---|
46 | + for(i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) { |
---|
47 | if (hd_filename[i]) { |
---|
48 | if (!bs_table[i]) { |
---|
49 | char buf[64]; |
---|
50 | Index: ioemu/vl.h |
---|
51 | =================================================================== |
---|
52 | --- ioemu.orig/vl.h 2007-05-03 15:20:45.000000000 +0100 |
---|
53 | +++ ioemu/vl.h 2007-05-03 15:20:45.000000000 +0100 |
---|
54 | @@ -818,8 +818,9 @@ |
---|
55 | |
---|
56 | /* ide.c */ |
---|
57 | #define MAX_DISKS 4 |
---|
58 | +#define MAX_SCSI_DISKS 7 |
---|
59 | |
---|
60 | -extern BlockDriverState *bs_table[MAX_DISKS]; |
---|
61 | +extern BlockDriverState *bs_table[MAX_DISKS + MAX_SCSI_DISKS]; |
---|
62 | |
---|
63 | void isa_ide_init(int iobase, int iobase2, int irq, |
---|
64 | BlockDriverState *hd0, BlockDriverState *hd1); |
---|
65 | Index: ioemu/hw/pc.c |
---|
66 | =================================================================== |
---|
67 | --- ioemu.orig/hw/pc.c 2007-05-03 15:20:44.000000000 +0100 |
---|
68 | +++ ioemu/hw/pc.c 2007-05-03 15:20:45.000000000 +0100 |
---|
69 | @@ -902,7 +902,6 @@ |
---|
70 | if (pci_enabled && acpi_enabled) { |
---|
71 | piix4_pm_init(pci_bus, piix3_devfn + 3); |
---|
72 | } |
---|
73 | -#endif /* !CONFIG_DM */ |
---|
74 | |
---|
75 | #if 0 |
---|
76 | /* ??? Need to figure out some way for the user to |
---|
77 | @@ -921,6 +920,18 @@ |
---|
78 | lsi_scsi_attach(scsi, bdrv, -1); |
---|
79 | } |
---|
80 | #endif |
---|
81 | +#else |
---|
82 | + if (pci_enabled) { |
---|
83 | + void *scsi = NULL; |
---|
84 | + for (i = 0; i < MAX_SCSI_DISKS ; i++) { |
---|
85 | + if (!bs_table[i + MAX_DISKS]) |
---|
86 | + continue; |
---|
87 | + if (!scsi) |
---|
88 | + scsi = lsi_scsi_init(pci_bus, -1); |
---|
89 | + lsi_scsi_attach(scsi, bs_table[i + MAX_DISKS], -1); |
---|
90 | + } |
---|
91 | + } |
---|
92 | +#endif /* !CONFIG_DM */ |
---|
93 | /* must be done after all PCI devices are instanciated */ |
---|
94 | /* XXX: should be done in the Bochs BIOS */ |
---|
95 | if (pci_enabled) { |
---|
96 | Index: ioemu/xenstore.c |
---|
97 | =================================================================== |
---|
98 | --- ioemu.orig/xenstore.c 2007-05-03 15:20:45.000000000 +0100 |
---|
99 | +++ ioemu/xenstore.c 2007-05-03 15:20:45.000000000 +0100 |
---|
100 | @@ -18,7 +18,7 @@ |
---|
101 | #include <fcntl.h> |
---|
102 | |
---|
103 | static struct xs_handle *xsh = NULL; |
---|
104 | -static char *media_filename[MAX_DISKS]; |
---|
105 | +static char *media_filename[MAX_DISKS + MAX_SCSI_DISKS]; |
---|
106 | static QEMUTimer *insert_timer = NULL; |
---|
107 | |
---|
108 | #define UWAIT_MAX (30*1000000) /* thirty seconds */ |
---|
109 | @@ -44,7 +44,7 @@ |
---|
110 | { |
---|
111 | int i; |
---|
112 | |
---|
113 | - for (i = 0; i < MAX_DISKS; i++) { |
---|
114 | + for (i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) { |
---|
115 | if (media_filename[i] && bs_table[i]) { |
---|
116 | do_change(bs_table[i]->device_name, media_filename[i]); |
---|
117 | free(media_filename[i]); |
---|
118 | @@ -83,10 +83,10 @@ |
---|
119 | char *buf = NULL, *path; |
---|
120 | char *fpath = NULL, *bpath = NULL, |
---|
121 | *dev = NULL, *params = NULL, *type = NULL; |
---|
122 | - int i; |
---|
123 | + int i, is_scsi; |
---|
124 | unsigned int len, num, hd_index; |
---|
125 | |
---|
126 | - for(i = 0; i < MAX_DISKS; i++) |
---|
127 | + for(i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) |
---|
128 | media_filename[i] = NULL; |
---|
129 | |
---|
130 | xsh = xs_daemon_open(); |
---|
131 | @@ -123,10 +123,11 @@ |
---|
132 | dev = xs_read(xsh, XBT_NULL, buf, &len); |
---|
133 | if (dev == NULL) |
---|
134 | continue; |
---|
135 | - if (strncmp(dev, "hd", 2) || strlen(dev) != 3) |
---|
136 | + is_scsi = !strncmp(dev, "sd", 2); |
---|
137 | + if ((strncmp(dev, "hd", 2) && !is_scsi) || strlen(dev) != 3 ) |
---|
138 | continue; |
---|
139 | hd_index = dev[2] - 'a'; |
---|
140 | - if (hd_index >= MAX_DISKS) |
---|
141 | + if (hd_index >= (is_scsi ? MAX_SCSI_DISKS : MAX_DISKS)) |
---|
142 | continue; |
---|
143 | /* read the type of the device */ |
---|
144 | if (pasprintf(&buf, "%s/device/vbd/%s/device-type", path, e[i]) == -1) |
---|
145 | @@ -163,7 +164,7 @@ |
---|
146 | } |
---|
147 | } |
---|
148 | |
---|
149 | - bs_table[hd_index] = bdrv_new(dev); |
---|
150 | + bs_table[hd_index + (is_scsi ? MAX_DISKS : 0)] = bdrv_new(dev); |
---|
151 | /* check if it is a cdrom */ |
---|
152 | if (type && !strcmp(type, "cdrom")) { |
---|
153 | bdrv_set_type_hint(bs_table[hd_index], BDRV_TYPE_CDROM); |
---|
154 | @@ -172,7 +173,8 @@ |
---|
155 | } |
---|
156 | /* open device now if media present */ |
---|
157 | if (params[0]) { |
---|
158 | - if (bdrv_open(bs_table[hd_index], params, 0 /* snapshot */) < 0) |
---|
159 | + if (bdrv_open(bs_table[hd_index + (is_scsi ? MAX_DISKS : 0)], |
---|
160 | + params, 0 /* snapshot */) < 0) |
---|
161 | fprintf(stderr, "qemu: could not open hard disk image '%s'\n", |
---|
162 | params); |
---|
163 | } |
---|
164 | Index: ioemu/monitor.c |
---|
165 | =================================================================== |
---|
166 | --- ioemu.orig/monitor.c 2007-05-03 15:18:43.000000000 +0100 |
---|
167 | +++ ioemu/monitor.c 2007-05-03 15:20:45.000000000 +0100 |
---|
168 | @@ -180,7 +180,7 @@ |
---|
169 | { |
---|
170 | int i; |
---|
171 | |
---|
172 | - for (i = 0; i < MAX_DISKS; i++) { |
---|
173 | + for (i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) { |
---|
174 | if (bs_table[i]) { |
---|
175 | bdrv_commit(bs_table[i]); |
---|
176 | } |
---|
177 | Index: ioemu/hw/lsi53c895a.c |
---|
178 | =================================================================== |
---|
179 | --- ioemu.orig/hw/lsi53c895a.c 2007-05-03 15:18:43.000000000 +0100 |
---|
180 | +++ ioemu/hw/lsi53c895a.c 2007-05-03 15:20:45.000000000 +0100 |
---|
181 | @@ -1071,8 +1071,13 @@ |
---|
182 | shift = (offset & 3) * 8; |
---|
183 | return (s->scratch[n] >> shift) & 0xff; |
---|
184 | } |
---|
185 | +#ifndef CONFIG_DM |
---|
186 | BADF("readb 0x%x\n", offset); |
---|
187 | exit(1); |
---|
188 | +#else |
---|
189 | + /* XEN: This path can be triggered (e.g. ASPI8DOS.SYS reads 0x8). */ |
---|
190 | + return 0; |
---|
191 | +#endif |
---|
192 | #undef CASE_GET_REG32 |
---|
193 | } |
---|
194 | |
---|