qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 09/11] block: drive_backup transaction callba


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v4 09/11] block: drive_backup transaction callback support
Date: Mon, 18 May 2015 16:35:39 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, May 11, 2015 at 07:04:24PM -0400, John Snow wrote:
> +static void drive_backup_cb(BlkActionState *common)
> +{
> +    BlkActionCallbackData *cb_data = common->cb_data;
> +    BlockDriverState *bs = cb_data->opaque;
> +    DriveBackupState *state = DO_UPCAST(DriveBackupState, common, common);
> +
> +    assert(state->bs == bs);
> +    if (bs->job) {
> +        assert(state->job == bs->job);
> +    }

What is the purpose of the if statement?

Why is it not okay for a new job to have started?

> +
> +    state->aio_context = bdrv_get_aio_context(bs);
> +    aio_context_acquire(state->aio_context);

The bs->job access above should be protected by aio_context_acquire().

Attachment: pgp2Q3VQrNTHO.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]