block.c (ef8104378c4a0497be079e48ee5ac5a89c68f978) block.c (c6149724080af7b3d5d61eac8942655e6d212783)
1/*
2 * QEMU System Emulator block driver
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 5555 unchanged lines hidden (view full) ---

5564 }
5565
5566 proto_drv = bdrv_find_protocol(filename, true);
5567 if (!proto_drv) {
5568 error_setg(errp, "Unknown protocol '%s'", filename);
5569 return;
5570 }
5571
1/*
2 * QEMU System Emulator block driver
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 5555 unchanged lines hidden (view full) ---

5564 }
5565
5566 proto_drv = bdrv_find_protocol(filename, true);
5567 if (!proto_drv) {
5568 error_setg(errp, "Unknown protocol '%s'", filename);
5569 return;
5570 }
5571
5572 if (!drv->create_opts) {
5573 error_setg(errp, "Format driver '%s' does not support image creation",
5574 drv->format_name);
5575 return;
5576 }
5577
5578 if (!proto_drv->create_opts) {
5579 error_setg(errp, "Protocol driver '%s' does not support image creation",
5580 proto_drv->format_name);
5581 return;
5582 }
5583
5572 create_opts = qemu_opts_append(create_opts, drv->create_opts);
5573 create_opts = qemu_opts_append(create_opts, proto_drv->create_opts);
5574
5575 /* Create parameter list with default values */
5576 opts = qemu_opts_create(create_opts, NULL, 0, &error_abort);
5577 qemu_opt_set_number(opts, BLOCK_OPT_SIZE, img_size);
5578
5579 /* Parse -o options */

--- 497 unchanged lines hidden ---
5584 create_opts = qemu_opts_append(create_opts, drv->create_opts);
5585 create_opts = qemu_opts_append(create_opts, proto_drv->create_opts);
5586
5587 /* Create parameter list with default values */
5588 opts = qemu_opts_create(create_opts, NULL, 0, &error_abort);
5589 qemu_opt_set_number(opts, BLOCK_OPT_SIZE, img_size);
5590
5591 /* Parse -o options */

--- 497 unchanged lines hidden ---