Commit a1620fac3d267b67921d0e3e3c0e42dff22ec49d
1 parent
cd940061
Describe the format= option in the --help output. List the accepted
values with format=?. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4279 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
14 additions
and
3 deletions
vl.c
... | ... | @@ -4949,6 +4949,11 @@ int drive_get_max_bus(BlockInterfaceType type) |
4949 | 4949 | return max_bus; |
4950 | 4950 | } |
4951 | 4951 | |
4952 | +static void bdrv_format_print(void *opaque, const char *name) | |
4953 | +{ | |
4954 | + fprintf(stderr, " %s", name); | |
4955 | +} | |
4956 | + | |
4952 | 4957 | static int drive_init(struct drive_opt *arg, int snapshot, |
4953 | 4958 | QEMUMachine *machine) |
4954 | 4959 | { |
... | ... | @@ -5138,6 +5143,12 @@ static int drive_init(struct drive_opt *arg, int snapshot, |
5138 | 5143 | } |
5139 | 5144 | |
5140 | 5145 | if (get_param_value(buf, sizeof(buf), "format", str)) { |
5146 | + if (strcmp(buf, "?") == 0) { | |
5147 | + fprintf(stderr, "qemu: Supported formats:"); | |
5148 | + bdrv_iterate_format(bdrv_format_print, NULL); | |
5149 | + fprintf(stderr, "\n"); | |
5150 | + return -1; | |
5151 | + } | |
5141 | 5152 | drv = bdrv_find_format(buf); |
5142 | 5153 | if (!drv) { |
5143 | 5154 | fprintf(stderr, "qemu: '%s' invalid format\n", buf); |
... | ... | @@ -7634,9 +7645,9 @@ static void help(int exitcode) |
7634 | 7645 | "-hda/-hdb file use 'file' as IDE hard disk 0/1 image\n" |
7635 | 7646 | "-hdc/-hdd file use 'file' as IDE hard disk 2/3 image\n" |
7636 | 7647 | "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n" |
7637 | - "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][index=i]\n" | |
7638 | - " [,cyls=c,heads=h,secs=s[,trans=t]][snapshot=on|off]" | |
7639 | - " [,cache=on|off]\n" | |
7648 | + "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n" | |
7649 | + " [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off]\n" | |
7650 | + " [,cache=on|off][,format=f]\n" | |
7640 | 7651 | " use 'file' as a drive image\n" |
7641 | 7652 | "-mtdblock file use 'file' as on-board Flash memory image\n" |
7642 | 7653 | "-sd file use 'file' as SecureDigital card image\n" | ... | ... |