[virt-tools-list] [PATCH virt-install 4/4] virt-install: Deal with os-variant's install param
Cole Robinson
crobinso at redhat.com
Mon Feb 18 17:48:13 UTC 2019
On 2/8/19 10:23 AM, Fabiano Fidêncio wrote:
> As os-variant has a new "install" parameter that can be passed, let's
> take advantage of it and automatically fill options.location with data
> from osinfo-db whenever install=location is passed (and, of course,
> osinfo-db has the information).
>
> Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
> ---
> virt-install | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/virt-install b/virt-install
> index 3aa643d2..4e812930 100755
> --- a/virt-install
> +++ b/virt-install
> @@ -441,6 +441,19 @@ def build_installer(options, guest):
> install_bootdev = None
>
> has_installer = True
> + if options.os_variant.install == "location":
> + if not options.location:
> + location = guest.osinfo.get_location(guest.os.arch)
> + if not location:
> + logging.debug(_("No location could be guessed from osinfo-db "
> + "and the installation cannot proceed"))
> + # This triggers an error in validate_required_options
> + return None
> + logging.debug("Generated default libosinfo '--location %s'", location)
> + options.location = location
> + elif options.os_variant.install == "cdrom":
> + pass
> +
> if options.location:
> (location,
> location_kernel,
>
We should explicitly fail if we know something won't work. So basically
any value that isn't install=location should be explicitly erroring. I
added a follow up patch for this too, and some basic test suite
coverage, and pushed it all
Thanks,
Cole
More information about the virt-tools-list
mailing list