From 26b3e3c8fe3986062304c1d96fd08d7d8f467f57 Mon Sep 17 00:00:00 2001 From: Homero Pawlowski Date: Wed, 16 Aug 2017 11:50:29 -0400 Subject: [PATCH] automatically insert numa_cpus[:id] based on array index, and remove user's ability to edit --- README.md | 4 ++-- lib/vagrant-libvirt/templates/domain.xml.erb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0801136..472ca1a 100644 --- a/README.md +++ b/README.md @@ -306,8 +306,8 @@ end ``` v.cpus = 4 v.numa_nodes = [ - {:id => 0, :cpus => "0-1", :memory => "1024"}, - {:id => 1, :cpus => "2-3", :memory => "4096"} + {:cpus => "0-1", :memory => "1024"}, + {:cpus => "2-3", :memory => "4096"} ] ``` * `loader` - Sets path to custom UEFI loader. diff --git a/lib/vagrant-libvirt/templates/domain.xml.erb b/lib/vagrant-libvirt/templates/domain.xml.erb index 6e79ecc..7fd991e 100644 --- a/lib/vagrant-libvirt/templates/domain.xml.erb +++ b/lib/vagrant-libvirt/templates/domain.xml.erb @@ -18,8 +18,8 @@ <% end %> <% if @numa_nodes %> - <% @numa_nodes.each do |node| %> - + <% @numa_nodes.each_with_index do |node, index| %> + <% end %> <% end %>