• M
    qemu: Make memory path generation embed driver aware · 1d3a9ee9
    Michal Privoznik 提交于
    So far, libvirt generates the following path for memory:
    
      $memoryBackingDir/$id-$shortName/ram-nodeN
    
    where $memoryBackingDir is the path where QEMU mmaps() memory for
    the guest (e.g. /var/lib/libvirt/qemu/ram), $id is domain ID
    and $shortName is shortened version of domain name. So for
    instance, the generated path may look something like this:
    
      /var/lib/libvirt/qemu/ram/1-QEMUGuest/ram-node0
    
    While in case of embed driver the following path would be
    generated by default:
    
      $root/lib/qemu/ram/1-QEMUGuest/ram-node0
    
    which is not clashing with other embed drivers, we allow users to
    override the default and have all embed drivers use the same
    prefix. This can create clashing paths. 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 qemuGetMemoryBackingBasePath().
    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>
    1d3a9ee9
qemu_conf.h 11.3 KB