Re: [Qemu-devel] [PATCH v10 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-09 Thread Max Reitz
On 08.03.2016 03:57, Changlong Xie wrote: > On 03/08/2016 12:02 AM, Max Reitz wrote: >> On 07.03.2016 17:02, Eric Blake wrote: >>> On 03/05/2016 11:13 AM, Max Reitz wrote: >>> > +index = atoi(child->name + 9); Optional: Assert absence of an error: >>> >>> Indeed, atoi() is wo

Re: [Qemu-devel] [PATCH v10 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-07 Thread Changlong Xie
On 03/08/2016 12:02 AM, Max Reitz wrote: On 07.03.2016 17:02, Eric Blake wrote: On 03/05/2016 11:13 AM, Max Reitz wrote: +index = atoi(child->name + 9); Optional: Assert absence of an error: Indeed, atoi() is worthless, because it cannot do error detection. unsigned long index; char

Re: [Qemu-devel] [PATCH v10 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-07 Thread Changlong Xie
On 03/08/2016 12:02 AM, Eric Blake wrote: On 03/05/2016 11:13 AM, Max Reitz wrote: +index = atoi(child->name + 9); Optional: Assert absence of an error: Indeed, atoi() is worthless, because it cannot do error detection. unsigned long index; char *endptr; index = strtoul(child->name

Re: [Qemu-devel] [PATCH v10 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-07 Thread Max Reitz
On 07.03.2016 17:02, Eric Blake wrote: > On 03/05/2016 11:13 AM, Max Reitz wrote: > >>> +index = atoi(child->name + 9); >> >> Optional: Assert absence of an error: >> > > Indeed, atoi() is worthless, because it cannot do error detection. > >> unsigned long index; >> char *endptr; >> >> index

Re: [Qemu-devel] [PATCH v10 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-07 Thread Eric Blake
On 03/05/2016 11:13 AM, Max Reitz wrote: >> +index = atoi(child->name + 9); > > Optional: Assert absence of an error: > Indeed, atoi() is worthless, because it cannot do error detection. > unsigned long index; > char *endptr; > > index = strtoul(child->name + 9, &endptr, 10); > assert(ind

Re: [Qemu-devel] [PATCH v10 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-07 Thread Changlong Xie
On 03/06/2016 02:13 AM, Max Reitz wrote: On 16.02.2016 10:37, Changlong Xie wrote: From: Wen Congyang Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei Signed-off-by: Changlong Xie --- block.c | 8 ++-- block/quorum.c| 122 ++

Re: [Qemu-devel] [PATCH v10 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-05 Thread Max Reitz
On 16.02.2016 10:37, Changlong Xie wrote: > From: Wen Congyang > > Signed-off-by: Wen Congyang > Signed-off-by: zhanghailiang > Signed-off-by: Gonglei > Signed-off-by: Changlong Xie > --- > block.c | 8 ++-- > block/quorum.c| 122 > +++

[Qemu-devel] [PATCH v10 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-02-16 Thread Changlong Xie
From: Wen Congyang Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei Signed-off-by: Changlong Xie --- block.c | 8 ++-- block/quorum.c| 122 +- include/block/block.h | 4 ++ 3 files change