[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 09/19] test-bdrv-drain: Add test for node deleti
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-block] [PATCH 09/19] test-bdrv-drain: Add test for node deletion |
Date: |
Fri, 20 Apr 2018 15:32:47 +0800 |
User-agent: |
Mutt/1.9.2 (2017-12-15) |
On Wed, Apr 11, 2018 at 06:39:30PM +0200, Kevin Wolf wrote:
> +static void do_test_delete_by_drain(bool detach_instead_of_delete)
> +{
> + BlockBackend *blk;
> + BlockDriverState *bs, *child_bs, *null_bs;
> + BDRVTestTopState *tts;
> + TestCoDeleteByDrainData dbdd;
> + Coroutine *co;
> +
> + bs = bdrv_new_open_driver(&bdrv_test_top_driver, "top", BDRV_O_RDWR,
> + &error_abort);
> + bs->total_sectors = 65536 >> BDRV_SECTOR_BITS;
> + tts = bs->opaque;
> +
> + null_bs = bdrv_open("null-co://", NULL, NULL, BDRV_O_RDWR |
> BDRV_O_PROTOCOL,
> + &error_abort);
> + bdrv_attach_child(bs, null_bs, "null-child", &child_file, &error_abort);
> +
> + /* This child will be the one to pass to requests through to, and
> + * it will stall until a drain occurs */
> + child_bs = bdrv_new_open_driver(&bdrv_test, "child", BDRV_O_RDWR,
> + &error_abort);
> + child_bs->total_sectors = 65536 >> BDRV_SECTOR_BITS;
> + /* Takes our reference to child_bs */
> + tts->wait_child = bdrv_attach_child(bs, child_bs, "wait-child",
> &child_file,
> + &error_abort);
> +
> + /* This child is just there to be deleted
> + * (for detach_instead_of_delete == true) */
> + null_bs = bdrv_open("null-co://", NULL, NULL, BDRV_O_RDWR |
> BDRV_O_PROTOCOL,
> + &error_abort);
> + bdrv_attach_child(bs, null_bs, "null-child", &child_file, &error_abort);
Why is null_bs created twice (with the exact same "null-child" name)?
I'm surprised that bdrv_attach_child() succeeds with a duplicate name.
Anyway, I find the duplicate null_bs confusing and I'm not sure if it's
a copy-paste mistake.
signature.asc
Description: PGP signature
- Re: [Qemu-block] [PATCH 07/19] block: Really pause block jobs on drain, (continued)
[Qemu-block] [PATCH 06/19] block: Avoid unnecessary aio_poll() in AIO_WAIT_WHILE(), Kevin Wolf, 2018/04/11
[Qemu-block] [PATCH 04/19] block: Don't manually poll in bdrv_drain_all(), Kevin Wolf, 2018/04/11
[Qemu-block] [PATCH 01/19] test-bdrv-drain: bdrv_drain() works with cross-AioContext events, Kevin Wolf, 2018/04/11
[Qemu-block] [PATCH 09/19] test-bdrv-drain: Add test for node deletion, Kevin Wolf, 2018/04/11
- Re: [Qemu-block] [PATCH 09/19] test-bdrv-drain: Add test for node deletion,
Stefan Hajnoczi <=
[Qemu-block] [PATCH 11/19] test-bdrv-drain: Test node deletion in subtree recursion, Kevin Wolf, 2018/04/11
[Qemu-block] [PATCH 10/19] block: Drain recursively with a single BDRV_POLL_WHILE(), Kevin Wolf, 2018/04/11
[Qemu-block] [PATCH 12/19] block: Don't poll in parent drain callbacks, Kevin Wolf, 2018/04/11
[Qemu-block] [PATCH 14/19] block: Defer .bdrv_drain_begin callback to polling phase, Kevin Wolf, 2018/04/11
[Qemu-block] [PATCH 16/19] block: Allow AIO_WAIT_WHILE with NULL ctx, Kevin Wolf, 2018/04/11
[Qemu-block] [PATCH 15/19] test-bdrv-drain: Test that bdrv_drain_invoke() doesn't poll, Kevin Wolf, 2018/04/11
[Qemu-block] [PATCH 13/19] test-bdrv-drain: Graph change through parent callback, Kevin Wolf, 2018/04/11
[Qemu-block] [PATCH 19/19] test-bdrv-drain: Test graph changes in drain_all section, Kevin Wolf, 2018/04/11