[ovs-dev] [next 34/35] ofproto: Complete abstraction by adding enumeration and deletion functions.

Ethan Jackson ethan at nicira.com
Mon May 9 18:01:16 UTC 2011


Looks Good, thanks.

Ethan

On Mon, May 9, 2011 at 09:33, Ben Pfaff <blp at nicira.com> wrote:
> On Fri, May 06, 2011 at 05:47:06PM -0700, Ethan Jackson wrote:
>> > +int
>> > +ofproto_delete(const char *name, const char *type)
>> > +{
>> > + ? ?struct dpif *dpif;
>> > + ? ?int error;
>> > +
>> > + ? ?error = dpif_open(name, type, &dpif);
>> > + ? ?if (!error) {
>> > + ? ? ? ?error = dpif_delete(dpif);
>> > + ? ? ? ?dpif_close(dpif);
>> > + ? ?}
>> > + ? ?return error;
>> > +}
>>
>> This function may deserve a comment.  I could imagine someone not
>> familiar with the code confused about what precisely it does.
>
> Good idea.  I added this comment:
>
> /* Destroys the datapath with the respective 'name' and 'type'.  With the Linux
>  * kernel datapath, for example, this destroys the datapath in the kernel, and
>  * with the netdev-based datapath, it tears down the data structures that
>  * represent the datapath.
>  *
>  * The datapath should not be currently open as an ofproto. */
>



More information about the dev mailing list