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 ( ...
[...]
+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.
ACK,
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit
http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine
http://rpmfind.net/
http://veillard.com/ | virtualization library
http://libvirt.org/