Commit Graph

6349 Commits

Author SHA1 Message Date
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
Andrea Bolognani 1a1875be06 guest: Remove some SCSI-related dead code
The code in _add_implied_controllers() tries to add an ibmvscsi
controller if any disk with spapr-vio address type is found;
however, regardless of the specific SCSI controller in use, all
SCSI disks will use the drive address type, so that condition
will never be triggered - which is actually for the best, since
we want to use virtio-scsi on ppc64 anyway.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-06 14:00:11 -05:00
Cole Robinson 0c82a6b78c tests: uitests: Fix createpool with new libvirt collision checks 2019-03-06 13:46:24 -05:00
Cole Robinson 887ee45cf6 cli: Remove boot.order support check
Our support.py check is not exhaustive based on libvirt code checking.
Don't reject this case so users have a chance to make it work. The
support check is really more valuable in the UI where we can screw
things up easier.
2019-03-06 13:33:13 -05:00
Marc Hartmayer 908b8e8d7c tests: virt-xml: Add test cases for --start option
The test cases verify that:

 + --start works
 + --define --start works
 + --no-define --start works
 + --start works in combination with --add and --remove
 + combination of --start --update isn't valid
 + combination of --define --no-define --start isn't valid

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:38 -05:00
Marc Hartmayer 90b1a3ab7d virt-xml: Add support for starting the domain
Add support for starting the domain. By default, first the domain is
defined and then started. If the `--start` is used in combination with
`--no-define` a transient domain is created without persisting the
changes in the persistent domain definition.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:38 -05:00
Marc Hartmayer c2bff50977 tests: cli: Add test case for --no-define argument
Add a test case validating mutual exclusivity of `--no-define` and
'--define' arguments.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:38 -05:00
Marc Hartmayer 29f9f2ac9c virt-xml: Add --no-define argument
Add `--no-define` argument. It's mutually exclusive to the `--define`
argument and later on it allows the user to start a domain
transiently.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:38 -05:00
Marc Hartmayer c896d19d76 tests: cli: Add boot.order tests
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:38 -05:00
Marc Hartmayer b83a0a61a0 cli: Use reorder_boot_order for setting the boot order
Use the newly introduced method `reorder_boot_order` for setting
the boot index of a device. This ensures that all other boot order
values of domain guest definition are adjusted accordingly.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:38 -05:00
Marc Hartmayer 1b53594002 tests: Add test case for reorder_boot_order method
Add a test case for `reorder_boot_order`. It verifies that the OS boot
order is removed and that all other boot order indices are adjusted
accordingly.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:38 -05:00
Marc Hartmayer c9d070da4c guest: Add reorder_boot_order method
Add `reorder_boot_order` method to Guest class. It sets the boot order
of the passed `dev` to `boot_index` and adapts all other boot indices
of the guest accordingly.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:38 -05:00
Marc Hartmayer ecc0861c89 tests: xmlparse: refactor method for generating out file path
Refactor method for generating out file path. It will be used in a
upcoming patch.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:38 -05:00
Marc Hartmayer 7768eb17d9 cli: Add check if device boot order is supported
Add a check if device boot order is supported to
Parser(Network|Disk|Redirdev|...) and throw an exception if not.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:38 -05:00
Marc Hartmayer ee5f3eab4b support: Add SUPPORT_CONN_DEVICE_BOOT_ORDER
...and use it in domain.py.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:34 -05:00
Marc Hartmayer 5bad22e837 tests: Use (get|set)_prop
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:13:13 -05:00
Marc Hartmayer 60c7e778e3 xmlapi: add set_prop
Introduce set_prop helper function. It will be used in the next patch.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:13:13 -05:00
Marc Hartmayer adf30349c3 cli: refactor get_prop
Refactor get_prop since it will be used in the next patches at other
places as well.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:13:13 -05:00
Cole Robinson 1856c1fa65 support: Fix minimum version check
The original code for this was about version 0.7.3, but a refactor
accidentally changed it to 0.7.9 which is a libvirt version that
doesn't exist. Fix it
2019-03-06 13:06:54 -05:00
Pavel Hrdina a02fc0d022 virtManager: clone: build default clone path if we know how
Function do_we_default returns only if we want to default to clone disk
even if we know how to create default clone path.  Only in case that the
storage pool is TYPE_DISK we don't know how to create default path and
we cannot default to clone that disk.  In all other cases as ReadOnly
disk or Shareable and so on we can prepare the default path for user if
they decide to clone it.

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

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-03-06 17:19:00 +01:00
Lin Ma f6a6c58a36 Use changed instead of value-changed signal in spinbutton in vsockdetails ui
Signed-off-by: Lin Ma <lma@suse.com>
2019-03-05 16:56:26 -05:00
Cole Robinson 4e13bc6b19 installertreemedia: Log unattended script contents 2019-03-05 16:38:22 -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 8e53ee15f2 cli: Don't error on --disk size=X with missing --name
We will fail later with missing --name, but don't throw an error
generating disk paths before that
2019-03-05 16:38:22 -05:00
Cole Robinson 3a29b40af6 virt-install: Error earlier when --unattended is missing --os-variant 2019-03-05 16:38:22 -05:00
Cole Robinson de8a0754de cli: Use consister ParseX class naming 2019-03-05 16:38:22 -05:00
Cole Robinson d470019cda tests: osdict: Add more install script testing 2019-03-05 16:38:22 -05:00
Cole Robinson 1f6879c811 unattended: Split out make_installconfig
The building process here is mostly independent of the InstallScript
object. Moving it to its own function makes that more clear, makes
InstallScript smaller, and the code is indented less
2019-03-05 16:38:22 -05:00
Cole Robinson e87e3a71fe unattended: Improve some error reporting
* Explicitly error if libosinfo is too old
* Fix an error string
* disable pylint errors on old libosinfo
2019-03-05 16:38:22 -05:00
Cole Robinson 5126694fa7 unattended: Add generate_install_script
Split out from prepare_install_script. Makes things easier to
unit test.
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
Cole Robinson a3147e95db tests: osdict: test basic get_install_script 2019-03-05 16:38:22 -05:00
Fabiano Fidêncio 49e21723b3 virt-install: Make --unattended useful
--unattedend now can be used to perform tree based installations.

