mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
block: refactor bdrv_check_request: add errp
It's better to pass &error_abort than just assert that result is 0: on crash, we'll immediately see the reason in the backtrace. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20201211183934.169161-2-vsementsov@virtuozzo.com> Reviewed-by: Eric Blake <eblake@redhat.com> [eblake: fix iotest 206 fallout] Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
c930831446
commit
69b55e03f7
5 changed files with 28 additions and 12 deletions
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "block/block_int.h"
|
||||
#include "block/write-threshold.h"
|
||||
|
||||
|
@ -64,7 +65,7 @@ static void test_threshold_not_trigger(void)
|
|||
req.offset = 1024;
|
||||
req.bytes = 1024;
|
||||
|
||||
assert(bdrv_check_request(req.offset, req.bytes) == 0);
|
||||
bdrv_check_request(req.offset, req.bytes, &error_abort);
|
||||
|
||||
bdrv_write_threshold_set(&bs, threshold);
|
||||
amount = bdrv_write_threshold_exceeded(&bs, &req);
|
||||
|
@ -84,7 +85,7 @@ static void test_threshold_trigger(void)
|
|||
req.offset = (4 * 1024 * 1024) - 1024;
|
||||
req.bytes = 2 * 1024;
|
||||
|
||||
assert(bdrv_check_request(req.offset, req.bytes) == 0);
|
||||
bdrv_check_request(req.offset, req.bytes, &error_abort);
|
||||
|
||||
bdrv_write_threshold_set(&bs, threshold);
|
||||
amount = bdrv_write_threshold_exceeded(&bs, &req);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue