[virt-tools-list] [virt-install PATCH 3/4] guest: Deal with network install resources
Fabiano Fidêncio
fidencio at redhat.com
Fri Mar 8 16:20:58 UTC 2019
Let's add two new methods to deal with network install resources so
those can be set from the installer.
Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
virtinst/guest.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/virtinst/guest.py b/virtinst/guest.py
index 2cca3e8d..2bbc7809 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -167,6 +167,9 @@ class Guest(XMLBuilder):
self._capsinfo = None
self._domcaps = None
+ self._running_memory = None
+ self._network_install_memory = None
+
######################
# Property accessors #
@@ -645,6 +648,13 @@ class Guest(XMLBuilder):
self._add_implied_controllers()
self._add_spice_devices()
+ def set_network_install_resources(self):
+ if self._network_install_memory and self._network_install_memory > self.memory:
+ self.memory = self._network_install_memory
+
+ def unset_network_install_resources(self):
+ self.memory = self._running_memory
+ self.maxmemory = self._running_memory
########################
# Private xml routines #
@@ -659,6 +669,10 @@ class Guest(XMLBuilder):
if not self.vcpus:
self.vcpus = res.get('n-cpus') if res and res.get('n-cpus') > 0 else 1
+ self._running_memory = self.memory
+ res = self.osinfo.get_network_install_resources(self)
+ if res and res.get('ram') > 0:
+ self._network_install_memory = res['ram'] // 1024
def _set_default_machine(self):
if self.os.machine:
--
2.20.1
More information about the virt-tools-list
mailing list