2010/11/9 Daniel Veillard <veillard@xxxxxxxxxx>: > On Sun, Nov 07, 2010 at 01:40:42PM +0100, Matthias Bolte wrote: >> Also add a test case for the VMX handling of it. > [...] >> + Â Âif (esxVI_LookupVirtualMachineByUuidAndPrepareForTask >> + Â Â Â Â Â(priv->primary, domain->uuid, NULL, &virtualMachine, >> + Â Â Â Â Â priv->autoAnswer) < 0 || > [...] >> + Â Âif (esxVI_String_AppendValueToList >> + Â Â Â Â Â(&propertyNameList, "config.memoryAllocation.reservation") < 0 || >> + Â Â Â ÂesxVI_LookupVirtualMachineByUuid(priv->primary, domain->uuid, > > ÂSmall nitpick to prove I read the patch :-) > It seems your editor tend to cut lines in different way if within > a condition than if within a normal expression, I would have put > Â Â Â(&propertyNameList, > on the same line as the if ( ... Well, if the parameter list cannot be split at a ',' because the parameters would still be too long then I put the opening '(' at the next line, two spaces indented relative to the function name. This is independent from the context of the function call. No inconsistency here IMHO :) > [...] >> +int >> +esxVI_GetLong(esxVI_ObjectContent *objectContent, const char *propertyName, >> + Â Â Â Â Â Â ÂesxVI_Long **value, esxVI_Occurrence occurence) >> +{ >> + Â ÂesxVI_DynamicProperty *dynamicProperty; >> + >> + Â Âif (value == NULL || *value != NULL) { >> + Â Â Â ÂESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument")); >> + Â Â Â Âreturn -1; >> + Â Â} >> + >> + Â Âfor (dynamicProperty = objectContent->propSet; dynamicProperty != NULL; >> + Â Â Â Â dynamicProperty = dynamicProperty->_next) { >> + Â Â Â Âif (STREQ(dynamicProperty->name, propertyName)) { >> + Â Â Â Â Â Âif (esxVI_Long_CastFromAnyType(dynamicProperty->val, value) < 0) { > > ÂHum is esxVI_Long_CastFromAnyType raising an error if failing, because > we don't rais an error in the caller if esxVI_GetLong() fails. Yes, basically all functions in the ESX driver raise errors themselves. esxVI_Long_CastFromAnyType is no exception here, it's just no visible in the patch :) The only exceptions are esxUtil_UnescapeHex and esxUtil_ParseVirtualMachineIDString. esxUtil_UnescapeHex doesn't do it because the caller can report a better error message (with more context) and esxUtil_ParseVirtualMachineIDString has no reason to do so... and I'll change that. Thanks for asking :) > > ACK, > > Daniel Thanks, pushed. Matthias -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list