Lines Matching defs:errp
90 Error **errp);
103 Transaction *change_child_tran, Error **errp);
111 Error **errp);
285 bool ignore_allow_rdw, Error **errp)
291 error_setg(errp, "Can't set node '%s' to r/o with copy-on-read enabled",
300 error_setg(errp, "Node '%s' is read only",
319 Error **errp)
341 error_setg(errp, "%s", errmsg ?: "Image is read-only");
347 * @errp. In all other cases, NULL will only be returned with @errp
350 * Therefore, a return value of NULL without @errp set means that
351 * there is no backing file; if @errp is set, there is one but its
356 Error **errp)
363 error_setg(errp, "Cannot use relative backing file names for '%s'",
373 * setting @errp. In all other cases, NULL will only be returned with
374 * @errp set.
378 const char *filename, Error **errp)
388 dir = bdrv_dirname(relative_to, errp);
398 char *bdrv_get_full_backing_filename(BlockDriverState *bs, Error **errp)
401 return bdrv_make_absolute_filename(bs, bs->backing_file, errp);
536 QemuOpts *opts, Error **errp)
543 error_setg(errp, "Driver '%s' does not support image creation",
548 ret = drv->bdrv_co_create_opts(drv, filename, opts, errp);
549 if (ret < 0 && !*errp) {
550 error_setg_errno(errp, -ret, "Could not create image");
565 Error **errp)
576 error_propagate(errp, local_err);
583 error_setg_errno(errp, -size,
590 error_propagate(errp, local_err);
607 Error **errp)
618 error_setg_errno(errp, -ret,
635 Error **errp)
654 error_propagate(errp, local_err);
659 error_setg(errp, "Unsupported preallocation mode '%s'",
668 BDRV_O_RDWR | BDRV_O_RESIZE, errp);
670 error_prepend(errp, "Protocol driver '%s' does not support creating "
678 size = create_file_fallback_truncate(blk, size, errp);
684 ret = create_file_fallback_zero_first_sector(blk, size, errp);
696 Error **errp)
705 drv = bdrv_find_protocol(filename, true, errp);
711 error_setg(errp, "Driver '%s' does not support image creation",
731 protocol_opts = qemu_opts_from_qdict(drv->create_opts, qdict, errp);
737 ret = bdrv_co_create(drv, filename, protocol_opts, errp);
744 int coroutine_fn bdrv_co_delete_file(BlockDriverState *bs, Error **errp)
754 error_setg(errp, "Block node '%s' is not opened", bs->filename);
759 error_setg(errp, "Driver '%s' does not support image deletion",
766 error_propagate(errp, local_err);
850 char *create_tmp_file(Error **errp)
873 error_setg_errno(errp, errno, "Could not open temporary file '%s'",
921 Error **errp)
963 int rv = block_module_load(block_driver_modules[i].library_name, errp);
974 error_setg(errp, "Unknown protocol '%s'", protocol);
1014 BlockDriver **pdrv, Error **errp)
1030 error_setg_errno(errp, -ret, "Could not read image for determining its "
1038 error_setg(errp, "Could not determine image format: No compatible "
1102 Error **errp)
1112 error_propagate(errp, local_err);
1119 error_setg(errp, "setting detect-zeroes to unmap is not allowed "
1231 Error **errp)
1234 return bdrv_change_aio_context(bs, ctx, visited, tran, errp);
1315 Error **errp)
1324 ret = bdrv_reopen_set_read_only(parent, false, errp);
1348 error_setg_errno(errp, -ret, "Could not update backing file link");
1502 Error **errp)
1507 errp);
1599 Error **errp)
1611 error_setg(errp, "Invalid node-name: '%s'", node_name);
1617 error_setg(errp, "node-name=%s is conflicting with a device id",
1624 error_setg(errp, "Duplicate nodes with node-name='%s'", node_name);
1630 error_setg(errp, "Node name too long");
1643 QDict *options, int open_flags, Error **errp)
1651 error_propagate(errp, local_err);
1667 error_propagate(errp, local_err);
1669 error_setg_errno(errp, -ret, "Could not open '%s'", bs->filename);
1671 error_setg_errno(errp, -ret, "Could not open image");
1692 error_setg_errno(errp, -ret, "Could not refresh total sector count");
1701 error_propagate(errp, local_err);
1742 Error **errp)
1757 ret = bdrv_open_driver(bs, drv, node_name, bs->options, flags, errp);
1772 int flags, Error **errp)
1775 return bdrv_new_open_driver_opts(drv, node_name, NULL, flags, errp);
1855 QDict *options, Error **errp)
1875 if (!qemu_opts_absorb_qdict(opts, options, errp)) {
1889 error_setg(errp,
1914 error_setg(errp, "The '%s' block driver requires a file name",
1934 error_setg(errp,
1950 error_setg(errp, "Can't use copy-on-read on read-only device");
1959 error_setg(errp, "Invalid discard option");
1968 error_propagate(errp, local_err);
1985 ret = bdrv_open_driver(bs, drv, node_name, options, open_flags, errp);
1998 static QDict *parse_json_filename(const char *filename, Error **errp)
2009 options_obj = qobject_from_json(filename, errp);
2011 error_prepend(errp, "Could not parse the JSON options: ");
2018 error_setg(errp, "Invalid JSON object given");
2028 Error **errp)
2041 error_propagate(errp, local_err);
2060 Error **errp)
2081 error_setg(errp, "Unknown driver '%s'", drvname);
2104 error_setg(errp, "Can't specify 'file' and 'filename' options at "
2116 drv = bdrv_find_protocol(filename, parse_filename, errp);
2124 error_setg(errp, "Must specify either driver or file");
2135 error_propagate(errp, local_err);
2204 static bool bdrv_a_allow_b(BdrvChild *a, BdrvChild *b, Error **errp)
2224 error_setg(errp, "Permission conflict on node '%s': permissions '%s' are "
2235 bdrv_parent_perms_conflict(BlockDriverState *bs, Error **errp)
2251 if (!bdrv_a_allow_b(a, b, errp)) {
2387 Transaction *tran, Error **errp)
2395 int ret = bs->drv->bdrv_check_perm(bs, perm, shared_perm, errp);
2500 Transaction *tran, Error **errp)
2515 error_setg(errp, "Block node is read-only");
2517 error_setg(errp, "Read-only block node '%s' cannot support "
2533 error_setg(errp, "Cannot get 'write' permission without 'resize': "
2546 errp);
2579 Error **errp)
2588 if (bdrv_parent_perms_conflict(bs, errp)) {
2592 ret = bdrv_node_refresh_perm(bs, q, tran, errp);
2611 Error **errp)
2620 return bdrv_do_refresh_perms(refresh_list, q, tran, errp);
2677 bdrv_refresh_perms(BlockDriverState *bs, Transaction *tran, Error **errp)
2688 ret = bdrv_do_refresh_perms(list, NULL, tran, errp);
2698 Error **errp)
2715 error_propagate(errp, local_err);
2731 int bdrv_child_refresh_perms(BlockDriverState *bs, BdrvChild *c, Error **errp)
2742 return bdrv_child_try_set_perm(c, perms, shared, errp);
3071 Transaction *tran, Error **errp)
3120 error_propagate(errp, local_err);
3174 Error **errp)
3182 error_setg(errp, "Making '%s' a %s child of '%s' would create a cycle",
3193 tran, errp);
3200 * On failure NULL is returned, errp is set and the reference to
3208 void *opaque, Error **errp)
3218 tran, errp);
3224 ret = bdrv_refresh_perms(child_bs, tran, errp);
3239 * On failure NULL is returned, errp is set and the reference to
3247 Error **errp)
3256 child_class, child_role, tran, errp);
3262 ret = bdrv_refresh_perms(parent_bs, tran, errp);
3440 Transaction *tran, Error **errp)
3455 error_setg(errp, "Node corrupted");
3460 error_setg(errp, "Cannot change frozen '%s' link from '%s' to '%s'",
3468 error_setg(errp, "Driver '%s' of node '%s' does not support backing "
3483 error_setg(errp, "Cannot set file child to format node without "
3503 tran, errp);
3532 Error **errp)
3543 ret = bdrv_set_file_or_backing_noperm(bs, backing_hd, true, tran, errp);
3548 ret = bdrv_refresh_perms(bs, tran, errp);
3555 Error **errp)
3568 ret = bdrv_set_backing_hd_drained(bs, backing_hd, errp);
3587 const char *bdref_key, Error **errp)
3646 error_propagate(errp, local_err);
3654 error_setg(errp, "Driver doesn't support backing files");
3666 errp);
3669 error_prepend(errp, "Could not open backing file: ");
3682 ret = bdrv_set_backing_hd(bs, backing_hd, errp);
3701 bool parse_filename, Error **errp)
3724 error_setg(errp, "A block device must be specified for \"%s\"",
3733 errp);
3749 Error **errp)
3757 child_role, allow_none, parse_filename, errp);
3764 errp);
3775 * BlockdevRef is given. NULL will be returned, but errp remains unset.
3791 bool allow_none, Error **errp)
3795 errp);
3807 BlockDriverState *parent, Error **errp)
3817 &child_of_bds, role, false, true, errp))
3829 BlockDriverState *bdrv_open_blockdev_ref(BlockdevRef *ref, Error **errp)
3863 errp);
3873 Error **errp)
3891 error_setg_errno(errp, -total_size, "Could not get image size");
3896 tmp_filename = create_tmp_file(errp);
3904 ret = bdrv_create(&bdrv_qcow2, tmp_filename, opts, errp);
3907 error_prepend(errp, "Could not create temporary overlay '%s': ",
3917 bs_snapshot = bdrv_open(NULL, NULL, snapshot_options, flags, errp);
3923 ret = bdrv_append(bs_snapshot, bs, errp);
3953 bool parse_filename, Error **errp)
3979 error_setg(errp, "Cannot reference an existing block device with "
3984 bs = bdrv_lookup_bs(reference, reference, errp);
4070 error_setg(errp, "Unknown driver: '%s'", drvname);
4142 error_setg(errp, "Must specify either driver or file");
4187 error_setg(errp, "Block protocol '%s' doesn't support the option "
4190 error_setg(errp,
4232 error_propagate(errp, local_err);
4239 error_propagate(errp, local_err);
4244 QDict *options, int flags, Error **errp)
4249 NULL, 0, true, errp);
4273 * Return 0 on success, otherwise return -EINVAL and set @errp.
4276 const QDict *new_opts, Error **errp)
4290 error_setg(errp, "Option '%s' cannot be reset "
4547 int bdrv_reopen_multiple(BlockReopenQueue *bs_queue, Error **errp)
4561 error_setg_errno(errp, -ret, "Error flushing drive");
4568 ret = bdrv_reopen_prepare(&bs_entry->state, bs_queue, tran, errp);
4594 ret = bdrv_list_refresh_perms(refresh_list, bs_queue, tran, errp);
4647 Error **errp)
4655 return bdrv_reopen_multiple(queue, errp);
4659 Error **errp)
4667 return bdrv_reopen(bs, opts, true, errp);
4688 * Return 0 on success, otherwise return < 0 and set @errp.
4695 Error **errp)
4723 new_child_bs = bdrv_lookup_bs(NULL, str, errp);
4731 error_setg(errp, "Making '%s' a %s child of '%s' would create a "
4758 error_setg(errp, "Cannot replace implicit %s child of %s",
4770 error_setg(errp, "'%s' is a %s filter node that does not support a "
4791 tran, errp);
4816 * Returns 0 on success, non-zero on error. On error errp will be set
4828 Transaction *change_child_tran, Error **errp)
4852 if (!qemu_opts_absorb_qdict(opts, reopen_state->options, errp)) {
4867 error_setg(errp, "Invalid discard option");
4876 error_propagate(errp, local_err);
4895 error_propagate(errp, local_err);
4906 reopen_state->options, errp);
4914 error_propagate(errp, local_err);
4919 error_setg(errp, "failed while preparing to reopen image '%s'",
4928 error_setg(errp, "Block format '%s' used by node '%s' "
4946 error_setg(errp, "backing is missing for '%s'",
4960 change_child_tran, errp);
4968 change_child_tran, errp);
5021 error_setg(errp, "Cannot change the option '%s'", entry->key);
5320 Error **errp)
5335 error_setg(errp, "Should not change '%s' link to '%s'",
5340 error_setg(errp, "Cannot change '%s' link to '%s'",
5365 bool auto_skip, bool detach_subchain, Error **errp)
5395 ret = bdrv_replace_node_noperm(from, to, auto_skip, tran, errp);
5408 ret = bdrv_list_refresh_perms(refresh_list, NULL, tran, errp);
5421 Error **errp)
5423 return bdrv_replace_node_common(from, to, true, false, errp);
5426 int bdrv_drop_filter(BlockDriverState *bs, Error **errp)
5439 ret = bdrv_replace_node_common(bs, child_bs, true, true, errp);
5459 Error **errp)
5478 tran, errp);
5484 ret = bdrv_replace_node_noperm(bs_top, bs_new, true, tran, errp);
5489 ret = bdrv_refresh_perms(bs_new, tran, errp);
5504 Error **errp)
5523 ret = bdrv_list_refresh_perms(refresh_list, NULL, tran, errp);
5567 int flags, Error **errp)
5578 error_setg(errp, "driver is not specified");
5584 error_setg(errp, "Unknown driver: '%s'", drvname);
5593 errp);
5598 error_prepend(errp, "Could not create node: ");
5610 ret = bdrv_replace_node(bs, new_node_bs, errp);
5617 error_prepend(errp, "Could not replace node: ");
5737 * between @bs and @base is frozen. @errp is set if that's the case.
5742 Error **errp)
5753 error_setg(errp, "Cannot change '%s' link from '%s' to '%s'",
5767 * Returns 0 on success. On failure returns < 0 and sets @errp.
5770 Error **errp)
5777 if (bdrv_is_backing_chain_frozen(bs, base, errp)) {
5784 error_setg(errp, "Cannot freeze '%s' link to '%s'",
6016 * @errp: Error object
6032 * If an error occurs the @errp pointer is set.
6035 BlockDriverState *in_bs, Error **errp)
6039 error_setg(errp, "Block driver '%s' does not support size measurement",
6044 return drv->bdrv_measure(opts, in_bs, errp);
6231 Error **errp)
6241 BlockDeviceInfo *info = bdrv_block_device_info(NULL, bs, flat, errp);
6337 XDbgBlockGraph *bdrv_get_xdbg_block_graph(Error **errp)
6388 Error **errp)
6401 error_setg(errp, "Device '%s' has no medium", device);
6416 error_setg(errp, "Cannot find device=\'%s\' nor node-name=\'%s\'",
6591 Error **errp)
6596 return drv->bdrv_get_specific_info(bs, errp);
6827 int bdrv_activate(BlockDriverState *bs, Error **errp)
6844 error_propagate(errp, local_err);
6864 ret = bdrv_refresh_perms(bs, NULL, errp);
6870 ret = bdrv_invalidate_cache(bs, errp);
6883 error_setg_errno(errp, -ret, "Could not refresh total sector count");
6893 error_propagate(errp, local_err);
6902 int coroutine_fn bdrv_co_invalidate_cache(BlockDriverState *bs, Error **errp)
6913 error_propagate(errp, local_err);
6921 void bdrv_activate_all(Error **errp)
6932 ret = bdrv_activate(bs, errp);
7155 bool bdrv_op_is_blocked(BlockDriverState *bs, BlockOpType op, Error **errp)
7163 error_propagate_prepend(errp, error_copy(blocker->reason),
7232 Error **errp)
7247 error_setg(errp, "Unknown file format '%s'", fmt);
7251 proto_drv = bdrv_find_protocol(filename, true, errp);
7257 error_setg(errp, "Format driver '%s' does not support image creation",
7263 error_setg(errp, "Protocol driver '%s' does not support image creation",
7276 if (!qemu_opts_do_parse(opts, options, NULL, errp)) {
7284 error_setg(errp, "The image size must be specified only once");
7291 error_setg(errp, "Backing file not supported for file format '%s'",
7299 error_setg(errp, "Backing file format not supported for file "
7308 error_setg(errp, "Error: Trying to create an image with the "
7313 error_setg(errp, "Expected backing file name, got empty string");
7369 error_setg_errno(errp, -size, "Could not get size of '%s'",
7389 error_setg(errp, "Image creation needs a size parameter");
7410 error_setg(errp, "The image size is too large for file format '%s'"
7419 error_propagate(errp, local_err);
7518 Error **errp)
7532 error_setg(errp, "Changing iothreads is not supported by %s", user);
7536 if (!c->klass->change_aio_ctx(c, ctx, visited, tran, errp)) {
7537 assert(!errp || *errp);
7545 Error **errp)
7552 return bdrv_change_aio_context(c->bs, ctx, visited, tran, errp);
7592 Error **errp)
7605 if (!bdrv_parent_change_aio_context(c, ctx, visited, tran, errp)) {
7612 if (!bdrv_child_change_aio_context(c, ctx, visited, tran, errp)) {
7641 BdrvChild *ignore_child, Error **errp)
7659 ret = bdrv_change_aio_context(bs, ctx, visited, tran, errp);
7724 Error **errp)
7728 error_setg(errp, "Node is ejected");
7732 error_setg(errp, "Block driver '%s' does not support option amendment",
7737 cb_opaque, force, errp);
7794 const char *node_name, Error **errp)
7801 error_setg(errp, "Failed to find node with node-name='%s'", node_name);
7805 if (bdrv_op_is_blocked(to_replace_bs, BLOCK_OP_TYPE_REPLACE, errp)) {
7815 error_setg(errp, "Cannot replace '%s' by a node mirrored from '%s', "
8074 char *bdrv_dirname(BlockDriverState *bs, Error **errp)
8082 error_setg(errp, "Node '%s' is ejected", bs->node_name);
8087 return drv->bdrv_dirname(bs, errp);
8092 return bdrv_dirname(child_bs, errp);
8100 error_setg(errp, "Cannot generate a base directory for %s nodes",
8110 Error **errp)
8114 error_setg(errp, "The node %s does not support adding a child",
8131 error_setg(errp, "Cannot add a %s child to a %s parent",
8139 error_setg(errp, "The node %s already has a parent",
8144 parent_bs->drv->bdrv_add_child(parent_bs, child_bs, errp);
8147 void bdrv_del_child(BlockDriverState *parent_bs, BdrvChild *child, Error **errp)
8153 error_setg(errp, "The node %s does not support removing a child",
8165 error_setg(errp, "The node %s does not have a child named %s",
8171 parent_bs->drv->bdrv_del_child(parent_bs, child, errp);
8174 int bdrv_make_empty(BdrvChild *c, Error **errp)
8183 error_setg(errp, "%s does not support emptying nodes",
8190 error_setg_errno(errp, -ret, "Failed to empty %s",