[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-block] [PATCH 09/19] test-bdrv-drain: Add test fo
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [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
- [Qemu-devel] [PATCH 08/19] block: Remove bdrv_drain_recurse(), (continued)
- [Qemu-devel] [PATCH 08/19] block: Remove bdrv_drain_recurse(), Kevin Wolf, 2018/04/11
- [Qemu-devel] [PATCH 04/19] block: Don't manually poll in bdrv_drain_all(), Kevin Wolf, 2018/04/11
- [Qemu-devel] [PATCH 06/19] block: Avoid unnecessary aio_poll() in AIO_WAIT_WHILE(), Kevin Wolf, 2018/04/11
- [Qemu-devel] [PATCH 09/19] test-bdrv-drain: Add test for node deletion, Kevin Wolf, 2018/04/11
- Re: [Qemu-devel] [Qemu-block] [PATCH 09/19] test-bdrv-drain: Add test for node deletion,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 07/19] block: Really pause block jobs on drain, Kevin Wolf, 2018/04/11
- Re: [Qemu-devel] [PATCH 07/19] block: Really pause block jobs on drain, Paolo Bonzini, 2018/04/12
- Re: [Qemu-devel] [PATCH 07/19] block: Really pause block jobs on drain, Kevin Wolf, 2018/04/12
- Re: [Qemu-devel] [PATCH 07/19] block: Really pause block jobs on drain, Paolo Bonzini, 2018/04/12
- Re: [Qemu-devel] [PATCH 07/19] block: Really pause block jobs on drain, Kevin Wolf, 2018/04/12
- Re: [Qemu-devel] [PATCH 07/19] block: Really pause block jobs on drain, Paolo Bonzini, 2018/04/12
- Re: [Qemu-devel] [PATCH 07/19] block: Really pause block jobs on drain, Kevin Wolf, 2018/04/12
- Re: [Qemu-devel] [PATCH 07/19] block: Really pause block jobs on drain, Paolo Bonzini, 2018/04/12
- Re: [Qemu-devel] [PATCH 07/19] block: Really pause block jobs on drain, Kevin Wolf, 2018/04/12
- Re: [Qemu-devel] [PATCH 07/19] block: Really pause block jobs on drain, Paolo Bonzini, 2018/04/12