]> xenbits.xensource.com Git - libvirt.git/commit
qemu: Make memory path generation embed driver aware
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 23 Mar 2020 12:33:32 +0000 (13:33 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 7 Apr 2020 13:26:32 +0000 (15:26 +0200)
commit1d3a9ee9da26bf687eef8ab0bbf3edf27c3f3b86
tree51ed03dc51228be7bd90c0d820fe707f9a24df6c
parentbf54784cb163471f3e7d93ae60cec6de7586c9a8
qemu: Make memory path generation embed driver aware

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@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_command.c
src/qemu/qemu_conf.c
src/qemu/qemu_conf.h
src/qemu/qemu_process.c