Whether we check for a vol-format value shouldn't be dependent
on whether the UI is on screen (is_visible), but whether the UI
is requested to be shown (get_visible)
https://bugzilla.redhat.com/show_bug.cgi?id=1670266
Add kernel= and initrd= --location suboptions. These can be
used to override the default kernel/initrd and specify new
paths, relative to LOCATION.
For example, if you have an ISO that libosinfo doesn't know
about called my-unknown.iso, with a kernel at 'kernel/fookernel'
and initrd at +'kernel/fooinitrd', you can make this work with:
--location my-unknown.iso,kernel=kernel/fookernel,initrd=kernel/fooinitrd
If an ISO path is used for --location, prioritize asking libosinfo
for the os_variant and kernel/initrd paths.
This fixes some instances that we lost when GenericDistro was dropped,
like using various netinst/boot.isos around
Example: https://github.com/virt-manager/virt-manager/pull/39
Future changes will make more use of libosinfo, which means we
won't end up in some of the *Distro classes. So move the
get_kernel_url_arg logic into the parent Distro class, so it's
more easily shared.
Recently the Python binding of libguestfs was adapted to properly use
bytes in APIs that return data, instead of (ab)using strings [1].
This change was done only when built for Python 3, which has this
distinct bytes and strings.
Because of that, now the 'icon == ""' (empty string) checks fail, using
whatever inspect_get_icon() returns, including empty arrays of bytes.
Hence, change the checks to use the length of the data as condition, as
also the libguestfs Python API documentation says. Leave also the
checks for None, in the remote case the API will return None in the
future for no data.
[1] 0ee02e0117
self._os_variant returns sles11sp4 sles11sp3 and so on.
Lets match those as well to pickup the right kernels.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
For Python versions < 3.6 it's not possible for the metaclass to call
a method in the defined class that uses super() before it is done with
its __new__ and __init__. Therefore let's workaround this by using
hard coded class names instead of super() in __init_class__. See
https://stackoverflow.com/a/28605694 for more details.
In addition, add missing __init_class__ call to the __init_class__
implementation of _ParserChar.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
This was originally added for fedora to give better names in the UI,
but that's a loose reasoning IMO. The pattern was extended to
other -unknown distros but instead of maintaining that going
forward I'd rather just remove the magic for it.