The way it's implemented, it takes advantage of the code we currently
have for setting --os-variant install="location|cdrom".

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-05 16:38:22 -05:00
Fabiano Fidêncio a0aebf77e8 virt-install: --unattended conflicts with --initrd-inject and --extra-args
As --unattended will take care of generating the install script to be
inject in the initrd and also of the kernel command line to be used
during the installation, we should not mix whatever user is passing as
--initrd-inject or --extra-args when using --unattended.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-05 16:38:22 -05:00
Fabiano Fidêncio 14991ef726 installertreemedia: Perform a unattended installation
In case the InstallerTreeMedia has any unattended_data set, let's just
generate the install script and have everything set up for performing a
unattended installation.

path is appended to the tmpfiles as it's the generated unattended script
and it has to be cleaned up when no longer needed.

cmdline is preppended to the args gotten from _prepare_kernel_url() in
order to be used during the first OS boot (and only there!).

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-05 16:38:22 -05:00
Fabiano Fidêncio b64219eb13 installer: Add set_unattended_data() method
The new method will be used to pass down the unattended_data to the
InstallerTreeMedia class.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-05 16:38:22 -05:00
Fabiano Fidêncio 44a3539c7c installertreemedia: Add unattended_data to the class
unattended_data will be used when we add support for unattended
installations. It'll be passed down to the helper that's responsible for
actually generating the script and the kernel command line to be used
with it during prepare(); nevertheless, the addition does nothing right
now.

Together with the addition of the unattended_data, a setter has been
added.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-05 16:38:22 -05:00
Fabiano Fidêncio e5e0c33156 unattended: Add helper method to generate the install script
generate_install_script() is a helper that will do all the needed
plumbing related to create, populating and generating the install script
and its config.

The method returns the path to the generated install script and the
kernel command line to be used with it.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
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