Revision 9052ea6b vl.c
b/vl.c | ||
---|---|---|
1899 | 1899 |
return 0; |
1900 | 1900 |
} |
1901 | 1901 |
|
1902 |
static QEMUMachine *machine_parse(const char *name) |
|
1903 |
{ |
|
1904 |
QEMUMachine *m, *machine = NULL; |
|
1905 |
|
|
1906 |
if (name) { |
|
1907 |
machine = find_machine(name); |
|
1908 |
} |
|
1909 |
if (machine) { |
|
1910 |
return machine; |
|
1911 |
} |
|
1912 |
printf("Supported machines are:\n"); |
|
1913 |
for (m = first_machine; m != NULL; m = m->next) { |
|
1914 |
if (m->alias) { |
|
1915 |
printf("%-10s %s (alias of %s)\n", m->alias, m->desc, m->name); |
|
1916 |
} |
|
1917 |
printf("%-10s %s%s\n", m->name, m->desc, |
|
1918 |
m->is_default ? " (default)" : ""); |
|
1919 |
} |
|
1920 |
exit(!name || *name != '?'); |
|
1921 |
} |
|
1922 |
|
|
1902 | 1923 |
static int tcg_init(void) |
1903 | 1924 |
{ |
1904 | 1925 |
return 0; |
... | ... | |
2155 | 2176 |
} |
2156 | 2177 |
switch(popt->index) { |
2157 | 2178 |
case QEMU_OPTION_M: |
2158 |
machine = find_machine(optarg); |
|
2159 |
if (!machine) { |
|
2160 |
QEMUMachine *m; |
|
2161 |
printf("Supported machines are:\n"); |
|
2162 |
for(m = first_machine; m != NULL; m = m->next) { |
|
2163 |
if (m->alias) |
|
2164 |
printf("%-10s %s (alias of %s)\n", |
|
2165 |
m->alias, m->desc, m->name); |
|
2166 |
printf("%-10s %s%s\n", |
|
2167 |
m->name, m->desc, |
|
2168 |
m->is_default ? " (default)" : ""); |
|
2169 |
} |
|
2170 |
exit(*optarg != '?'); |
|
2171 |
} |
|
2179 |
machine = machine_parse(optarg); |
|
2172 | 2180 |
break; |
2173 | 2181 |
case QEMU_OPTION_cpu: |
2174 | 2182 |
/* hw initialization will check this */ |
... | ... | |
2698 | 2706 |
case QEMU_OPTION_machine: |
2699 | 2707 |
olist = qemu_find_opts("machine"); |
2700 | 2708 |
qemu_opts_reset(olist); |
2701 |
opts = qemu_opts_parse(olist, optarg, 0);
|
|
2709 |
opts = qemu_opts_parse(olist, optarg, 1);
|
|
2702 | 2710 |
if (!opts) { |
2703 | 2711 |
fprintf(stderr, "parse error: %s\n", optarg); |
2704 | 2712 |
exit(1); |
2705 | 2713 |
} |
2714 |
machine = machine_parse(qemu_opt_get(opts, "type")); |
|
2706 | 2715 |
break; |
2707 | 2716 |
case QEMU_OPTION_usb: |
2708 | 2717 |
usb_enabled = 1; |
... | ... | |
2976 | 2985 |
p = qemu_opt_get(QTAILQ_FIRST(&list->head), "accel"); |
2977 | 2986 |
} |
2978 | 2987 |
if (p == NULL) { |
2979 |
opts = qemu_opts_parse(qemu_find_opts("machine"),
|
|
2980 |
machine->default_machine_opts, 0);
|
|
2988 |
qemu_opts_reset(list);
|
|
2989 |
opts = qemu_opts_parse(list, machine->default_machine_opts, 0);
|
|
2981 | 2990 |
if (!opts) { |
2982 | 2991 |
fprintf(stderr, "parse error for machine %s: %s\n", |
2983 | 2992 |
machine->name, machine->default_machine_opts); |
Also available in: Unified diff