• M
    domain_conf: Use virDomainParseMemory more widely · 01b4de2b
    Michal Privoznik 提交于
    As reviewing patches upstream it occurred to me, that we have two
    functions doing nearly the same: virDomainParseMemory which
    expects XML in the following format:
    
      <memory unit='MiB'>1337</memory>
    
    The other function being virDomainHugepagesParseXML expecting the
    following format:
    
      <someElement size='1337' unit='MiB'/>
    
    It wouldn't matter to have two functions handle two different
    scenarios like this if we could only not copy code that handles
    32bit arches around. So this code merges the common parts into
    one by inventing new @units_xpath argument to
    virDomainParseMemory which allows overriding the default location
    of @unit attribute in XML. With this change both scenarios above
    can be parsed with virDomainParseMemory.
    Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
    01b4de2b
domain_conf.c 680.8 KB