- if (options && !strcmp(options, "?")) {
- ret = print_block_option_help(filename, fmt);
- goto out;
- }
-
- /* Find driver and parse its options */
- drv = bdrv_find_format(fmt);
- if (!drv) {
- error("Unknown file format '%s'", fmt);
- ret = -1;
- goto out;
- }
-
- proto_drv = bdrv_find_protocol(filename);
- if (!proto_drv) {
- error("Unknown protocol '%s'", filename);
- ret = -1;
- goto out;
- }
-
- create_options = append_option_parameters(create_options,
- drv->create_options);
- create_options = append_option_parameters(create_options,
- proto_drv->create_options);
-
- /* Create parameter list with default values */
- param = parse_option_parameters("", create_options, param);
- set_option_parameter_int(param, BLOCK_OPT_SIZE, -1);
-
- /* Parse -o options */
- if (options) {
- param = parse_option_parameters(options, create_options, param);
- if (param == NULL) {
- error("Invalid options for file format '%s'.", fmt);
- ret = -1;
- goto out;
- }
- }
-
- /* Add size to parameters */