From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFilo-0005h0-Tt for qemu-devel@nongnu.org; Wed, 13 Mar 2013 06:18:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFilg-0003Xz-Jm for qemu-devel@nongnu.org; Wed, 13 Mar 2013 06:18:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16468) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFilg-0003Xs-CG for qemu-devel@nongnu.org; Wed, 13 Mar 2013 06:18:44 -0400 Date: Wed, 13 Mar 2013 11:18:38 +0100 From: Kevin Wolf Message-ID: <20130313101838.GD2309@dhcp-200-207.str.redhat.com> References: <1357543689-11415-9-git-send-email-xiawenc@linux.vnet.ibm.com> <20130109124433.GA391@stefanha-thinkpad.redhat.com> <50EE33B2.4040504@linux.vnet.ibm.com> <20130110124109.GD30946@stefanha-thinkpad.redhat.com> <50EFAFA4.1030705@linux.vnet.ibm.com> <20130111091253.GA31400@stefanha-thinkpad.muc.redhat.com> <50F373DE.4060709@linux.vnet.ibm.com> <20130114100604.GH11260@stefanha-thinkpad.redhat.com> <50F4FF3C.9000706@linux.vnet.ibm.com> <513EE7B1.6060501@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <513EE7B1.6060501@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH V2 07/10] snapshot: qmp use new internal API for external snapshot transaction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: aliguori@us.ibm.com, quintela@redhat.com, Stefan Hajnoczi , qemu-devel@nongnu.org, lcapitulino@redhat.com, pbonzini@redhat.com, dietmar@proxmox.com Am 12.03.2013 um 09:30 hat Wenchao Xia geschrieben: > I redesigned the structure, Following is the fake code: > > typedef struct BdrvActionOps { > /* check the request's validation, allocate p_opaque if needed */ > int (*check)(BlockdevAction *action, void **p_opaque, Error **errp); > /* take the action */ > int (*submit)(BlockdevAction *action, void *opaque, Error **errp); > /* update emulator */ > int (*commit)(BlockdevAction *action, void *opaque, Error **errp); > /* cancel the action */ > int (*rollback)(BlockdevAction *action, void *opaque, Error **errp); > } BdrvActionOps; Why do you need the split of prepare into check/submit? If you have prepare/commit/abort, everybody will recognise this as the standard transaction pattern because this is just how it's done. Deviating from it needs a good justification in my opinion. Kevin