• L
    util: utility functions for virNetDevVPortProfile · 1c02ed14
    Laine Stump 提交于
    This patch adds three utility functions that operate on
    virNetDevVPortProfile objects.
    
    * virNetDevVPortProfileCheckComplete() - verifies that all attributes
        required for the type of the given virtport are specified.
    
    * virNetDevVPortProfileCheckNoExtras() - verifies that there are no
        attributes specified which are inappropriate for the type of the
        given virtport.
    
    * virNetDevVPortProfileMerge3() - merges 3 virtports into a single,
        newly allocated virtport. If any attributes are specified in
        more than one of the three sources, and do not exactly match,
        an error is logged and the function fails.
    
    These new functions depend on new fields in the virNetDevVPortProfile
    object that keep track of whether or not each attribute was
    specified. Since the higher level parse function doesn't yet set those
    fields, these functions are not actually usable yet (but that's okay,
    because they also aren't yet used - all of that functionality comes in
    a later patch.)
    
    Note that these three functions return 0 on success and -1 on
    failure. This may seem odd for the first two Check functions, since
    they could also easily return true/false, but since they actually log
    an error when the requested condition isn't met (and should result in
    a failure of the calling function), I thought 0/-1 was more
    appropriate.
    1c02ed14
virnetdevvportprofile.h 4.4 KB