Cathy Zhou wrote:
> Peter Memishian wrote:
>>  > I would like a rename operation to not involving delete_conf() 
>> explicitly  > and only need to update the specific link configuration 
>> entry to be the new  > link name.
>>
>> Is there a specific reason?
>>
> Well, the reason would be to simplify the API consumers. I'd like the 
> do_rename() function only calls a single function dladm_rename_conf() 
> instead of:
> 
>  dladm_read_conf(conf);
>  dladm_delete_conf(linkid);
>  dladm_set_conf_field("name", newname);
>  dladm_write_conf();
> 

Yes, rename is getting a little complicated.  And the API user needs to 
keep in mind a specific order is required.  I think a rename would help. 
  And I agree with Cathy, it should be called dladm_rename_conf().

>>  > Specific to Dan's question, we could add a function rename_conf() 
>> to  > differentiate it from the normal commit_conf() operation.
>>
>> I think it's more complicated than that, since commit_conf() 
>> (write_conf()
>> as we've now been calling it) probably needs to write out the entire
>> configuration in one pass to preserve atomicity (as per my email).
>>
> I understand that. But that's in the API implementation.
>

Yes.  The simple way of implementing rename would be to have it make the 
four calls listed earlier in the mail, in the same order.

Dan

Reply via email to