Commit Graph

233 Commits

Author SHA1 Message Date
Cole Robinson
f107e39989 Switch to more traditional logging structure
Init a shared log instance in virtinst/logger.py, and use that
throughout the code base, so we aren't calling directly into
'logging'. This helps protect our logging output from being
cluttered with other library output, as happens with some
'requests' usage
2019-06-17 00:12:31 -04:00
Cole Robinson
fbe388b26a virt-install: Warn if mem less than OS recommended
And if mem is abnormally low, like it appears user tried to specify
GiB not MiB
2019-06-14 11:24:10 -04:00
Cole Robinson
17ac0d017c virt-install: Drop --os-variant suboption parsing
Not sure I want to go down that route if we can avoid it. Instead
just fold the full_id support into the existing option handling.
Streamline the OSVariantData usage throughout the cli tools
2019-06-13 21:25:05 -04:00
Cole Robinson
21723706f5 virt-install: Add --install OSNAME
Replace the unreleased --os-variant OSNAME,install=location with just

  --install OSNAME

Unwind the --unattended dependency on upfront --os-variant while
we are at it, since they are all intertwined. Now we can just do:

  virt-install --install OSNAME
and
  virt-install --install OSNAME --unattended
2019-06-13 20:26:26 -04:00
Cole Robinson
a9d33d49db osdict: Add testing and finish of code coverage 2019-06-13 14:00:04 -04:00
Cole Robinson
b3a9b98e08 osdict: Standardize on OsMedia usage
* Make all API calls go through the _OsMedia object
* Move most of the unattended specific processing to unattended.py
* Rename requires_internet to is_netinst to clarify what it is checking
2019-06-09 11:26:28 -04:00
Cole Robinson
195d775c5b installertree: abspath convert MEDIA_DIR
Various parts of the code implicitly expect an absolute path
2019-06-09 10:50:21 -04:00
Cole Robinson
d9b41bf887 tests: Add clitest coverage for network-install resources 2019-06-09 10:14:48 -04:00
Cole Robinson
af12b32928 osdict: Don't use a variable named 'os' 2019-06-07 21:26:02 -04:00
Cole Robinson
37adfb0150 urlfetcher: Add http and ftp unit test mocking 2019-06-07 21:25:41 -04:00
Cole Robinson
9fc20d4a97 osdict: Fix url arg detection for fedora-rawhide distro 2019-06-07 21:13:51 -04:00
Cole Robinson
d167021b0f osdict: Drop the solaris10 x2apic hack
The upstream kvm bug has never been resolved. I think this is
obscure enough nowadays that we don't need to track and test it
2019-06-05 16:35:34 -04:00
Cole Robinson
4e3e38cad1 tests: Fix test suite failures on f29 libvirt 4.7.0 2019-05-16 11:29:12 -04:00
Cole Robinson
12440b00c1 osdict: return _OsResources to callers
Use the class helper routines to save some tedious dict management
2019-05-12 17:25:47 -04:00
Cole Robinson
e76e350a8d osdict: Add _OsResources helper class
It's just an implementation detail for now, but we will use it to
simplify callers interactions with resources data
2019-05-12 17:25:47 -04:00
Cole Robinson
efa8c6f2c0 osdict: Don't limit qemu TCG to vcpus=1
Modern qemu has multithread TCG support for all the arches we
support, so don't limit things
2019-05-12 17:25:47 -04:00
Cole Robinson
4238e3f7d7 osdict: Fix get_recommended_resources minimum logic
If an OS has a <minimum> resources section, and a <recommended>
resources section, but there's a field in the former that isn't in
the latter, currently we throw out the former field entirely. This
is the case for n-cpus for a few OS. Instead we should be using
the <minimum> ncpus value. This changes the default <vcpu> value
for a quite a few test cases.
2019-05-12 17:25:47 -04:00
Cole Robinson
9199c2d157 osdict: Remove "cpus" resources tracking
It's for CPU speed but we don't use it anywhere
2019-05-12 17:25:47 -04:00
Fabiano Fidêncio
12ec663f0b osdict: Fix OsMedia::requires_internet() logic
In case there's no self.osinfo_media, it means the installation won't
happen from the media itself, so it should return "True" (as in, it
requires internet).

