Re: [Qemu-devel] [PATCH v5 2/3] qmp event: Refactor QUORUM_REPORT_BAD

2016-02-24 Thread Changlong Xie
On 02/24/2016 08:35 PM, Alberto Garcia wrote: On Wed 24 Feb 2016 11:11:54 AM CET, Changlong Xie wrote: -static void quorum_report_bad(QuorumAIOCB *acb, char *node_name, int ret) +static void quorum_report_bad(QuorumOpType type, QuorumAIOCB *acb, + char *node_name, in

Re: [Qemu-devel] [PATCH v5 2/3] qmp event: Refactor QUORUM_REPORT_BAD

2016-02-24 Thread Changlong Xie
On 02/25/2016 09:12 AM, Eric Blake wrote: On 02/24/2016 05:50 PM, Wen Congyang wrote: +- "type": Quorum operation type (json-string, optional) I don't think 'type' needs to be optional, after all. Just always output it. If we output read/write type, old libvirt will ignore the rea

Re: [Qemu-devel] [PATCH v5 2/3] qmp event: Refactor QUORUM_REPORT_BAD

2016-02-24 Thread Eric Blake
On 02/24/2016 05:50 PM, Wen Congyang wrote: >>> +- "type": Quorum operation type (json-string, optional) >> >> I don't think 'type' needs to be optional, after all. Just always >> output it. > > If we output read/write type, old libvirt will ignore the read/write error > events? The Q

Re: [Qemu-devel] [PATCH v5 2/3] qmp event: Refactor QUORUM_REPORT_BAD

2016-02-24 Thread Wen Congyang
On 02/25/2016 12:59 AM, Eric Blake wrote: > On 02/24/2016 03:11 AM, Changlong Xie wrote: >> Introduce QuorumOpType, and make QUORUM_REPORT_BAD compatible >> with it. >> >> Cc: Dr. David Alan Gilbert >> Cc: Wen Congyang >> Signed-off-by: Wen Congyang >> Signed-off-by: Changlong Xie >> --- > >>

Re: [Qemu-devel] [PATCH v5 2/3] qmp event: Refactor QUORUM_REPORT_BAD

2016-02-24 Thread Eric Blake
On 02/24/2016 03:11 AM, Changlong Xie wrote: > Introduce QuorumOpType, and make QUORUM_REPORT_BAD compatible > with it. > > Cc: Dr. David Alan Gilbert > Cc: Wen Congyang > Signed-off-by: Wen Congyang > Signed-off-by: Changlong Xie > --- > +++ b/docs/qmp-events.txt > @@ -307,6 +307,7 @@ Emitte

Re: [Qemu-devel] [PATCH v5 2/3] qmp event: Refactor QUORUM_REPORT_BAD

2016-02-24 Thread Eric Blake
On 02/24/2016 05:35 AM, Alberto Garcia wrote: >> +switch (type) { >> +case QUORUM_OP_TYPE_READ: >> +case QUORUM_OP_TYPE_WRITE: >> +qapi_event_send_quorum_report_bad(false, 0, !!msg, msg, node_name, >> + acb->sector_num, acb->nb_sectors,

Re: [Qemu-devel] [PATCH v5 2/3] qmp event: Refactor QUORUM_REPORT_BAD

2016-02-24 Thread Alberto Garcia
On Wed 24 Feb 2016 11:11:54 AM CET, Changlong Xie wrote: > -static void quorum_report_bad(QuorumAIOCB *acb, char *node_name, int ret) > +static void quorum_report_bad(QuorumOpType type, QuorumAIOCB *acb, > + char *node_name, int ret) > { > const char *msg = NULL;

[Qemu-devel] [PATCH v5 2/3] qmp event: Refactor QUORUM_REPORT_BAD

2016-02-24 Thread Changlong Xie
Introduce QuorumOpType, and make QUORUM_REPORT_BAD compatible with it. Cc: Dr. David Alan Gilbert Cc: Wen Congyang Signed-off-by: Wen Congyang Signed-off-by: Changlong Xie --- block/quorum.c | 28 +++- docs/qmp-events.txt | 8 qapi/block.json | 16 ++