Sowmini.Varadhan at Sun.COM wrote: >> Below is the webrev. >> http://jurassic.sfbay/net/aquila.prc/export/home/cathy/snv-dev/webrev/index.html >> > > Cathy, > > The general scheme looks compatible with Brussels viewpoint, but > a couple of questions: why is there a difference between arg2 in the > following signatures: > > typedef dladm_status_t pd_getf_t(const char *, char **, uint_t *); > typedef dladm_status_t pd_setf_t(const char *, val_desc_t *, uint_t); > > i.e., why don't they both take val_desc_t * as the second arg, which > seems to be more general? > I did this based on the original libwladm code. I also thought about making them consistent when I did the change, but I found that taking val_desc_t * as the argument of pd_getf_t only add more complexities. It is because we only expect the result from the xxx_get() function to be in the form of string, and the caller allocates the memory to keep the result makes things easier.
> Also, the third arg in the pd_setf_t signature looks a bit confusing. > Does this indicate the count of number of elements in vd_val? > or is it the number of val_desc_t elements itself? (Could use some > comments in the code, since its hard to remember these semantics) > It's the number of the val_desc_t elements. As the type of vd_val (void *) suggests, you can keep whatever type of vd_val as you need, and the framework only assumes one to one mapping between vd_val and val_desc_t. How to interpret vd_val is only a matter of the specific property. Thanks - Cathy
