Re: [Qemu-devel] [PATCH 04/11] snapshot: new function bdrv_snapshot_find_by_id_and_name()

2013-06-12 Thread Wenchao Xia
于 2013-6-11 16:26, Stefan Hajnoczi 写道: On Sat, Jun 08, 2013 at 02:58:00PM +0800, Wenchao Xia wrote: +if (id && name) { +for (i = 0; i < nb_sns; i++) { +sn = &sn_tab[i]; +if (!strcmp(sn->id_str, id) && !strcmp(sn->name, name)) { +*sn_info = *sn;

Re: [Qemu-devel] [PATCH 04/11] snapshot: new function bdrv_snapshot_find_by_id_and_name()

2013-06-11 Thread Stefan Hajnoczi
On Sat, Jun 08, 2013 at 02:58:00PM +0800, Wenchao Xia wrote: > +if (id && name) { > +for (i = 0; i < nb_sns; i++) { > +sn = &sn_tab[i]; > +if (!strcmp(sn->id_str, id) && !strcmp(sn->name, name)) { > +*sn_info = *sn; > +ret = true;

Re: [Qemu-devel] [PATCH 04/11] snapshot: new function bdrv_snapshot_find_by_id_and_name()

2013-06-08 Thread Wenchao Xia
于 2013-6-8 16:35, Fam Zheng 写道: On Sat, 06/08 15:58, Wenchao Xia wrote: 于 2013-6-8 15:31, Fam Zheng 写道: On Sat, 06/08 14:58, Wenchao Xia wrote: To make it clear about id and name in searching, add this API to distinguish them. Caller can choose to search by id or name, *errp will be set only f

Re: [Qemu-devel] [PATCH 04/11] snapshot: new function bdrv_snapshot_find_by_id_and_name()

2013-06-08 Thread Fam Zheng
On Sat, 06/08 15:58, Wenchao Xia wrote: > 于 2013-6-8 15:31, Fam Zheng 写道: > >On Sat, 06/08 14:58, Wenchao Xia wrote: > >>To make it clear about id and name in searching, add this API > >>to distinguish them. Caller can choose to search by id or name, > >>*errp will be set only for exception. > >> >

Re: [Qemu-devel] [PATCH 04/11] snapshot: new function bdrv_snapshot_find_by_id_and_name()

2013-06-08 Thread Wenchao Xia
于 2013-6-8 15:31, Fam Zheng 写道: On Sat, 06/08 14:58, Wenchao Xia wrote: To make it clear about id and name in searching, add this API to distinguish them. Caller can choose to search by id or name, *errp will be set only for exception. Some code are modified based on Pavel's patch. Signed-off-

Re: [Qemu-devel] [PATCH 04/11] snapshot: new function bdrv_snapshot_find_by_id_and_name()

2013-06-08 Thread Fam Zheng
On Sat, 06/08 14:58, Wenchao Xia wrote: > To make it clear about id and name in searching, add this API > to distinguish them. Caller can choose to search by id or name, > *errp will be set only for exception. > > Some code are modified based on Pavel's patch. > > Signed-off-by: Wenchao Xia > Si