Commit Graph

6450 Commits

Author SHA1 Message Date
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
Fabiano Fidêncio
e8893f2178 virt-install: Add --unattended
--unattended is currently a no-op parameter that will be used to perform
unattended installations.

For now, if someone tries to use --unattended virt-install will fail as
the option is still not supported.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-05 16:38:22 -05:00
Pavel Hrdina
b206931eb9 virtManager: domain: override rename_domain in vmmDomainVirtinst
If user renames guest in VM details page before installation starts
there is no need to rename NVRAM file as well.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-03-05 15:49:23 +01:00
Cole Robinson
ef279273af virt-manager: add --show-domain-delete
Launches delete wizard on top of a VM window, so when domain is
deleted, VM window disappears and the whole app exits
2019-03-04 14:04:34 -05:00
Cole Robinson
4f66c423f7 cloner: Handle --nonsparse for qcow2 images (bz 1675743)
https://bugzilla.redhat.com/show_bug.cgi?id=1675743
2019-03-04 14:04:34 -05:00
Pavel Hrdina
26a433fc42 virtManager: clone: check which storage pools supports volume cloning
When cloning a guest in virt-manager the GUI shows a list of disks and
select default cloning policy for every disk.  For storage pools where
we know that cloning is not possible we should not select that option
as default one.

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

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-03-04 13:23:45 +01:00
Cole Robinson
be15a01bb2 tests: test_urls: require explicit distro= value
Most tests have a distro= value specified already. Make distro=none
required for those tests since they are limited
2019-03-02 16:52:24 -05:00
Cole Robinson
ad53d59038 kernelupload: Revive upload support check
Needed so that test_urls doesn't fail attempting to upload
2019-03-02 16:25:55 -05:00
Pavel Hrdina
7672b1b010 virtinst: cli: fix ParserBoot to return the parsed object
This fixes virt-xml to return an XML for command:

    virt-xml --build-xml --boot os_type=hvm

The VirtCLIParser.parse() expects the _parse() method to return
the parsed object.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-03-01 16:47:56 +01:00
Pavel Hrdina
57db41854c virt-clone: fix force-copy of empty cdrom or floppy disk
There is nothing to copy so don't try to generate new path.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-02-28 18:05:31 +01:00
Pavel Hrdina
6f5762ab1f guest: remove useless has_virtio_scsi variable
Apart from the fact, that 'virtio' is not a valid scsi controller model
the 'has_virtio_scsi' variable is not needed at all.  It is used only
in one condition where both 'has_any_scsi' and 'has_virtio_scsi' has to
be false which can happen only if there is no 'scsi' controller defined
by user.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-02-28 15:36:24 +01:00
Pavel Hrdina
a0b42327c6 graphics: move all listen code into one place
Instead of duplicating the code into CLI and GUI move it into graphics
device file which is used from both places.  This also fixes a bug in
virt-xml where changing listen to address was not working.

This also changes behavior to always configure one listen type when
using CLI listen option or GUI.  If user wants to modify only specific
listen type they can use listens[] options from CLI.

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

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-02-28 11:48:09 +01: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
05f4abe0d7 tests: Add osdict get_location/--os-variant install=X tests
Just failure coverage for the command line so far, we will need
some new infrastructure to test more than that
2019-02-18 11:17:57 -05:00
Cole Robinson
d48ea2f5ff virt-install: Explicitly fail on bad os-variant install=X 2019-02-18 11:17:57 -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
5f7d49d6a3 virt-install: Deal with os-variant's install param
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@redhat.com>
2019-02-14 13:33:48 -05:00
Fabiano Fidêncio
cbe84879db cli: Add "install" parameter to os-variant
The new "install" parameter receives "location|cdrom" and will be used,
at least for now, to automatically get the URL location of an OS from
osinfo-db.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-02-14 13:33:48 -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
e103aab7cc virt-install: Set options.disk if the value comes from osinfo-db
Commit 45ab922b2c moved the code to the way it was before the libosinfo
default changes. However, by not setting "options.disk" the parser will
error out and bail the installation as this option must be set. Only
parsing the disk doesn't seem to be enough as the check is actually done
against "options.disk".

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-02-14 13:33:48 -05:00
Cole Robinson
ae8a4f3db3 engine: Fix first run startup error (bz 1674040)
unitpath can be used uninitialized

