block.c (668f62ec621e4e2919fb7d4caa5d805764c5852d) block.c (af175e85f92c870386ad74f466e29537b79611d3)
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

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

1624 QemuOpts *opts;
1625 BlockDriver *drv;
1626 Error *local_err = NULL;
1627
1628 assert(bs->file == NULL);
1629 assert(options != NULL && bs->options != options);
1630
1631 opts = qemu_opts_create(&bdrv_runtime_opts, NULL, 0, &error_abort);
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

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

1624 QemuOpts *opts;
1625 BlockDriver *drv;
1626 Error *local_err = NULL;
1627
1628 assert(bs->file == NULL);
1629 assert(options != NULL && bs->options != options);
1630
1631 opts = qemu_opts_create(&bdrv_runtime_opts, NULL, 0, &error_abort);
1632 if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
1633 error_propagate(errp, local_err);
1632 if (!qemu_opts_absorb_qdict(opts, options, errp)) {
1634 ret = -EINVAL;
1635 goto fail_opts;
1636 }
1637
1638 update_flags_from_options(&bs->open_flags, opts);
1639
1640 driver_name = qemu_opt_get(opts, "driver");
1641 drv = bdrv_find_format(driver_name);

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

4085
4086 /* This function and each driver's bdrv_reopen_prepare() remove
4087 * entries from reopen_state->options as they are processed, so
4088 * we need to make a copy of the original QDict. */
4089 orig_reopen_opts = qdict_clone_shallow(reopen_state->options);
4090
4091 /* Process generic block layer options */
4092 opts = qemu_opts_create(&bdrv_runtime_opts, NULL, 0, &error_abort);
1633 ret = -EINVAL;
1634 goto fail_opts;
1635 }
1636
1637 update_flags_from_options(&bs->open_flags, opts);
1638
1639 driver_name = qemu_opt_get(opts, "driver");
1640 drv = bdrv_find_format(driver_name);

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

4084
4085 /* This function and each driver's bdrv_reopen_prepare() remove
4086 * entries from reopen_state->options as they are processed, so
4087 * we need to make a copy of the original QDict. */
4088 orig_reopen_opts = qdict_clone_shallow(reopen_state->options);
4089
4090 /* Process generic block layer options */
4091 opts = qemu_opts_create(&bdrv_runtime_opts, NULL, 0, &error_abort);
4093 if (!qemu_opts_absorb_qdict(opts, reopen_state->options, &local_err)) {
4094 error_propagate(errp, local_err);
4092 if (!qemu_opts_absorb_qdict(opts, reopen_state->options, errp)) {
4095 ret = -EINVAL;
4096 goto error;
4097 }
4098
4099 /* This was already called in bdrv_reopen_queue_child() so the flags
4100 * are up-to-date. This time we simply want to remove the options from
4101 * QemuOpts in order to indicate that they have been processed. */
4102 old_flags = reopen_state->flags;

--- 2798 unchanged lines hidden ---
4093 ret = -EINVAL;
4094 goto error;
4095 }
4096
4097 /* This was already called in bdrv_reopen_queue_child() so the flags
4098 * are up-to-date. This time we simply want to remove the options from
4099 * QemuOpts in order to indicate that they have been processed. */
4100 old_flags = reopen_state->flags;

--- 2798 unchanged lines hidden ---