[PATCH v2 10/11] qemu: Make memory path generation embed driver aware

Daniel P. Berrangé berrange at redhat.com
Mon Mar 30 11:23:52 UTC 2020


On Thu, Mar 26, 2020 at 04:15:14PM +0100, Michal Privoznik wrote:
> 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-gc9bd08ee35) 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: Michal Privoznik <mprivozn at redhat.com>
> Reviewed-by: Daniel Henrique Barboza <danielhb413 at gmail.com>
> ---
>  src/qemu/qemu_command.c | 15 +++++++--------
>  src/qemu/qemu_conf.c    | 21 ++++++++++++++-------
>  src/qemu/qemu_conf.h    |  8 ++++----
>  src/qemu/qemu_process.c |  5 ++---
>  4 files changed, 27 insertions(+), 22 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange at redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list