mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
osdict: Restrict n-cpus to 1 for machvirt
It fails to boot otherwise
This commit is contained in:
@@ -1633,7 +1633,7 @@ class vmmCreate(vmmGObjectUI):
|
||||
self.addstorage.check_path_search(
|
||||
self, self.conn, path)
|
||||
|
||||
res = virtinst.osdict.get_recommended_resources(variant, self.capsguest.arch)
|
||||
res = virtinst.osdict.get_recommended_resources(variant, self.guest)
|
||||
|
||||
# Change the default values suggested to the user.
|
||||
ram_size = DEFAULT_MEM
|
||||
|
||||
@@ -484,7 +484,7 @@ class _OsVariant(_OsVariantType):
|
||||
|
||||
return None
|
||||
|
||||
def get_recommended_resources(self, arch):
|
||||
def get_recommended_resources(self, guest):
|
||||
ret = {}
|
||||
def read_resource(resources, minimum, arch):
|
||||
# If we are reading the "minimum" block, allocate more
|
||||
@@ -505,9 +505,14 @@ class _OsVariant(_OsVariantType):
|
||||
# in this case read first the minimum resources (if present)
|
||||
# and use them.
|
||||
read_resource(self._os.get_minimum_resources(), True, "all")
|
||||
read_resource(self._os.get_minimum_resources(), True, arch)
|
||||
read_resource(self._os.get_minimum_resources(), True, guest.os.arch)
|
||||
read_resource(self._os.get_recommended_resources(), False, "all")
|
||||
read_resource(self._os.get_recommended_resources(), False, arch)
|
||||
read_resource(self._os.get_recommended_resources(),
|
||||
False, guest.os.arch)
|
||||
|
||||
# machvirt doesn't allow smp in non-kvm mode
|
||||
if guest.type != "kvm" and guest.os.is_arm_machvirt():
|
||||
ret["n-cpus"] = 1
|
||||
|
||||
return ret
|
||||
|
||||
@@ -607,13 +612,13 @@ def lookup_osdict_key(variant, key, default):
|
||||
return val
|
||||
|
||||
|
||||
def get_recommended_resources(variant, arch):
|
||||
def get_recommended_resources(variant, guest):
|
||||
_load_os_data()
|
||||
v = _allvariants.get(variant)
|
||||
if v is None:
|
||||
return None
|
||||
|
||||
return v.get_recommended_resources(arch)
|
||||
return v.get_recommended_resources(guest)
|
||||
|
||||
|
||||
def lookup_os_by_media(location):
|
||||
|
||||
Reference in New Issue
Block a user