qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5 08/11] blockdev: allow BdrvActionOps->commit(


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v5 08/11] blockdev: allow BdrvActionOps->commit() to be NULL
Date: Mon, 3 Jun 2013 11:16:15 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, May 30, 2013 at 04:57:21PM -0600, Eric Blake wrote:
> On 05/30/2013 06:34 AM, Stefan Hajnoczi wrote:
> > Some QMP 'transaction' types don't need to do anything on .commit().
> > Make .commit() optional just like .abort().
> > 
> > The "drive-backup" action will take advantage of this, it only needs to
> > cancel the block job on .abort().  Other block job actions will probably
> > follow the same pattern, so allow .commit() to be NULL.
> > 
> > Suggested-by: Eric Blake <address@hidden>
> > Signed-off-by: Stefan Hajnoczi <address@hidden>
> > ---
> >  blockdev.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> Reviewed-by: Eric Blake <address@hidden>
> 
> Is it worth enforcing that at least one of commit or abort is supplied
> (that is, assert if the user codes up an action that has neither
> callback)?  Or is that just overkill?

I left it out because it seems like overkill.  The action types are
small in number, statically defined in an array, and we test both the
commit and abort code paths.  So there's no convenience place to put a
compile-time check and developers would stumble across their mistake
when running their tests.

Stefan



reply via email to

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