From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuMgg-0000Ud-5q for qemu-devel@nongnu.org; Mon, 18 May 2015 11:10:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuMge-0007s0-N8 for qemu-devel@nongnu.org; Mon, 18 May 2015 11:10:37 -0400 Message-ID: <555A00E6.6030808@redhat.com> Date: Mon, 18 May 2015 11:10:30 -0400 From: John Snow MIME-Version: 1.0 References: <1431385466-4868-1-git-send-email-jsnow@redhat.com> <1431385466-4868-9-git-send-email-jsnow@redhat.com> <20150518144207.GK24319@stefanha-thinkpad.redhat.com> In-Reply-To: <20150518144207.GK24319@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v4 08/11] qmp: Add an implementation wrapper for qmp_drive_backup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: famz@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, mreitz@redhat.com, vsementsov@parallels.com, stefanha@redhat.com 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.