[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2 04/17] qmp: Add block-dirty-bitmap-add and bl
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-block] [PATCH v2 04/17] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove |
Date: |
Wed, 11 Mar 2015 13:58:06 +0000 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Mon, Mar 02, 2015 at 06:19:50PM -0500, John Snow wrote:
> +static BdrvDirtyBitmap *block_dirty_bitmap_lookup(const char *node,
> + const char *name,
> + BlockDriverState **pbs,
> + Error **errp)
> +{
> + BlockDriverState *bs;
> + BdrvDirtyBitmap *bitmap;
> +
> + if (!node) {
> + error_setg(errp, "Node cannot be NULL");
> + return NULL;
> + }
> + if (!name) {
> + error_setg(errp, "Bitmap name cannot be NULL");
> + return NULL;
> + }
> +
> + bs = bdrv_lookup_bs(node, node, NULL);
> + if (!bs) {
> + error_setg(errp, "Node '%s' not found", node);
> + return NULL;
> + }
> +
> + /* If caller provided a BDS*, provide the result of that lookup, too. */
> + if (pbs) {
> + *pbs = bs;
> + }
> +
> + bitmap = bdrv_find_dirty_bitmap(bs, name);
AioContext is not held here. I'm worried that a block job (running
under the AioContext) could change or delete the bitmap at the same time
as this function is running.
This function should acquire the AioContext before calling
bdrv_find_dirty_bitmap() and fill out an AioContext** parameter so the
caller can continue to use bs/bitmap under the lock.
pgpHa1HNC5HkQ.pgp
Description: PGP signature
- [Qemu-block] [PATCH v2 00/17] block: transactionless incremental backup series, John Snow, 2015/03/02
- [Qemu-block] [PATCH v2 03/17] qmp: Ensure consistent granularity type, John Snow, 2015/03/02
- [Qemu-block] [PATCH v2 06/17] hbitmap: add hbitmap_merge, John Snow, 2015/03/02
- [Qemu-block] [PATCH v2 04/17] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove, John Snow, 2015/03/02
- Re: [Qemu-block] [PATCH v2 04/17] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove,
Stefan Hajnoczi <=
- [Qemu-block] [PATCH v2 01/17] docs: incremental backup documentation, John Snow, 2015/03/02
- [Qemu-block] [PATCH v2 02/17] qapi: Add optional field "name" to block dirty bitmap, John Snow, 2015/03/02
- [Qemu-block] [PATCH v2 07/17] block: Add bitmap disabled status, John Snow, 2015/03/02
- [Qemu-block] [PATCH v2 05/17] block: Introduce bdrv_dirty_bitmap_granularity(), John Snow, 2015/03/02