qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Qemu-block] [PATCH v4 08/11] qmp: Add an implementatio


From: John Snow
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v4 08/11] qmp: Add an implementation wrapper for qmp_drive_backup
Date: Mon, 18 May 2015 11:10:30 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0


On 05/18/2015 10:42 AM, Stefan Hajnoczi wrote:
> 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; }
> 

It just wasn't a consideration when I was writing it, since the
transaction system won't ever want to pass NULL here.

It's easy enough to fix, though.



reply via email to

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