[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2] libxl: introduce LIBXL_DOMAIN_TYPE_INVALID
On Thu, 2012-05-24 at 12:26 +0100, Roger Pau Monne wrote: > Thanks for the patch I've tried it and works ok, so the below comment is > just a suggestion about error handling. > Cool. :-) > > Signed-off-by: Dario Faggioli<dario.faggioli@xxxxxxxxxx> > > Signed-off-by: Christoph Egger<Christoph.Egger@xxxxxxx> > > --- a/tools/libxl/libxl_dm.c > > +++ b/tools/libxl/libxl_dm.c > > @@ -257,6 +257,8 @@ static char ** libxl__build_device_model > > for (i = 0; b_info->extra_hvm&& b_info->extra_hvm[i] != NULL; > > i++) > > flexarray_append(dm_args, b_info->extra_hvm[i]); > > break; > > + case LIBXL_DOMAIN_TYPE_INVALID: > > + break; > > } > > flexarray_append(dm_args, NULL); > > return (char **) flexarray_contents(dm_args); > > @@ -505,6 +507,8 @@ static char ** libxl__build_device_model > > for (i = 0; b_info->extra_hvm&& b_info->extra_hvm[i] != NULL; > > i++) > > flexarray_append(dm_args, b_info->extra_hvm[i]); > > break; > > + case LIBXL_DOMAIN_TYPE_INVALID: > > + break; > > } > > I think we should use "default" here (and on the previous one), print an > error message, and probably return NULL. I guess we are going to get an > error at some point later, so I think it's better to catch it here. > I agree and, as it was the first time I saw that file/code, so I totally you on this! :-P Will repost right now. Thanks, Dario -- <<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) Attachment:
signature.asc _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |