throttle.c (235e59cf03ed75d0ce96c97343194ed11c146231) throttle.c (af175e85f92c870386ad74f466e29537b79611d3)
1/*
2 * QEMU block throttling filter driver infrastructure
3 *
4 * Copyright (c) 2017 Manos Pitsidianakis
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 or

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

41 * If this function succeeds then the throttle group name is stored in
42 * @group and must be freed by the caller.
43 * If there's an error then @group remains unmodified.
44 */
45static int throttle_parse_options(QDict *options, char **group, Error **errp)
46{
47 int ret;
48 const char *group_name;
1/*
2 * QEMU block throttling filter driver infrastructure
3 *
4 * Copyright (c) 2017 Manos Pitsidianakis
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 or

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

41 * If this function succeeds then the throttle group name is stored in
42 * @group and must be freed by the caller.
43 * If there's an error then @group remains unmodified.
44 */
45static int throttle_parse_options(QDict *options, char **group, Error **errp)
46{
47 int ret;
48 const char *group_name;
49 Error *local_err = NULL;
50 QemuOpts *opts = qemu_opts_create(&throttle_opts, NULL, 0, &error_abort);
51
49 QemuOpts *opts = qemu_opts_create(&throttle_opts, NULL, 0, &error_abort);
50
52 if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
53 error_propagate(errp, local_err);
51 if (!qemu_opts_absorb_qdict(opts, options, errp)) {
54 ret = -EINVAL;
55 goto fin;
56 }
57
58 group_name = qemu_opt_get(opts, QEMU_OPT_THROTTLE_GROUP_NAME);
59 if (!group_name) {
60 error_setg(errp, "Please specify a throttle group");
61 ret = -EINVAL;

--- 208 unchanged lines hidden ---
52 ret = -EINVAL;
53 goto fin;
54 }
55
56 group_name = qemu_opt_get(opts, QEMU_OPT_THROTTLE_GROUP_NAME);
57 if (!group_name) {
58 error_setg(errp, "Please specify a throttle group");
59 ret = -EINVAL;

--- 208 unchanged lines hidden ---