Re: [Qemu-devel] [PATCH 2/3] block: adjust qmp_transaction to be extendable

2013-04-17 Thread Stefan Hajnoczi
On Thu, Apr 18, 2013 at 5:00 AM, Wenchao Xia wrote: > 于 2013-4-17 22:42, Stefan Hajnoczi 写道: > >> On Mon, Apr 01, 2013 at 06:01:30PM +0800, Wenchao Xia wrote: >>> >>> /* New and old BlockDriverState structs for group snapshots */ >>> -typedef struct BlkTransactionStates { >>> +typedef struct Bdr

Re: [Qemu-devel] [PATCH 2/3] block: adjust qmp_transaction to be extendable

2013-04-17 Thread Wenchao Xia
于 2013-4-17 22:42, Stefan Hajnoczi 写道: On Mon, Apr 01, 2013 at 06:01:30PM +0800, Wenchao Xia wrote: /* New and old BlockDriverState structs for group snapshots */ -typedef struct BlkTransactionStates { +typedef struct BdrvActionOps { +int (*commit)(BlockdevAction *action, void **p_opaque,

Re: [Qemu-devel] [PATCH 2/3] block: adjust qmp_transaction to be extendable

2013-04-17 Thread Stefan Hajnoczi
On Mon, Apr 01, 2013 at 06:01:30PM +0800, Wenchao Xia wrote: > /* New and old BlockDriverState structs for group snapshots */ > -typedef struct BlkTransactionStates { > +typedef struct BdrvActionOps { > +int (*commit)(BlockdevAction *action, void **p_opaque, Error **errp); > +void (*rollba

Re: [Qemu-devel] [PATCH 2/3] block: adjust qmp_transaction to be extendable

2013-04-03 Thread Wenchao Xia
于 2013-4-3 17:02, Wenchao Xia 写道: No, if bdrv_snapshot_delete() can fail, you need to split it in two parts: one that can fail, and one that cannot. If you cannot, then there are two possibilities: - if the failures are minor and could be repaired with "qemu-img check -r" (e.g. lost clusters),

Re: [Qemu-devel] [PATCH 2/3] block: adjust qmp_transaction to be extendable

2013-04-03 Thread Kevin Wolf
Am 03.04.2013 um 11:02 hat Wenchao Xia geschrieben: > > > >No, if bdrv_snapshot_delete() can fail, you need to split it in two > >parts: one that can fail, and one that cannot. If you cannot, then > >there are two possibilities: > > > >- if the failures are minor and could be repaired with "qemu-i

Re: [Qemu-devel] [PATCH 2/3] block: adjust qmp_transaction to be extendable

2013-04-03 Thread Paolo Bonzini
Il 03/04/2013 11:02, Wenchao Xia ha scritto: >> > Sorry I haven't state it clearly. What about bdrv_snapshot_create() > operation? If it need to be rolled back, I think bdrv_snapshot_delete() > will get called and it may fail. But in most case if > bdrv_snapshot_create() succeed before, the bdrv_

Re: [Qemu-devel] [PATCH 2/3] block: adjust qmp_transaction to be extendable

2013-04-03 Thread Wenchao Xia
No, if bdrv_snapshot_delete() can fail, you need to split it in two parts: one that can fail, and one that cannot. If you cannot, then there are two possibilities: - if the failures are minor and could be repaired with "qemu-img check -r" (e.g. lost clusters), then this is not optimal but can s

Re: [Qemu-devel] [PATCH 2/3] block: adjust qmp_transaction to be extendable

2013-04-03 Thread Paolo Bonzini
- Messaggio originale - > Da: "Wenchao Xia" > A: "Kevin Wolf" > Cc: pbonz...@redhat.com, qemu-devel@nongnu.org, diet...@proxmox.com, > stefa...@gmail.com > Inviato: Mercoledì, 3 aprile 2013 7:51:43 > Oggetto: Re: [Qemu-devel] [PATCH 2/

Re: [Qemu-devel] [PATCH 2/3] block: adjust qmp_transaction to be extendable

2013-04-02 Thread Wenchao Xia
于 2013-4-2 21:55, Kevin Wolf 写道: Am 01.04.2013 um 12:01 hat Wenchao Xia geschrieben: Now code for external snapshot are packaged as one case in qmp_transaction, so later other operation could be added. The logic in qmp_transaction is changed a bit: Original code tries to create all images

Re: [Qemu-devel] [PATCH 2/3] block: adjust qmp_transaction to be extendable

2013-04-02 Thread Kevin Wolf
Am 01.04.2013 um 12:01 hat Wenchao Xia geschrieben: > Now code for external snapshot are packaged as one case > in qmp_transaction, so later other operation could be added. > The logic in qmp_transaction is changed a bit: Original code > tries to create all images first and then update all *bdr