Commit f60d39bc4d4f0cc7bbbba172b05e24e1c1a36bc3
1 parent
0300e3fa
Fix compilation with Cygwin, by Herve Poussineau.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3831 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
21 additions
and
21 deletions
sysemu.h
| ... | ... | @@ -122,7 +122,7 @@ typedef enum { |
| 122 | 122 | |
| 123 | 123 | typedef struct DriveInfo { |
| 124 | 124 | BlockDriverState *bdrv; |
| 125 | - BlockInterfaceType interface; | |
| 125 | + BlockInterfaceType type; | |
| 126 | 126 | int bus; |
| 127 | 127 | int unit; |
| 128 | 128 | } DriveInfo; |
| ... | ... | @@ -134,8 +134,8 @@ typedef struct DriveInfo { |
| 134 | 134 | int nb_drives; |
| 135 | 135 | DriveInfo drives_table[MAX_DRIVES+1]; |
| 136 | 136 | |
| 137 | -extern int drive_get_index(BlockInterfaceType interface, int bus, int unit); | |
| 138 | -extern int drive_get_max_bus(BlockInterfaceType interface); | |
| 137 | +extern int drive_get_index(BlockInterfaceType type, int bus, int unit); | |
| 138 | +extern int drive_get_max_bus(BlockInterfaceType type); | |
| 139 | 139 | |
| 140 | 140 | /* serial ports */ |
| 141 | 141 | ... | ... |
vl.c
| ... | ... | @@ -4838,14 +4838,14 @@ static int drive_add(const char *fmt, ...) |
| 4838 | 4838 | return nb_drives_opt++; |
| 4839 | 4839 | } |
| 4840 | 4840 | |
| 4841 | -int drive_get_index(BlockInterfaceType interface, int bus, int unit) | |
| 4841 | +int drive_get_index(BlockInterfaceType type, int bus, int unit) | |
| 4842 | 4842 | { |
| 4843 | 4843 | int index; |
| 4844 | 4844 | |
| 4845 | 4845 | /* seek interface, bus and unit */ |
| 4846 | 4846 | |
| 4847 | 4847 | for (index = 0; index < nb_drives; index++) |
| 4848 | - if (drives_table[index].interface == interface && | |
| 4848 | + if (drives_table[index].type == type && | |
| 4849 | 4849 | drives_table[index].bus == bus && |
| 4850 | 4850 | drives_table[index].unit == unit) |
| 4851 | 4851 | return index; |
| ... | ... | @@ -4853,14 +4853,14 @@ int drive_get_index(BlockInterfaceType interface, int bus, int unit) |
| 4853 | 4853 | return -1; |
| 4854 | 4854 | } |
| 4855 | 4855 | |
| 4856 | -int drive_get_max_bus(BlockInterfaceType interface) | |
| 4856 | +int drive_get_max_bus(BlockInterfaceType type) | |
| 4857 | 4857 | { |
| 4858 | 4858 | int max_bus; |
| 4859 | 4859 | int index; |
| 4860 | 4860 | |
| 4861 | 4861 | max_bus = -1; |
| 4862 | 4862 | for (index = 0; index < nb_drives; index++) { |
| 4863 | - if(drives_table[index].interface == interface && | |
| 4863 | + if(drives_table[index].type == type && | |
| 4864 | 4864 | drives_table[index].bus > max_bus) |
| 4865 | 4865 | max_bus = drives_table[index].bus; |
| 4866 | 4866 | } |
| ... | ... | @@ -4873,7 +4873,7 @@ static int drive_init(const char *str, int snapshot, QEMUMachine *machine) |
| 4873 | 4873 | char file[1024]; |
| 4874 | 4874 | char devname[128]; |
| 4875 | 4875 | const char *mediastr = ""; |
| 4876 | - BlockInterfaceType interface; | |
| 4876 | + BlockInterfaceType type; | |
| 4877 | 4877 | enum { MEDIA_DISK, MEDIA_CDROM } media; |
| 4878 | 4878 | int bus_id, unit_id; |
| 4879 | 4879 | int cyls, heads, secs, translation; |
| ... | ... | @@ -4902,11 +4902,11 @@ static int drive_init(const char *str, int snapshot, QEMUMachine *machine) |
| 4902 | 4902 | !strcmp(machine->name, "SS-600MP") || |
| 4903 | 4903 | !strcmp(machine->name, "versatilepb") || |
| 4904 | 4904 | !strcmp(machine->name, "versatileab")) { |
| 4905 | - interface = IF_SCSI; | |
| 4905 | + type = IF_SCSI; | |
| 4906 | 4906 | max_devs = MAX_SCSI_DEVS; |
| 4907 | 4907 | strcpy(devname, "scsi"); |
| 4908 | 4908 | } else { |
| 4909 | - interface = IF_IDE; | |
| 4909 | + type = IF_IDE; | |
| 4910 | 4910 | max_devs = MAX_IDE_DEVS; |
| 4911 | 4911 | strcpy(devname, "ide"); |
| 4912 | 4912 | } |
| ... | ... | @@ -4933,22 +4933,22 @@ static int drive_init(const char *str, int snapshot, QEMUMachine *machine) |
| 4933 | 4933 | if (get_param_value(buf, sizeof(buf), "if", str)) { |
| 4934 | 4934 | strncpy(devname, buf, sizeof(devname)); |
| 4935 | 4935 | if (!strcmp(buf, "ide")) { |
| 4936 | - interface = IF_IDE; | |
| 4936 | + type = IF_IDE; | |
| 4937 | 4937 | max_devs = MAX_IDE_DEVS; |
| 4938 | 4938 | } else if (!strcmp(buf, "scsi")) { |
| 4939 | - interface = IF_SCSI; | |
| 4939 | + type = IF_SCSI; | |
| 4940 | 4940 | max_devs = MAX_SCSI_DEVS; |
| 4941 | 4941 | } else if (!strcmp(buf, "floppy")) { |
| 4942 | - interface = IF_FLOPPY; | |
| 4942 | + type = IF_FLOPPY; | |
| 4943 | 4943 | max_devs = 0; |
| 4944 | 4944 | } else if (!strcmp(buf, "pflash")) { |
| 4945 | - interface = IF_PFLASH; | |
| 4945 | + type = IF_PFLASH; | |
| 4946 | 4946 | max_devs = 0; |
| 4947 | 4947 | } else if (!strcmp(buf, "mtd")) { |
| 4948 | - interface = IF_MTD; | |
| 4948 | + type = IF_MTD; | |
| 4949 | 4949 | max_devs = 0; |
| 4950 | 4950 | } else if (!strcmp(buf, "sd")) { |
| 4951 | - interface = IF_SD; | |
| 4951 | + type = IF_SD; | |
| 4952 | 4952 | max_devs = 0; |
| 4953 | 4953 | } else { |
| 4954 | 4954 | fprintf(stderr, "qemu: '%s' unsupported bus type '%s'\n", str, buf); |
| ... | ... | @@ -5063,7 +5063,7 @@ static int drive_init(const char *str, int snapshot, QEMUMachine *machine) |
| 5063 | 5063 | |
| 5064 | 5064 | if (unit_id == -1) { |
| 5065 | 5065 | unit_id = 0; |
| 5066 | - while (drive_get_index(interface, bus_id, unit_id) != -1) { | |
| 5066 | + while (drive_get_index(type, bus_id, unit_id) != -1) { | |
| 5067 | 5067 | unit_id++; |
| 5068 | 5068 | if (max_devs && unit_id >= max_devs) { |
| 5069 | 5069 | unit_id -= max_devs; |
| ... | ... | @@ -5084,23 +5084,23 @@ static int drive_init(const char *str, int snapshot, QEMUMachine *machine) |
| 5084 | 5084 | * ignore multiple definitions |
| 5085 | 5085 | */ |
| 5086 | 5086 | |
| 5087 | - if (drive_get_index(interface, bus_id, unit_id) != -1) | |
| 5087 | + if (drive_get_index(type, bus_id, unit_id) != -1) | |
| 5088 | 5088 | return 0; |
| 5089 | 5089 | |
| 5090 | 5090 | /* init */ |
| 5091 | 5091 | |
| 5092 | - if (interface == IF_IDE || interface == IF_SCSI) | |
| 5092 | + if (type == IF_IDE || type == IF_SCSI) | |
| 5093 | 5093 | mediastr = (media == MEDIA_CDROM) ? "-cd" : "-hd"; |
| 5094 | 5094 | snprintf(buf, sizeof(buf), max_devs ? "%1$s%4$i%2$s%3$i" : "%s%s%i", |
| 5095 | 5095 | devname, mediastr, unit_id, bus_id); |
| 5096 | 5096 | bdrv = bdrv_new(buf); |
| 5097 | 5097 | drives_table[nb_drives].bdrv = bdrv; |
| 5098 | - drives_table[nb_drives].interface = interface; | |
| 5098 | + drives_table[nb_drives].type = type; | |
| 5099 | 5099 | drives_table[nb_drives].bus = bus_id; |
| 5100 | 5100 | drives_table[nb_drives].unit = unit_id; |
| 5101 | 5101 | nb_drives++; |
| 5102 | 5102 | |
| 5103 | - switch(interface) { | |
| 5103 | + switch(type) { | |
| 5104 | 5104 | case IF_IDE: |
| 5105 | 5105 | case IF_SCSI: |
| 5106 | 5106 | switch(media) { | ... | ... |