https://bugzilla.redhat.com/show_bug.cgi?id=1674040
2019-02-08 15:50:15 -05:00
Cole Robinson
fb5aadc636 guest: Move compare_device to Device class
It operates on a Device object, so it makes sense
2019-02-07 17:42:55 -05:00
Cole Robinson
10973c7932 guest: Add find_device to Guest
It operates on a Guest object, so it makes sense
2019-02-07 17:36:10 -05:00
Marc Hartmayer
8d185f3e4b guest: Don't ignore invalid boot_order inputs
A `KeyError` indicates that the `boot_order` input was
invalid. Therefore we shouldn't ignore this error silently.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
2019-02-07 17:15:50 -05:00
Marc Hartmayer
1369549aab guest: Don't exclude redirected devices
Don't exclude redirected devices since they're also bootable. They
won't clutter the UI of virt-manager as we're excluding them
explicitly for the UI in the `get_bootable_devices` method defined in
virtManager/domain.py.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:50 -05:00
Marc Hartmayer
12e8456da2 domain: Move set boot order responsibility to guest
Move set boot order responsibility to guest XML builder.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:50 -05:00
Marc Hartmayer
c5f8f3e640 guest: Add get_boot_order method
Add 'get_boot_order' method. This method has an optional parameter for
getting the legacy boot order defined in the OS node of the domain
definition.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:50 -05:00
Marc Hartmayer
853237aebc domain: Move get boot order methods to guest
Move get boot order methods to guest XML builder. For this we must
replace self.get_bootable_devices() with
self.get_bootable_devices(exclude_redirdev=True) in the
_get_device_boot_order and set_device_boot_order to have no
functionality change.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:50 -05:00
Marc Hartmayer
d0c2750da5 domain: Move use_device_boot_order to guest
Move use_device_boot_order to guest XML builder and rename it into
'set_device_boot_order'.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:50 -05:00
Marc Hartmayer
f06a16bffd domain: Try to untangle __use_device_boot_order
Operate only on @boot_order and @guest and not on @self. This allows
us to refactor this functionality in the next patch. Additionally,
simplify the used algorithm without functionality change.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:49 -05:00
Marc Hartmayer
e6c14e2e79 domain: Try to avoid self access since we're operating on guest
Try to avoid self access since this function operates on the guest
definition only. This is needed for later refactoring as it will
reduce side-effects.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:49 -05:00
Marc Hartmayer
735d8b75c9 domain/guest: Add get_bootable_devices() method
Add a method to the Guest XMLBuilder for getting all bootable devices
of the guest definition with the option to exclude the redirdevs in
the returned list.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:49 -05:00
Marc Hartmayer
3365838b1b Move (find|compare)_device to guest.py
Move (find_compare)_device functions to guest.py as it will be used
there in an upcoming patch.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:49 -05:00
Cole Robinson
8a02081ebf cli: Add --os-variant full_id=X sub option
For specifying a distro via the full osinfo URL ID
2019-02-07 16:29:38 -05:00
Cole Robinson
4a2ff83b51 cli: Parameterize --os-variant
For now it just takes a single name= parameter that maps to
the current behavior
2019-02-07 16:27:01 -05:00
Cole Robinson
1ad1c2acd1 virt-install: Drop --os-variant tolower()
This could break some command line invocations, but there's no
guarantee libosinfo might not add capitalized IDs in the future,
and there's an easy workaround to just lowercase the passed value
2019-02-07 16:05:12 -05:00
Cole Robinson
a9eecd591c cli: Rename options.distro_variant to options.os_variant
We don't really use the 'distro' naming any more, and the
command line option is called os_variant, so stick with that
2019-02-07 15:48:40 -05:00
Cole Robinson
ada5b49d3b virt-install: Remove remote URL error
This is for very old libvirt versions. Just let it fail later on
2019-02-07 15:22:48 -05:00
Cole Robinson
91cdb485cb virt-install: Drop xenpv install warnings
These may still be relevant, but I think it's fine just to let
the config fail to install. I'm not even sure if anyone is trying
xenpv these days...
2019-02-07 15:13:30 -05:00
Cole Robinson
a5e01c947d virt-install: set_install_defaults before disk validation
So we validate the CDROM disk contents too. This revealed we were
using a cdrom path in the test driver that was assigned as a
writeable disk to another test VM, which is a correct warning, so
fix the fallout, and ensure that we don't warn when colliding with
another cdrom device
2019-02-07 15:00:27 -05:00
Cole Robinson
45ab922b2c virt-install: Parse option strings before installer creation
This is how it was before the libosinfo defaults changes. In general
this pattern is more sensible: we serialize all the Guest data, then
create the installer which acts on a Guest, then fill in any missing
config with libosinfo bits.

We need to manually parse a disk option string now which is a bit funky
2019-02-07 14:51:28 -05:00
Cole Robinson
0afe0c1797 virt-install: Break out set_resources_from_osinfo 2019-02-07 14:38:32 -05:00
Cole Robinson
951aba41b9 virt-install: Split apart set_distro_variant
There's two cases: for an explicitly requested --os-variant, we
want to set it ASAP, since more things will depend on it in the
future, like grabbing install media from libosinfo. For the
'auto' case, we need to wait until the installer is setup.
2019-02-07 14:30:00 -05:00
Cole Robinson
6e4b4a5cba virt-install: Simplify convert_old_os_options 2019-02-07 14:09:37 -05:00
Cole Robinson
bc98c21758 installer: Remove need_scratchdir
create.py doesn't really need to know about it. It just needs to know
what paths the install process is going to be accessing.
2019-02-07 13:58:55 -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
Fabiano Fidêncio
0aebc73793 installer: Don't call _cleanup() when starting an installation
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-02-07 11:50:45 -05:00
Pino Toscano
1018ab4484 inspection: handle failures in application listing
The Python binding of libguestfs errors out in case any of the details
(e.g. summary, description) of an application are not proper UTF-8.
This seems a rare situation, which nevertheless causes the failure of
the inspection of a guest, making the rest of the metadata not used.

While these encoding issues are tackled, and fixed in python-libguestfs
(or libguestfs itself), gracefully handle the failure of
inspect_list_applications(), so at least the rest of the details of a
guest are used/shown.
2019-02-07 09:59:28 -05:00
Cole Robinson
af63426970 Update translations 2019-02-07 09:58:25 -05:00
Cole Robinson
c6dd050147 netlist: Assume type=network if source/@network present (bz 1669265)
When a VM is using interface type=network with a forward mode=bridge
network, on qemu domain startup the runtime XML will be changed to
type=bridge and both source/@bridge and source/@network will be filled
in, which breaks some assumptions virt-manager had internally.
Unfortunately this isn't easy to test with the unittest driver either.

https://bugzilla.redhat.com/show_bug.cgi?id=1669265
2019-02-04 17:43:42 -05:00