<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:'times new roman', 'new york', times, serif;font-size:12pt"><div>I've defined (among others):</div><div>int esxVI_PhysicalNic_CastListFromAnyType(virConnectPtr conn, esxVI_AnyType *anyType, esxVI_PhysicalNic **pNicList);</div><div>but runing it returns somthing like:</div><div>Expecting type 'PhysicalNic' but found 'ArrayOfPhysicalNic'</div><div><br></div><div>Does it mean I should also implement:</div><div><span class="Apple-style-span" style="font-family: arial; font-size: 13px; ">esxVI_ArrayOfPhysicalNic_CastListFromAnyType()</span></div><div><font class="Apple-style-span" face="arial" size="3"><span class="Apple-style-span" style="font-size: 13px;"><br></span></font></div><div><font class="Apple-style-span" face="arial" size="3"><span class="Apple-style-span" style="font-size: 13px;">and all the funcs/type definition coming with
 it?</span></font></div><div><font class="Apple-style-span" face="arial" size="3"><span class="Apple-style-span" style="font-size: 13px;"><br></span></font></div><div><font class="Apple-style-span" face="arial" size="3"><span class="Apple-style-span" style="font-size: 13px;">thanks</span></font></div><div><font class="Apple-style-span" face="arial" size="3"><span class="Apple-style-span" style="font-size: 13px;">Shahar</span></font></div><div><font class="Apple-style-span" face="arial" size="3"><span class="Apple-style-span" style="font-size: 13px;"><br></span></font></div><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family:arial, helvetica, sans-serif;font-size:13px"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Matthias Bolte <matthias.bolte@googlemail.com><br><b><span style="font-weight: bold;">To:</span></b> Shahar Klein
 <shaharklein@yahoo.com><br><b><span style="font-weight: bold;">Cc:</span></b> libvir-list@redhat.com<br><b><span style="font-weight: bold;">Sent:</span></b> Thursday, September 10, 2009 6:24:25 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [libvirt] Interface driver and ESX support<br></font><br>2009/9/10 Shahar Klein <<a ymailto="mailto:shaharklein@yahoo.com" href="mailto:shaharklein@yahoo.com">shaharklein@yahoo.com</a>>:<br>> I'm not sure what you mean about mapping<br>> lets take the pnics as a study case for me<br>> do I need to define a structure similar to this:<br>> <a href="http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.host.PhysicalNic.html" target="_blank">http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.host.PhysicalNic.html</a><br>> and also take care for it's allocation?<br>><br><br>Yes, you need to implement the mapping (a better
 word may be<br>'binding') of this VI API type to a C type, that also includes to care<br>about its allocation. You'll need to implement at least this set of<br>function in esx_vi_types.[ch]:<br><br>esxVI_PhysicalNic_Alloc()<br>esxVI_PhysicalNic_Free()<br>esxVI_PhysicalNic_CastFromAnyType()<br>esxVI_PhysicalNic_CastListFromAnyType()<br>esxVI_PhysicalNic_Deserialize()<br>esxVI_PhysicalNic_DeserializeList()<br><br>You could use the binding for the HostCpuIdInfo type, but<br>unfortunately I haven't published the code for it yet. This code also<br>includes some essential helper functions for<br>esxVI_PhysicalNic_CastListFromAnyType().<br><br>Beside the PhysicalNic type, you may also have to bind the types of<br>its members like PhysicalNicLinkInfo, PhysicalNicSpec and<br>HostIpConfig, if you need or care about the information provided by<br>them.<br><br>The binding for HostCpuIdInfo is part of a larger set of patches that<br>add some new features to ESX
 driver, but the patches needs some<br>cleanup first. I may have some time later this evening to clean them<br>up and post them.<br><br>PS: You should refer to version 2.5 of the VI API [1] and not 4.0,<br>because the complete VI API mapping is currently based on version 2.5.<br>At some point I'll have to properly distinguish between version 2.5<br>and 4.0, but currently I would like to stick to version 2.5 only.<br><br>[1] <a href="http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/" target="_blank">http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/</a><br><br>Matthias<br></div></div><div style="position:fixed"></div></div><br>

      </body></html>