]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: clarify what is returned for actual bandwidth and vlan
authorLaine Stump <laine@laine.org>
Mon, 17 Feb 2014 12:36:18 +0000 (14:36 +0200)
committerLaine Stump <laine@laine.org>
Tue, 25 Feb 2014 13:55:19 +0000 (15:55 +0200)
commit6d4ffae4fc1350542b5675c215caf7d7e1e15fc4
tree9345260a644fa51434c602ac2764573e297b4726
parent60f70542f97805af49d656a582be35445046a0c9
conf: clarify what is returned for actual bandwidth and vlan

In practice, if a virDomainNetDef has a virDomainActualNetDef
allocated, the ActualNetDef will *always* contain the bandwidth and
vlan data from the NetDef (unless there was also a portgroup involved
- see networkAllocateActualDevice()).

However, virDomainNetGetActual(Bandwidth|Vlan)() were coded to make it
appear as if it might be possible to have a valid bandwidth/vlan in
the NetDef, but a NULL in the ActualNetDef. Believing this un-truth
could lead to writing unnecessarily defensive code when dealing with
the virDomainGetActual*() functions, so this patch makes it more
obvious:

   If there is an ActualNetDef, it will always have a copy of the
   various appropriate bits from its parent NetDef, and the
   virDomainGetActual* function will *always* return the data from the
   ActualNetDef, not from the NetDef.

The reason for this effective-NOP patch is that a subsequent patch to
change virDomainNetDefFormat will rely on the above rule.
src/conf/domain_conf.c