On Mon, May 11, 2015 at 07:04:23PM -0400, John Snow wrote:
> @@ -2900,9 +2917,16 @@ void qmp_drive_backup(const char *device, const char 
> *target,
>          }
>      }
>  
> +    /* If we are not supplied with callback override info, use our defaults 
> */
> +    if (cb == NULL) {
> +        cb = block_job_cb;
> +    }
> +    if (opaque == NULL) {
> +        opaque = bs;
> +    }

Why assign opaque separately, it raises the question what happens if a
custom cb is given but the caller really wants opaque to be NULL?

The following might be clearer:

if (cb == NULL) {
    cb = block_job_cb;
    opaque = bs;
}

Attachment: pgpxThpJzYzdD.pgp
Description: PGP signature

Reply via email to