From dbe824cc57fbc93dc7ee53287e06c101b20e078b Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Sun, 2 Jul 2017 13:06:45 +0300 Subject: block: add clock_type field to ThrottleGroup Clock type in throttling is currently inferred by the ThrottleTimer's clock type even though it is a per-ThrottleGroup property; it doesn't make sense to have different clock types in the same group. Moving this to a field in ThrottleGroup can simplify some of the throttle functions. Signed-off-by: Manos Pitsidianakis Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- include/qemu/throttle.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/qemu/throttle.h b/include/qemu/throttle.h index 9109657..8d2fd77 100644 --- a/include/qemu/throttle.h +++ b/include/qemu/throttle.h @@ -139,6 +139,7 @@ bool throttle_enabled(ThrottleConfig *cfg); bool throttle_is_valid(ThrottleConfig *cfg, Error **errp); void throttle_config(ThrottleState *ts, + QEMUClockType clock_type, ThrottleTimers *tt, ThrottleConfig *cfg); -- cgit v1.1 From 27e4cf13030ca5d12bbad12f38a27d35378a5894 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Sun, 2 Jul 2017 13:06:46 +0300 Subject: block: remove timer canceling in throttle_config() throttle_config() cancels the timers of the calling BlockBackend. This doesn't make sense because other BlockBackends in the group remain untouched. There's no need to cancel the timers in the one specific BlockBackend so let's not do that. Throttled requests will run as scheduled and future requests will follow the new configuration. This also allows a throttle group's configuration to be changed even when it has no members. Signed-off-by: Manos Pitsidianakis Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- include/qemu/throttle.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/qemu/throttle.h b/include/qemu/throttle.h index 8d2fd77..d056008 100644 --- a/include/qemu/throttle.h +++ b/include/qemu/throttle.h @@ -140,7 +140,6 @@ bool throttle_is_valid(ThrottleConfig *cfg, Error **errp); void throttle_config(ThrottleState *ts, QEMUClockType clock_type, - ThrottleTimers *tt, ThrottleConfig *cfg); void throttle_get_config(ThrottleState *ts, ThrottleConfig *cfg); -- cgit v1.1 From 77beef8365ef797c95e49d87f07ed5d60d583594 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Tue, 11 Jul 2017 13:26:59 +0200 Subject: block: Make blk_get_attached_dev_id() public Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: John Snow --- include/sysemu/block-backend.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index d9ea0cd..fe47799 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -126,6 +126,7 @@ int blk_attach_dev(BlockBackend *blk, DeviceState *dev); void blk_attach_dev_legacy(BlockBackend *blk, void *dev); void blk_detach_dev(BlockBackend *blk, void *dev); void *blk_get_attached_dev(BlockBackend *blk); +char *blk_get_attached_dev_id(BlockBackend *blk); BlockBackend *blk_by_dev(void *dev); BlockBackend *blk_by_qdev_id(const char *id, Error **errp); void blk_set_dev_ops(BlockBackend *blk, const BlockDevOps *ops, void *opaque); -- cgit v1.1 From a429b9b5f44fb126b3a6ff971027470254401487 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Tue, 11 Jul 2017 14:06:04 +0200 Subject: block: Make blk_all_next() public Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: John Snow --- include/sysemu/block-backend.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index fe47799..4a37305 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -100,6 +100,7 @@ void blk_remove_all_bs(void); const char *blk_name(const BlockBackend *blk); BlockBackend *blk_by_name(const char *name); BlockBackend *blk_next(BlockBackend *blk); +BlockBackend *blk_all_next(BlockBackend *blk); bool monitor_add_blk(BlockBackend *blk, const char *name, Error **errp); void monitor_remove_blk(BlockBackend *blk); -- cgit v1.1