qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v4 08/11] qmp: Add an implementation wrapper for


From: Stefan Hajnoczi
Subject: Re: [Qemu-block] [PATCH v4 08/11] qmp: Add an implementation wrapper for qmp_drive_backup
Date: Mon, 18 May 2015 15:42:07 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

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: pgpqxMcOW5Bk_.pgp
Description: PGP signature


reply via email to

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