From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v2] libxl: introduce LIBXL_DOMAIN_TYPE_INVALID Date: Thu, 24 May 2012 14:51:21 +0200 Message-ID: <1337863881.13601.27.camel@Solace> References: <4FBE1AEE.8000003@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3278559395621535417==" Return-path: In-Reply-To: <4FBE1AEE.8000003@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: Christoph Egger , Ian Jackson , Ian Campbell , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============3278559395621535417== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-k6v92rS9QdiOZBmLBiXZ" --=-k6v92rS9QdiOZBmLBiXZ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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= =20 > just a suggestion about error handling. >=20 Cool. :-) > > Signed-off-by: Dario Faggioli > > Signed-off-by: Christoph Egger > > --- a/tools/libxl/libxl_dm.c > > +++ b/tools/libxl/libxl_dm.c > > @@ -257,6 +257,8 @@ static char ** libxl__build_device_model > > for (i =3D 0; b_info->extra_hvm&& b_info->extra_hvm[i] !=3D = 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 =3D 0; b_info->extra_hvm&& b_info->extra_hvm[i] !=3D = NULL; i++) > > flexarray_append(dm_args, b_info->extra_hvm[i]); > > break; > > + case LIBXL_DOMAIN_TYPE_INVALID: > > + break; > > } >=20 > I think we should use "default" here (and on the previous one), print an= =20 > error message, and probably return NULL. I guess we are going to get an= =20 > 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 --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-k6v92rS9QdiOZBmLBiXZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEABECAAYFAk++LsoACgkQk4XaBE3IOsTJvwCdEWW2pWEPRMRwJkvt807PqRYv ZZUAn3z39eeAOktUoAWbl0Hf81KX3XwR =ZCRA -----END PGP SIGNATURE----- --=-k6v92rS9QdiOZBmLBiXZ-- --===============3278559395621535417== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============3278559395621535417==--