On 02/12/2014 12:46 PM, Jeff Cody wrote:
> When starting a block job, commit_active_start() relies on whether *errp
> is set by mirror_start_job.  This allows it to determine if the mirror
> job start failed, so that it can clean up any changes to open flags from
> the bdrv_reopen().  If errp is NULL, then it will not be able to
> determine if mirror_start_job failed or not.
> 
> Reported-by: Markus Armbruster <[email protected]>
> Signed-off-by: Jeff Cody <[email protected]>
> ---
>  block/mirror.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/block/mirror.c b/block/mirror.c
> index 2a43334..41bb83c 100644
> --- a/block/mirror.c
> +++ b/block/mirror.c
> @@ -634,6 +634,8 @@ void commit_active_start(BlockDriverState *bs, 
> BlockDriverState *base,
>      int64_t length, base_length;
>      int orig_base_flags;
>  
> +    assert(errp != NULL);
> +

assert(errp); is shorter, but I don't know if we have a preference for
implicit conversion of pointers to bool context.

Reviewed-by: Eric Blake <[email protected]>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to