[sheepdog] [PATCH] sheep: split create_vdi_obj() into 4 functions
Liu Yuan
namei.unix at gmail.com
Thu Aug 22 11:26:49 CEST 2013
On Thu, Aug 22, 2013 at 06:21:17PM +0900, MORITA Kazutaka wrote:
> At Thu, 22 Aug 2013 16:57:30 +0800,
> Liu Yuan wrote:
> >
> > sd_{vdi,snapshot}_create share almost the same logic, how about merge them
> > into one function? Either ask sd_{vdi,snapshot}_create call the shared helper
> > or use single sd_vdi_create() function
>
> I don't think they share so much the same logic. Both call
> vdi_lookup() but how to handle the return value is different. Both
> calls notify_vdi_add() but it should be moved to cluster_new_vdi()
> because we should call it only after we successfully created the vdi
> (I think of doing this change in the next version).
>
Okay, so can we name it as vdi_create and vdi_snapshot_create? Use sd_ prefix
doesn't help clarify the functions which .c file they reside.
Thanks
Yuan
More information about the sheepdog
mailing list