blockdev.c (a5614993d79584af93bb845f69f59872b3f76cf8) | blockdev.c (27ccdd52598290f0f8b58be56e235aff7aebfaf3) |
---|---|
1/* 2 * QEMU host block devices 3 * 4 * Copyright (c) 2003-2008 Fabrice Bellard 5 * 6 * This work is licensed under the terms of the GNU GPL, version 2 or 7 * later. See the COPYING file in the top-level directory. 8 * --- 2712 unchanged lines hidden (view full) --- 2721 2722 if (!throttle_is_valid(&cfg, errp)) { 2723 goto out; 2724 } 2725 2726 if (throttle_enabled(&cfg)) { 2727 /* Enable I/O limits if they're not enabled yet, otherwise 2728 * just update the throttling group. */ | 1/* 2 * QEMU host block devices 3 * 4 * Copyright (c) 2003-2008 Fabrice Bellard 5 * 6 * This work is licensed under the terms of the GNU GPL, version 2 or 7 * later. See the COPYING file in the top-level directory. 8 * --- 2712 unchanged lines hidden (view full) --- 2721 2722 if (!throttle_is_valid(&cfg, errp)) { 2723 goto out; 2724 } 2725 2726 if (throttle_enabled(&cfg)) { 2727 /* Enable I/O limits if they're not enabled yet, otherwise 2728 * just update the throttling group. */ |
2729 if (!bs->throttle_state) { | 2729 if (!blk_get_public(bs->blk)->throttle_state) { |
2730 bdrv_io_limits_enable(bs, has_group ? group : device); 2731 } else if (has_group) { 2732 bdrv_io_limits_update_group(bs, group); 2733 } 2734 /* Set the new throttling configuration */ 2735 bdrv_set_io_limits(bs, &cfg); | 2730 bdrv_io_limits_enable(bs, has_group ? group : device); 2731 } else if (has_group) { 2732 bdrv_io_limits_update_group(bs, group); 2733 } 2734 /* Set the new throttling configuration */ 2735 bdrv_set_io_limits(bs, &cfg); |
2736 } else if (bs->throttle_state) { | 2736 } else if (blk_get_public(bs->blk)->throttle_state) { |
2737 /* If all throttling settings are set to 0, disable I/O limits */ 2738 bdrv_io_limits_disable(bs); 2739 } 2740 2741out: 2742 aio_context_release(aio_context); 2743} 2744 --- 1607 unchanged lines hidden --- | 2737 /* If all throttling settings are set to 0, disable I/O limits */ 2738 bdrv_io_limits_disable(bs); 2739 } 2740 2741out: 2742 aio_context_release(aio_context); 2743} 2744 --- 1607 unchanged lines hidden --- |