Revision 9f7965c7 vl.c
b/vl.c | ||
---|---|---|
5648 | 5648 |
} |
5649 | 5649 |
|
5650 | 5650 |
if (get_param_value(buf, sizeof(buf), "cache", str)) { |
5651 |
if (!strcmp(buf, "off")) |
|
5651 |
if (!strcmp(buf, "off") || !strcmp(buf, "none"))
|
|
5652 | 5652 |
cache = 0; |
5653 |
else if (!strcmp(buf, "on"))
|
|
5653 |
else if (!strcmp(buf, "writethrough"))
|
|
5654 | 5654 |
cache = 1; |
5655 |
else if (!strcmp(buf, "writeback")) |
|
5656 |
cache = 2; |
|
5655 | 5657 |
else { |
5656 | 5658 |
fprintf(stderr, "qemu: invalid cache option\n"); |
5657 | 5659 |
return -1; |
... | ... | |
5770 | 5772 |
if (!file[0]) |
5771 | 5773 |
return 0; |
5772 | 5774 |
bdrv_flags = 0; |
5773 |
if (snapshot) |
|
5775 |
if (snapshot) {
|
|
5774 | 5776 |
bdrv_flags |= BDRV_O_SNAPSHOT; |
5775 |
if (!cache) |
|
5776 |
bdrv_flags |= BDRV_O_DIRECT; |
|
5777 |
cache = 2; /* always use write-back with snapshot */ |
|
5778 |
} |
|
5779 |
if (cache == 0) /* no caching */ |
|
5780 |
bdrv_flags |= BDRV_O_NOCACHE; |
|
5781 |
else if (cache == 2) /* write-back */ |
|
5782 |
bdrv_flags |= BDRV_O_CACHE_WB; |
|
5777 | 5783 |
if (bdrv_open2(bdrv, file, bdrv_flags, drv) < 0 || qemu_key_check(bdrv, file)) { |
5778 | 5784 |
fprintf(stderr, "qemu: could not open disk image %s\n", |
5779 | 5785 |
file); |
... | ... | |
8145 | 8151 |
"-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n" |
8146 | 8152 |
"-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n" |
8147 | 8153 |
" [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off]\n" |
8148 |
" [,cache=on|off][,format=f]\n"
|
|
8154 |
" [,cache=writethrough|writeback|none][,format=f]\n"
|
|
8149 | 8155 |
" use 'file' as a drive image\n" |
8150 | 8156 |
"-mtdblock file use 'file' as on-board Flash memory image\n" |
8151 | 8157 |
"-sd file use 'file' as SecureDigital card image\n" |
Also available in: Unified diff