]> xenbits.xensource.com Git - libvirt.git/commit
qemu_process: Deduplicate code in qemuProcessNeedHugepagesPath()
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 5 Feb 2021 12:34:35 +0000 (13:34 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 18 May 2021 15:47:58 +0000 (17:47 +0200)
commit4d779874ef4c9a9ece57f068323df15588f1edd5
treebc7fed0dd4b17dfabb37ab652c3ca02928228487
parent0ccc73ef52918c0e645ba4c61ee8d40ae7e13116
qemu_process: Deduplicate code in qemuProcessNeedHugepagesPath()

The aim of qemuProcessNeedHugepagesPath() is to return whether
guest needs private path inside HugeTLBFS mounts (deducted from
domain definition @def) or whether the memory device that user is
hotplugging in needs the private path (deducted from the @mem
argument). The actual creation of the path is done in the only
caller qemuProcessBuildDestroyMemoryPaths().

The rule for the first case (@def) and the second case (@mem) is
the same (domain has a DIMM device that has HP requested) and is
written twice. Move the logic into a function to deduplicate the
code.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_process.c