Returning "False", though, should be done when no "netinst" variant was
found (but we do have a media).

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-04-01 15:01:04 -04:00
Fabiano Fidêncio
467cb9bc0a urldetect: return osdict.py:OsMedia instead of Libosinfo.Media
Consequently, let's:
- rename urldetect::get_osinfo_media() to get_os_media()
- rename the installertreemedia::_LocationData::osinfo_media to os_media
- rename unattended::prepare_install_script's media argument to os_media
  - and also rename media to os_media on its internal
    _get_installation_source() method
- rename osdict::get_install_script's media argument to os_media

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-28 15:56:44 -04:00
Fabiano Fidêncio
313a95bd8e osdict: Add requires_internet() to OsMedia
In order to properly do a unattended installation of some medias (as net
installers), we have to check whether the media requires or not
internet. Doing so by checking its variant is not the most beautiful way
(as variants do not have a set of predefined names), but that's the best
that can be done with the current state of osinfo-db.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-28 15:56:44 -04:00
Fabiano Fidêncio
0247f97012 osdict: Add OsMedia class
The OsMedia class is a wrapper around OsinfoMedia and will help us
to keep the logic of dealing with media related stuff from inside
osdict.py

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-28 15:56:44 -04:00
Fabiano Fidêncio
6c7d765c60 osdict: Add get_network_install_resources()
get_network_install_resources() is going to be used when performing a
network based installations where more RAM is needed during the
installation time than the recommended one, which is the case of some
distros as CentOS, RHEL, (some versions of) Silverblue and (some
versions of) Fedora.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-28 15:56:44 -04:00
Cole Robinson
97a5af1e43 urldetect: Use libosinfo for tree detection too
Ask libosinfo for tree detection, but still fall back to our
own implementation if libosinfo fails
2019-03-24 12:27:46 -04:00
Andrea Bolognani
708af01c14 osdict: Add supports_virtioinput()
We can use this function to figure out whether the guest OS
supports VirtIO input devices (virtio-tablet, virtio-keyboard
and virtio-mouse).

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-21 15:31:20 +01:00
Erik Skultety
67acebc2b3 Fix a few issues reported by codespell
There were a few minor typos across the codebase which codespell pointed
out.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2019-03-18 13:04:53 -04:00
Cole Robinson
049a735eb2 osdict: Prefix some errors messages with 'OS'
Otherwise it's not entirely clear what we are refering too
2019-03-08 17:26:46 -05:00
Fabiano Fidêncio
db6161c610 osdict: Deal with medias' installer scripts
As medias may also have installer scripts associates to themselves and,
in this case, those should be considered instead the OS ones.

More than that, Libosinfo.Media provides an API that tells whether that
specific media supports installer scripts or not and this must be
checked as the first thing. In case no installer script is supported,
let's just error out and abort the installation.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-08 17:11:30 -05:00
Fabiano Fidêncio
93d3223c87 unattended: Pass the media down to get_install_script()
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-08 17:11:10 -05:00
Fabiano Fidêncio
fbcfc2147d osdict: Refactor get_install_script()
Let's refactor get_install_script() in a way that any addition done in
order to get the install scripts from the media would be cleaner.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-08 17:11:02 -05:00
Andrea Bolognani
c2bcb9e5a6 guest: Add supports_virtioscsi()
This is similar to the existing supports_virtio*() functions,
but for virtio-scsi.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-06 14:00:11 -05:00
Cole Robinson
49ae679702 osdict: Report available profile names on error 2019-03-05 16:38:22 -05:00
Cole Robinson
9dd758dee8 osdict: Add a helper for iterating over osinfo lists 2019-03-05 16:38:22 -05:00
Cole Robinson
402a95bb31 osdict: Improve some errors for OS 'generic' 2019-03-05 16:38:22 -05:00
Cole Robinson
0031d15098 virtinst: move OSInstallScript to unattended
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-03-05 16:38:22 -05:00
Cole Robinson
a8d0fb5a38 osdict: Don't lowercase gi imports
It's a pointless divergence
2019-03-05 16:38:22 -05:00
Cole Robinson
cb9d610a05 osdict: Move OSDB definition closer to _OSDB class 2019-03-05 16:38:22 -05:00
Cole Robinson
6537659ea6 osdict: Add OSInstallScript class
To wrap Libosinfo.InstallScript interactions
2019-03-05 16:38:22 -05:00
Fabiano Fidêncio
3f942f7385 osdict: Add methods for generating the script and its cmdline
generate_install_script_output() generates the install script,
accordingly to the config passed, in a specific directory.

