From 271b385e7ec2f1ca23c5345599cd58d9651427e5 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Fri, 20 May 2016 11:00:31 -0700 Subject: tests: avoid coroutine pool test crash Skip the test_co_queue test case if the coroutine pool is not enabled. The test case does not work without the pool because it touches memory belonging to a freed coroutine (on purpose). Reported-by: Eduardo Habkost Signed-off-by: Stefan Hajnoczi Reviewed-by: Fam Zheng Message-id: 1463767231-13379-1-git-send-email-stefanha@redhat.com --- tests/test-coroutine.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test-coroutine.c b/tests/test-coroutine.c index dd4ced946c..ea7f87f487 100644 --- a/tests/test-coroutine.c +++ b/tests/test-coroutine.c @@ -369,7 +369,15 @@ static void perf_cost(void) int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); - g_test_add_func("/basic/co_queue", test_co_queue); + + /* This test assumes there is a freelist and marks freed coroutine memory + * with a sentinel value. If there is no freelist this would legitimately + * crash, so skip it. + */ + if (CONFIG_COROUTINE_POOL) { + g_test_add_func("/basic/co_queue", test_co_queue); + } + g_test_add_func("/basic/lifecycle", test_lifecycle); g_test_add_func("/basic/yield", test_yield); g_test_add_func("/basic/nesting", test_nesting); -- cgit v1.2.3 From 117bc3fa22d359db6c4f0c10f34c8c9e00ed64af Mon Sep 17 00:00:00 2001 From: Peter Lieven Date: Mon, 30 May 2016 13:31:13 +0200 Subject: block/io: optimize bdrv_co_pwritev for small requests in a read-modify-write cycle a small request might cause head and tail to fall into the same aligned block. Currently QEMU reads the same block twice in this case which is not necessary. Signed-off-by: Peter Lieven Message-id: 1464607873-28206-1-git-send-email-pl@kamp.de Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/077 | 12 +----------- tests/qemu-iotests/077.out | 26 -------------------------- 2 files changed, 1 insertion(+), 37 deletions(-) (limited to 'tests') diff --git a/tests/qemu-iotests/077 b/tests/qemu-iotests/077 index 4dc680b7fc..d2d2a2d687 100755 --- a/tests/qemu-iotests/077 +++ b/tests/qemu-iotests/077 @@ -60,7 +60,7 @@ EOF # Sequential RMW requests on the same physical sector off=0x1000 -for ev in "head" "after_head" "tail" "after_tail"; do +for ev in "head" "after_head"; do cat < Date: Wed, 1 Jun 2016 17:40:31 -0700 Subject: throttle: refuse iops-size without iops-total/read/write In a similar vein to commit ee2bdc33c913b7d765baa5aa338c29fb30a05c9a ("throttle: refuse bps_max/iops_max without bps/iops") it is likely that the user made a configuration error if iops-size has been set but no iops limit has been set. Print an error message so the user can check their throttling configuration. They should either remove iops-size if they don't want any throttling or specify one of iops-total, iops-read, or iops-write. Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Message-id: 1464828031-25601-1-git-send-email-stefanha@redhat.com --- tests/test-throttle.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/test-throttle.c b/tests/test-throttle.c index c02be805f7..d584870950 100644 --- a/tests/test-throttle.c +++ b/tests/test-throttle.c @@ -398,6 +398,14 @@ static void test_max_is_missing_limit(void) } } +static void test_iops_size_is_missing_limit(void) +{ + /* A total/read/write iops limit is required */ + throttle_config_init(&cfg); + cfg.op_size = 4096; + g_assert(!throttle_is_valid(&cfg, NULL)); +} + static void test_have_timer(void) { /* zero structures */ @@ -653,6 +661,8 @@ int main(int argc, char **argv) g_test_add_func("/throttle/config/conflicting", test_conflicting_config); g_test_add_func("/throttle/config/is_valid", test_is_valid); g_test_add_func("/throttle/config/max", test_max_is_missing_limit); + g_test_add_func("/throttle/config/iops_size", + test_iops_size_is_missing_limit); g_test_add_func("/throttle/config_functions", test_config_functions); g_test_add_func("/throttle/accounting", test_accounting); g_test_add_func("/throttle/groups", test_groups); -- cgit v1.2.3