[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 16/16] tests: Add test case for BLK_PERM_AIO_
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v2 16/16] tests: Add test case for BLK_PERM_AIO_CONTEXT_CHANGE |
Date: |
Thu, 11 May 2017 16:36:04 -0400 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
On Wed, Apr 19, 2017 at 05:43:56PM +0800, Fam Zheng wrote:
> +static void test_aio_context_failure(void)
> +{
> + Error *local_err = NULL;
> + BlockBackend *blk1 = blk_new(BLK_PERM_AIO_CONTEXT_CHANGE,
> + BLK_PERM_ALL &
> ~BLK_PERM_AIO_CONTEXT_CHANGE);
> + BlockBackend *blk2 = blk_new(BLK_PERM_AIO_CONTEXT_CHANGE, BLK_PERM_ALL);
> + BlockDriverState *bs = bdrv_open("null-co://", NULL, NULL, 0,
> &error_abort);
> +
> + blk_insert_bs(blk1, bs, &error_abort);
> + blk_insert_bs(blk2, bs, &local_err);
> +
> + g_assert_nonnull(local_err);
The following asserts and also frees the Error object to prevent leaking
memory:
error_free_or_abort(local_err);
signature.asc
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH v2 16/16] tests: Add test case for BLK_PERM_AIO_CONTEXT_CHANGE,
Stefan Hajnoczi <=