Matthias,<div>Thanks for the terrific feedback. In answer to your questions:</div><div><br></div><div>>Is this sufficient to make virsh net-list work?</div><div>Yes, virsh net-list and also virsh net-info. I also checked both functions against freshly compiled ruby bindings. I also checked the sufficient error is given in virsh net-list when an invalid network is given.</div>
<div><br></div><div>>You mean the managed object called Network? They _seem_ to be the<br>>natural fit. But I'm not sure if that's the correct approach, as you<br>>cannot directly create/destroy such objects and they are bound in some<br>
>way to the port groups on a virtual switch. Also I'm not sure about<br>>he exact semantics of networks and port groups.<br><br>Yes, I used the managed object called Network. It does get a little dicey with VMware due to the addition of port groups and virtual switches (admittedly, not sure how this works in most other hypervisors). You certainly can't have transient network objects, and any creation/destruction of a network object seems like it must necessarily involve either creation/destruction of a port group or creation/destruction of a vswitch. I believe using the Network managed object is the right approach, but am not yet 100% confident. My next task is to facilitate the creation of a new network through virNetworkDefineXML or virNetworkCreateXML. If you'd prefer, I can wait until I've completed this functionality to submit the patch, as it may drive me to adopt a different approach.</div>
<div><br></div><div>>I assume you made esxNumOfDefinedNetworks return 0 to get virsh<br>>net-list working as there network in the VMware context are always<br>>active.</div><div><br></div><div>Correct. I was debating on whether or not to have it loop through the network list and check the "active/inactive" just for thoroughness, but if you're fine with just returning 0 and commenting why, then I'll leave it.</div>
<div><br></div><div>>The recommended way for sending patches is git send-email.</div><div><br></div><div>Barring any other recommendations I'll figure out git send email and submit the patch to the list shortly.</div>
<div><br></div><div>thanks,</div><div><br></div><div>-jb</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div><br></div><div><div class="gmail_quote">On Wed, Apr 6, 2011 at 2:37 AM, Matthias Bolte <span dir="ltr"><<a href="mailto:matthias.bolte@googlemail.com">matthias.bolte@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Sorry, I forgot to reply to your follow up question on the users list.<br>
<br>
2011/4/6 James Barkley <<a href="mailto:james.barkley@gmail.com">james.barkley@gmail.com</a>>:<br>
<div class="im">> Greetings:<br>
> I've added code to the ESX driver to support some basic network<br>
> functionality. I'm pretty new to this list, so please tell me how to proceed<br>
> with code review and patch submission (yes I've read the contributor<br>
> guidelines on the wiki). It seems like people are emailing a patch file for<br>
> every file they've changed, each in separate emails with [1 of N] in the<br>
> subject, is that right? Or is it better to paste in code, get some feedback,<br>
> and eventually attach the patch to the bug tracker item?<br>
<br>
</div>The normal approach is to have one commit/patch per logical<br>
self-contained change. After each commit/patch the codebase has to be<br>
in a compilable stage. For example you cannot add the code using the<br>
generated SOAP bindings, before you actually added them to the<br>
esx_vi_generator.input file.<br>
<br>
The [1 of N] style patch series are typically used for large changes<br>
that are split in several logical, self-contained parts. Splitting<br>
like this simplifies reviewing and later on figuring out bugs using<br>
git bisect.<br>
<br>
You typically don't split on a per file basis.<br>
<br>
In your case I'd suggest to create a single commit/patch for your<br>
addition, as it is one logical piece of work. You _could_ (but I don't<br>
recommend to) split it in multiple patches. For example one for the<br>
esx_vi_generator.input addition, one for the VI helper function<br>
additions and one for the actual driver functions, but I'd consider<br>
this to be too fine grained.<br>
<div class="im"><br>
> I've updated the code for the ESX driver to be able to handle the following<br>
> functions :<br>
> - virNetworkLookupByName<br>
> - virConnectNumOfDefinedNetworks<br>
> - virConnectNumOfNetworks<br>
> - virConnectListNetworks<br>
<br>
</div>Is this sufficient to make virsh net-list work?<br>
<div class="im"><br>
> I basically mapped the VMware Managed Object Reference for networks into a<br>
> few data structures and added the following functions to the internal driver<br>
<br>
</div>You mean the managed object called Network? They _seem_ to be the<br>
natural fit. But I'm not sure if that's the correct approach, as you<br>
cannot directly create/destroy such objects and they are bound in some<br>
way to the port groups on a virtual switch. Also I'm not sure about<br>
the exact semantics of networks and port groups.<br>
<br>
That's what I meant as I said about the mapping between libvirt and<br>
VMware. We need to be sure to use the right approach from the start to<br>
avoid making breaking changes across releases later on.<br>
<br>
> API:<br>
> - esxNumOfNetworks<br>
> - esxListNetworks<br>
> - esxNumOfDefinedNetworks<br>
<br>
I assume you made esxNumOfDefinedNetworks return 0 to get virsh<br>
net-list working as there network in the VMware context are always<br>
active.<br>
<div class="im"><br>
> - esxNetworkLookupByName<br>
> - esxVI_LookupNetworkList<br>
> - esxVI_LookupNetworkByName<br>
> These functions were modeled after existing functions from the domain and<br>
> storage libraries. The following files were touched:<br>
> - esx_network_driver.c<br>
> - esx_vi.c<br>
> - esx_vi.h<br>
> - esx_vi_generator.input<br>
<br>
</div>Apart from the question whether the Network managed object is the<br>
correct match, the next step is to send your patch to this list to get<br>
a review. The recommended way for sending patches is git send-email.<br>
<font color="#888888"><br>
Matthias<br>
</font></blockquote></div><br></div>