generate_install_script_cmdline() generates the kernel command line that
has to be used in order to perform the unattended installation.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-05 16:38:22 -05:00
Fabiano Fidêncio
72d93ee7d8 osdict: Add set_install_script_installation_source()
As some of the install scripts may act differently depending on whether
the installation is going to be done via the OS media or via network
let's have a wrapper around set_installation_source(), from
Libosinfo.InstallScript, in order to be able to properly set which is
going to be the used installation source.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-05 16:38:22 -05:00
Fabiano Fidêncio
68640f3401 osdict: Add set_install_script_preferred_injection_method()
As not all unattended installations will be done by the same method,
let's have a wrapper around set_preferred_injection_method(), from
Libosinfo.InstallSript, in order to be able to properly set which is
going to be the preferred injection method for a script.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-05 16:38:22 -05:00
Fabiano Fidêncio
929adeb654 osdict: Properly set language and kbd layout for install script config
Let's try to guess the language and keyboard layout from the system's
language.

In case we can't do the guess, let's just let it be and libosinfo will
use the 'en_US' default for both language and keyboard layout.

There's a big issue here, though, that quite often users will *not* have
their keyboard layout matching with the language of their systems and,
unfortunately, I don't see any easy way to detect that unless we totally
rely on GLib.Settings (which, according to my understanding, we can't).

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-05 16:38:22 -05:00
Fabiano Fidêncio
35da347e6d osdict: Properly set the timezone for the install script config
Let's try to guess the timezone from '/etc/localtime' and use it, if
possible. Otherwise, let's just let it be and libosinfo will use the
default 'America/New_York' one.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-05 16:38:22 -05:00
Fabiano Fidêncio
5a17c04208 osdict: Add get_install_script_config()
get_install_script_config() method returns an OsinfoInstallScriptConfig
object that's tied to an OsinfoInstallScript object, already configured
based in the info provided by the user and it's ready to be used.

For now, the config will always set the timezome to 'America/New_York'
and the language and keyboard layout to 'en_US'.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-05 16:38:22 -05:00
Fabiano Fidêncio
8f991e3ea2 osdict: Add get_install_script()
get_install_script() method returns an installer script of a specific
profile type for a specific OS.

In case no OS is defined, None is returned.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-05 16:38:22 -05:00
Pino Toscano
9cd405b6ef osinfo: deal with rolling distros for EOL status
If a distribution has no EOL date set, always consider it supported if
its release status is "rolling".

(crobinso: reformat a bit, appease pylint)

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2019-02-19 15:57:21 -05:00
Cole Robinson
8139b3839e osdict: Raise exception on get_location failure
It's better to error immediately if we know this won't work
2019-02-18 10:56:38 -05:00
Fabiano Fidêncio
08d3a5786c osdict: add get_location()
get_location() is a new method that returns the osinfo-db tree URL of an
OS, according to the passed architecture.

This method will need some improvement later on once we start having a
specific set of definitions on osinfo-db about what's the type of the OS
we're dealing with (like Server, Desktop, ...).

For now, the new method returns the first URL found without taking into
the consideration the types speficied above.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-02-14 13:33:48 -05:00
Fabiano Fidêncio
071c885e84 osdict: Use identify_media() instead of guess_os_from_media()
guess_os_from_media() has been deprecated for a while and
identify_media() should be used instead.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-02-07 11:50:45 -05:00
Cole Robinson
f035f313a4 osdict: Absorb get_kernel_url_arg from urldetect
Since nowadays it's entirely a function of the detected OS name
2019-02-03 12:05:18 -05:00
Cole Robinson
2b4e1cadf3 osdict: Rename lookup_os_by_media to guess_os_by_iso
And have it return the media object up to the caller
2019-02-03 12:05:18 -05:00
Cole Robinson
069653b744 osdict: Drop -unknown mapping for ISO media detection
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.
2019-01-08 16:02:34 -05:00
Cole Robinson
2f89ecf4a9 Remove Author lines from file headers
Similar to what was done in libvirt. See these commits:

600462834f
c99e954973
2019-01-08 11:45:35 -05:00
Fabiano Fidêncio
ee0ac5f2c7 osdict: adapt latest_os_version() to ignore "-unknown" distros
As some enterprise distros adopted the "unknown" approach in osinfo-db,
and those usually support different versions at the same time, there may
be different "unknown" entries (like rhel-unknown, rhel-8-unknown,
rhel-7-unknown, and so on) for the very same distro.

This situation can easily happen when some ISO matches, for exmaple,
"rhel-unknown" and then the latest one selected would be
"rhel-8-unknown".

In order to avoid this situation from happening, let's just ignore the
"unknown" entries when calling latest_regex().

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2018-12-05 15:04:59 +01:00
Fabiano Fidêncio
fbcea0b63c osdict: adapt latest_regex() to openSUSE's versioning
Due to OpenSUSE's decision of versioning their OS as 11.x, 12.x, 42.x,
15.x, we have to add a specific check in latest_regex() in order to make
sure we skip the 42.x series in the sorted list of OSes when returning
the OS name to the user.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2018-12-05 15:04:59 +01:00
Fabiano Fidêncio
7612c5bdcd osdict: expand the "unknown" check for any distro
Currently osinfo-db has "unknown" entries for fedora, opensuse and
asianux. Considering this list may grow even more at some point, let's
just make the check more generic and use it for all of them instead of
keeping it for fedora only.

Changes have also been done in urldetect and tests_url, as those also
used latest_fedora_version().

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2018-12-05 15:04:59 +01:00
Lukáš Doktor
30b7c33c6d virt-install: Fix guest-os deprecation msg
Arguments to logging needs to be individual args, otherwise it
fails with "not enough arguments for format string"                             

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
2018-11-14 18:25:06 +01:00
Cole Robinson
edab908f42 guest: Use q35 chipset by default for new qemu + supported OS
There's been various discussions about changing the x86 default
from 'pc' to 'q35' over the years, but it's unlikely to happen
at the qemu or libvirt level for compatibility reasons. So
let's start using it for new enough OS that support it.
2018-10-13 14:58:57 -04:00
Cole Robinson
046a242bd4 guest: Use USB3 for x86 qemu if OS supports it
Using new annotations in osinfo-db
2018-10-03 19:02:07 -04:00
Pino Toscano
8227b820ee osinfo: warn when using deprecated osinfo IDs
At some point in the future it could be a good idea to drop the _aliases
mapping altogether; it will be hard to do so, in case the users are not
informed that they are using a deprecated ID.

(crobinso: Tweak format and message)

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2018-10-02 11:41:34 -04:00
Cole Robinson
760dc32bac osdict: Clarify comment about rhel virtio-serial hack 2018-10-01 11:39:58 -04:00
Cole Robinson
ff3d6c65d8 Fix some pep8 warnings 2018-10-01 11:37:28 -04:00
Cole Robinson
b2e7986c7b osdict: Switch device lookups to be ID based
I'm not positive device names will never change, but presumably the IDs
won't, so use them instead
2018-10-01 11:24:45 -04:00
Cole Robinson
b19f94299b details: Add OS name view/edit, + oslist rework
This is just a big nasty commit.

Turn the OS inspection page into an always available page that
shows the libosinfo name from the domain metadata XML. Use oslist.py
and have it absorb more of the common behavior needed by create.py
and details.py. Add UI tests for it all
2018-09-30 20:55:32 -04:00
Cole Robinson
65e1187c10 osdict: Add a helpful __repr__ 2018-09-30 09:37:14 -04:00
Cole Robinson
31e4b72a8b osdict: Drop Glib.Date API usage
Use python datetime instead, it's more python friendly
2018-09-29 15:22:44 -04:00
Cole Robinson
7356afcca7 osdict: Use USB tablet if no OS specified
Most OS users will be installing benefit from it, so make it the
default
2018-09-29 13:36:42 -04:00
Cole Robinson
86ef998023 guest: Lookup osinfo object from libosinfo metadata XML 2018-09-13 15:03:36 -04:00
Cole Robinson
2549e60698 guest: Add an entry point for setting machine=q35 default
We will want this at some point, but it's dependent on libosinfo
work
2018-09-12 15:35:49 -04:00
Cole Robinson
242844fefa osdict: Make the broken uefi+hyperv bit more explicit
And add links to the relevant bug reports
2018-09-04 14:55:40 -04:00
Cole Robinson
d5638eb140 osdict: Make qemu_ga support solely dependent on virtio-serial support
We shouldn't concern ourselves with whether the OS supports qemu_ga
out of the box, just set up the channel regardless, as long as
virtio-serial is supported.

This adds the channel for some aarch64 cases which didn't have OS
specified, but that's desired IMO
2018-09-01 13:23:01 -04:00
Cole Robinson
0f3b7fcc26 osdict: Make sure virtio1.0 matches virtio lookups
Right now this doesn't matter, but possibly a future OS will only
support virtio1.0, and osdict metadata might break us in that case
2018-09-01 13:23:01 -04:00
Cole Robinson
8a87c91888 osdict: Move default_netmodel logic to Guest
Make the entry point just return a list of libosinfo device names,
and have Guest choose the preference. This is more future proof
2018-09-01 13:23:01 -04:00
Cole Robinson
b902fbd54f osdict: Move default_videomodel to guest
It's not really osdict specific
2018-09-01 13:23:01 -04:00
Cole Robinson
717cd87b16 osdict: Add helpers for device filtering 2018-09-01 13:23:01 -04:00
Cole Robinson
4e63267a4f urldetect: Rename urldistro to matching_distros
Allow store classes to track multiple matching types, and use this
to ditch the custom urldistro logic in osdict altogether
2018-09-01 13:23:01 -04:00
Cole Robinson
9330548c3c osdict: Move EOL calculation to its own function 2018-09-01 13:23:01 -04:00
Cole Robinson
6ae8e51901 osdict: Remove unused functions 2018-09-01 13:23:01 -04:00
Cole Robinson
d8514e19c8 guest: Drop arm vexpress virtio-mmio support
This case will still work, but be a bit slower, which is fine. Nowadays
-M virt is much better for virt usage and nearly everyone is using that,
so save us the complication. This was really only useful when
bootstrapping arm virt support
2018-08-31 17:31:09 -04:00
Cole Robinson
e59c3d969e guest: Remove old xen acpi disabling
This is only for rhel5 vintage xen which is long out of support,
so drop it
2018-08-21 16:35:34 -04:00
Daniel P. Berrangé
d52d9885c8 Redesign OS distro selection UI to be faster to use
The current OS distro selection UI is fairly cumbersome to use. First
you need to decide on a variant, then decide a distro and then look for
the version you want. The list is filtered by default so only a subset
of OS are displayed. So for less common distros you'll then need to
start again and tell it to show all OS to try to find the one you want.

The core problem is that we have an incredibly large list and want to
make it easy for the user to find a specific entry. The modern UI
paradigm for this problem is to provide interactive search with
live updated results. The current UI does provide an interactive search
facility on the OS version results, but you still have to first select a
variant to be able to use the search which is unhelpful.

This patch attempts to better apply the search UI design to the OS selection
problem. We get rid of the notion of variants, distros and version, and
provide a single text entry box in which the user can type a few letters
of the OS name. As they type, a popover displays the matching results
filtered on OS name. By default end of life OS will be hidden, so in
general there will only be a small handful of results left after just
typing a few characters. This makes it very quick to find and select the
desired OS, without needing to provide a mutli-step navigation hierarchy.

https://bugzilla.redhat.com/show_bug.cgi?id=1464306

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

(crobinso: fix some pylint)
2018-05-01 11:31:39 -04:00
Daniel P. Berrangé
48e32b429d Fix copyright header to specify GPLv2 or later, not GPLv2 only.
The copyright headers in every file were chjanged in this previous commit

  commit b6dcee8eb7
  Author: Cole Robinson <crobinso@redhat.com>
  Date:   Tue Mar 20 15:00:02 2018 -0400

    Use consistent and minimal license header for every file

Where before this they said "

  "either version 2 of the License, or (at your option) any later version."

Now they just say

  "GNU GPLv2"

This fixes it to say "GNU GPLv2 or later" again.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-04 16:51:37 -04:00
Cole Robinson
fb9b82e02d urldetect: Clean up Fedora version checking a bit 2018-04-02 16:47:21 -04:00
Cole Robinson
b6dcee8eb7 Use consistent and minimal license header for every file 2018-03-21 07:29:40 -04:00
Radostin Stoyanov
978fb25ac7 Wrap keys(), values() in a list
In Python 3 dict.values() [1] , dict.keys() [2] and dict.items() [3]
return a view [4] of the dictionary’s values, keys and items.

In Python 2 these functions return a list. [5] [6] [7]

To resolve this we can convert the result of these function to a list.

[1] https://docs.python.org/3/library/stdtypes.html#dict.values
[2] https://docs.python.org/3/library/stdtypes.html#dict.keys
[3] https://docs.python.org/3/library/stdtypes.html#dict.items
[4] https://docs.python.org/3/library/stdtypes.html#dict-views
[5] https://docs.python.org/2/library/stdtypes.html#dict.items
[6] https://docs.python.org/2/library/stdtypes.html#dict.keys
[7] https://docs.python.org/2/library/stdtypes.html#dict.values
2018-02-06 18:49:17 -05:00
Chen Hanxiao
7f1b4cee82 pycodestyle: fix all E125 warnings
Fix all E125:
     Continuation line with same indent as next logical line

   Also remove ignore options of E125

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-10-21 23:26:16 +08:00
Chen Hanxiao
c92aade081 pycodestyle: fix all E203 warnings
Fix all E203 whitespace before ':'
   Also remove E203 ignore option of pycodestyle

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-08-11 00:01:38 +08:00
Radostin Stoyanov
b93cc3bbc9 pycodestyle: Do not use bare 'except:'
A bare 'except:' catches all exceptions [1], including SystemExit,
KeyboardInterrupt, and GeneratorExit (which is not an error and should
not normally be caught by user code). In situations where you need to
catch all “normal” errors, you can catch the base class for all normal
exceptions, Exception [2].

[1] https://docs.python.org/2/howto/doanddont.html#except
[2] https://docs.python.org/2/library/exceptions.html#Exception
2017-08-02 13:57:43 -04:00
Pino Toscano
7866cfec1b osdict: add "macos" type
Give macOS OSes an own type, so they have their own entry in the list of
OS types.
2017-04-27 15:57:40 -04:00
Pino Toscano
fa9ee6cd94 osdict: rename "unix" type to "bsd"
It really holds BSD OSes, so rename it to match the reality.
2017-04-27 15:57:40 -04:00
Pino Toscano
03c9a4ff41 osdict: expose the distro from OsVariant
This is used already internally a couple of times, and will be useful
outside as well.
2017-04-27 15:57:40 -04:00
Bryan Quigley
984ba6b33e osdict: Remove ubuntu vmvga usage
This is now removed in patches on Ubuntu, so seems no longer necessary.

virt-manager-1.3.2/debian/patches/virtinst/use_qxl_for_ubuntu.patch

That patch is also from Marc Deslauriers on 2016-01-28
2017-04-19 10:03:17 -04:00
Pino Toscano
6b23810733 virtinst: tweak distros in the 'supported' workaround
- pick only the latest version for centos6.x, centos7.x, and
  freebsd11.x; the latter two have only one element each currently,
  so this is preparing for future versions
- bump the minimum supported version of Fedora to 24
- enable also mageia >= 5, and centos >= 7.0, since they are supported

Hopefully in the future we can reduce these checks (maybe accepting
directly some families), but for now improve our hacks.
2017-04-13 14:20:02 -04:00
Cole Robinson
d62e975568 guest: Add default virtio-rng /dev/urandom (bz 1212082)
For guests that support it, per libosinfo, and new enough libvirt
to handle /dev/urandom. See the bug for discussion

https://bugzilla.redhat.com/show_bug.cgi?id=1212082
2017-03-08 17:26:19 -05:00
Cole Robinson
617b92710f osdict: Don't return virtio1.0-net as a valid device name (bug 1399083)
We can't depend on libosinfo device names being valid libvirt network
model names, so use a whitelist

https://bugzilla.redhat.com/show_bug.cgi?id=1399083
2016-12-13 12:58:14 -05:00
Guido Günther
a26c656d5c osdict: Debian8 onwards has qemu-ga 2016-10-31 09:07:33 -04:00
Cole Robinson
f55772845a osdict: Remove some pylint 2016-08-09 11:53:44 -04:00
Cole Robinson
1d2cd30677 osdict: Fix incorrect usage of virtio input
Regression reported with latest libosinfo, when the OS reports
virtio-input support:

http://www.redhat.com/archives/virt-tools-list/2016-July/msg00109.html

Really our code presently only cares about the USB tablet, so adjust
our libosinfo lookup to explicitly check for it
2016-07-29 13:17:36 -04:00
Andrew Cook
1421772e4e Disable x2apic for solaris 11
Same hack that 10 needs
2016-03-24 14:15:49 -04:00
Marc-André Lureau
ea1bd169c1 virtinst: use virtio if spice+gl
Use virtio+accel3d by default whenever spice+gl is chosen. This allows
to easily set up accelerated gpu VM.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-03-09 20:25:37 -05:00