• M
    qemu: Make hugepages path generation embed driver aware · bf54784c
    Michal Privoznik 提交于
    So far, libvirt generates the following path for hugepages:
    
      $mnt/libvirt/qemu/$id-$shortName
    
    where $mnt is the mount point of hugetlbfs corresponding to
    hugepages of desired size (e.g. /dev/hugepages), $id is domain ID
    and $shortName is shortened version of domain name. So for
    instance, the generated path may look something like this:
    
      /dev/hugepages/libvirt/qemu/1-QEMUGuest
    
    But this won't work with embed driver really, because if there
    are two instances of embed driver, and they both want to start a
    domain with the same name and with hugepages, both drivers will
    generate the same path which is not desired. Fortunately, we can
    reuse the approach for machined name generation
    (v6.1.0-178-gc9bd08ee) and include part of hash of the root in
    the generated path.
    
    Note, the important change is in qemuGetBaseHugepagePath(). The
    rest is needed to pass driver around.
    Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
    Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
    Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
    Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
    bf54784c
qemu_conf.h 11.4 KB