On Thu, Mar 26, 2020 at 04:15:13PM +0100, Michal Privoznik wrote: > 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-gc9bd08ee35) 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: Michal Privoznik <mprivozn@xxxxxxxxxx> > Reviewed-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx> > --- > src/qemu/qemu_command.c | 4 ++-- > src/qemu/qemu_conf.c | 24 +++++++++++++++++------- > src/qemu/qemu_conf.h | 10 ++++++---- > src/qemu/qemu_driver.c | 2 +- > src/qemu/qemu_process.c | 2 +- > 5 files changed, 27 insertions(+), 15 deletions(-) Reviewed-by: Daniel P. Berrangé <berrange@xxxxxxxxxx> 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 :|