Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 221943
Collapse All | Expand All

(-)vl.c (-2 / +11 lines)
Lines 4877-4889 Link Here
4877
    int bus_id, unit_id;
4877
    int bus_id, unit_id;
4878
    int cyls, heads, secs, translation;
4878
    int cyls, heads, secs, translation;
4879
    BlockDriverState *bdrv;
4879
    BlockDriverState *bdrv;
4880
    BlockDriver *drv = NULL;
4880
    int max_devs;
4881
    int max_devs;
4881
    int index;
4882
    int index;
4882
    int cache;
4883
    int cache;
4883
    int bdrv_flags;
4884
    int bdrv_flags;
4884
    char *params[] = { "bus", "unit", "if", "index", "cyls", "heads",
4885
    char *params[] = { "bus", "unit", "if", "index", "cyls", "heads",
4885
                       "secs", "trans", "media", "snapshot", "file",
4886
                       "secs", "trans", "media", "snapshot", "file",
4886
                       "cache", NULL };
4887
		       "cache", "format", NULL };
4887
4888
4888
    if (check_params(buf, sizeof(buf), params, str) < 0) {
4889
    if (check_params(buf, sizeof(buf), params, str) < 0) {
4889
         fprintf(stderr, "qemu: unknowm parameter '%s' in '%s'\n",
4890
         fprintf(stderr, "qemu: unknowm parameter '%s' in '%s'\n",
Lines 5051-5056 Link Here
5051
        }
5052
        }
5052
    }
5053
    }
5053
5054
5055
    if (get_param_value(buf, sizeof(buf), "format", str)) {
5056
	 drv = bdrv_find_format(buf);
5057
	 if (!drv) {
5058
	    fprintf(stderr, "qemu: '%s' invalid format\n", buf);
5059
	    return -1;
5060
         }
5061
    }
5062
5054
    get_param_value(file, sizeof(file), "file", str);
5063
    get_param_value(file, sizeof(file), "file", str);
5055
5064
5056
    /* compute bus and unit according index */
5065
    /* compute bus and unit according index */
Lines 5150-5156 Link Here
5150
        bdrv_flags |= BDRV_O_SNAPSHOT;
5159
        bdrv_flags |= BDRV_O_SNAPSHOT;
5151
    if (!cache)
5160
    if (!cache)
5152
        bdrv_flags |= BDRV_O_DIRECT;
5161
        bdrv_flags |= BDRV_O_DIRECT;
5153
    if (bdrv_open(bdrv, file, bdrv_flags) < 0 || qemu_key_check(bdrv, file)) {
5162
    if (bdrv_open2(bdrv, file, bdrv_flags, drv) < 0 || qemu_key_check(bdrv, file)) {
5154
        fprintf(stderr, "qemu: could not open disk image %s\n",
5163
        fprintf(stderr, "qemu: could not open disk image %s\n",
5155
                        file);
5164
                        file);
5156
        return -1;
5165
        return -1;
(-)qemu-doc.texi (+4 lines)
Lines 252-257 Link Here
252
@var{snapshot} is "on" or "off" and allows to enable snapshot for given drive (see @option{-snapshot}).
252
@var{snapshot} is "on" or "off" and allows to enable snapshot for given drive (see @option{-snapshot}).
253
@item cache=@var{cache}
253
@item cache=@var{cache}
254
@var{cache} is "on" or "off" and allows to disable host cache to access data.
254
@var{cache} is "on" or "off" and allows to disable host cache to access data.
255
@item format=@var{format}
256
Specify which disk @var{format} will be used rather than detecting
257
the format.  Can be used to specifiy format=raw to avoid interpreting
258
an untrusted format header.
255
@end table
259
@end table
256
260
257
Instead of @option{-cdrom} you can use:
261
Instead of @option{-cdrom} you can use:

Return to bug 221943