virt-install: Require --osinfo for non-x86 HVM case too

It's generally not as valuable for non-x86 where we don't have the
history of supporting non-virtio OSes, but as time goes on it will
likely become more relevant for non-x86 arches, so let's make this
change now to get ahead of it.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2022-02-20 11:40:35 -05:00
parent 5ebd4313f2
commit 363fca413c
3 changed files with 10 additions and 5 deletions

View File

@ -1016,8 +1016,8 @@ all other settings off or unset.
By default, virt-install will always attempt ``--osinfo detect=on``
for appropriate install media. If no OS is detected, we will fail
in certain common cases (x86 KVM for example). This fatal error was
added in 2022. You can work around this by using the fallback example
in most common cases. This fatal error was added in 2022. You can
work around this by using the fallback example
above, or disabling the ``require`` option. If you just need to get back
to the old non-fatal behavior ASAP, set the environment variable
VIRTINSTALL_OSINFO_DISABLE_REQUIRE=1.

View File

@ -1146,6 +1146,7 @@ c.add_compare("--connect %(URI-KVM-ARMV7L)s --disk %(EXISTIMG1)s --import --os-v
#################
c.add_valid("--arch aarch64 --osinfo fedora19 --nodisks --pxe --connect " + utils.URIs.kvm_x86_nodomcaps, grep="Libvirt version does not support UEFI") # attempt to default to aarch64 UEFI, but it fails, but should only print warnings
c.add_invalid("--arch aarch64 --nodisks --pxe --connect " + utils.URIs.kvm_x86, grep="OS name is required") # catch missing osinfo for non-x86
c.add_compare("--arch aarch64 --osinfo fedora19 --machine virt --boot kernel=/f19-arm.kernel,initrd=/f19-arm.initrd,kernel_args=\"console=ttyAMA0,1234 rw root=/dev/vda3\" --disk %(EXISTIMG1)s", "aarch64-machvirt")
c.add_compare("--arch aarch64 --osinfo fedora19 --boot kernel=/f19-arm.kernel,initrd=/f19-arm.initrd,kernel_args=\"console=ttyAMA0,1234 rw root=/dev/vda3\" --disk %(EXISTIMG1)s", "aarch64-machdefault")
c.add_compare("--arch aarch64 --cdrom %(ISO-F26-NETINST)s --boot loader=CODE.fd,nvram.template=VARS.fd --disk %(EXISTIMG1)s --cpu none --events on_crash=preserve,on_reboot=destroy,on_poweroff=restart", "aarch64-cdrom") # cdrom test, but also --cpu none override, --events override, and headless

View File

@ -355,9 +355,13 @@ def _show_memory_warnings(guest):
def _needs_accurate_osinfo(guest):
# Limit it to hvm x86 guests which presently our defaults
# only really matter for
return guest.os.is_x86() and guest.os.is_hvm()
# HVM is really the only case where OS impacts what we set for defaults,
# so far.
#
# Historically we would only warn about missing osinfo on x86, but
# with the change to make osinfo mandatory we relaxed the arch check,
# so virt-install behavior is more consistent.
return guest.os.is_hvm()
def show_guest_warnings(options, guest):