]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: HostdevDef parse/format helper functions
authorLaine Stump <laine@laine.org>
Sun, 19 Feb 2012 21:04:44 +0000 (16:04 -0500)
committerLaine Stump <laine@laine.org>
Tue, 6 Mar 2012 04:23:54 +0000 (23:23 -0500)
commit5560170d04e72ac60c8ac67b149b6e0b9342c797
tree759c5d660c74e7f9c981ffce57e8f55610816d43
parent29293930a9842d76b04a9a62daae119587246e74
conf: HostdevDef parse/format helper functions

In an upcoming patch, virDomainNetDef will acquire a
virDomainHostdevDef, and the <interface> XML will take on some of the
elements of a <hostdev>. To avoid duplicating the code for parsing and
formatting the <source> element (which will be nearly identical in
these two cases), this patch factors those parts out of the
HostdevDef's parse and format functions, and puts them into separate
helper functions that are now called by the HostdevDef
parser/formatter, and will soon be called by the NetDef
parser/formatter.

One change in behavior - previously virDomainHostdevDefParseXML() had
diverged from current common coding practice by logging an error and
failing if it found any subelements of <hostdev> other than those it
understood (standard libvirt practice is to ignore/discard unknown
elements and attributes during parse). The new helper function ignores
unknown elements, and thus so does the new
virDomainHostdevDefParseXML.
src/conf/domain_conf.c