Commit Graph

6344 Commits

Author SHA1 Message Date
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
Cole Robinson e7cdb695c3 test_urls: debian8 urls are dead, remove them 2019-03-24 11:14:47 -04:00
Andrea Bolognani 7b9de27a99 guest: Add default RNG to s390x guests
As long as it's supported by both QEMU and the guest OS,
there's really no reason not to add it.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-21 14:16:28 -04:00
Jim Fehlig 8d9743d69f virt-install: Add support for xenbus controller
libvirt commit 09eb1ae0 added support for a new 'xenbus' controller
type. Add support for the controller in virtinst, including support
for the maxGrantFrames attribute.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2019-03-21 14:15:40 -04:00
Cole Robinson 7afbb90b4d virt-xml: Handle VM names that look like id/uuid (bz 1679025)
Previously we assume they are id/uuid, so if it's actually the VM
name then the command fails. Now we always check for a name first,

https://bugzilla.redhat.com/show_bug.cgi?id=1679025
2019-03-21 13:45:58 -04:00
Andrea Bolognani f23b01be53 guest: Add VirtIO input devices to s390x guests with graphics
We're not including any input devices in the generated XML
for s390x guests, and the results is that it's not possible
to interact with them short of using the serial console or
connecting through ssh, which is fine but probably not what
is expected when graphics are present.

USB input devices are not a good fit for s390x guests: USB
requires PCI, and PCI is not widely available or used on
s390x; VirtIO devices, on the other hand, are a perfect
match since s390x guests use basically no emulated devices
and rely on VirtIO for most functionality.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-21 15:31:20 +01: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
Andrea Bolognani 5dad99216e guest: Add USB input devices to pSeries guests with graphics
libvirt already does this for us, sort of: it will automatically
add a USB keyboard and mouse to ppc64 guests with graphics;
in addition, these devices are impossible to remove.

Unfortunately this results in a pretty poor experience for the
user, since the relative pointing device makes interacting with
the GUI an exercise in frustration.

As of commit 186bb479d0f4, libvirt will still add the USB
keyboard automatically but will skip the USB mouse if a USB
tablet is already present, so by explicitly including USB input
devices in the generated XML we can create guests that are
actually usable.

We can do this unconditionally, without having to worry about
what version of libvirt we're running against: if it's new
enough we'll take advantage of the fix, and if not then the
resulting guest will not be any more broken than it would have
been before.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-21 15:31:20 +01:00
Andrea Bolognani 6a24a2a13a tests: cli: Add simple guests with graphics
These cover the use case "I want to get an existing guest
image running in the cloud, and I need graphics".

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-21 15:29:46 +01:00
Andrea Bolognani e5b8c97896 tests: cli: Add simple headless guests
These cover the use case "I want to get an existing guest
image running in the cloud, and I don't need graphics".

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-21 15:28:25 +01:00
Andrea Bolognani d409c76848 tests: cli: Drop existing aarch64-graphics test
We're going to add a number of tests covering the same scenario
on multiple architectures soon, so this one is no longer needed
and would in fact cause a name clash if it stayed.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-21 14:54:04 +01:00
Pavel Hrdina fb5136a6a9 domain: cpu: automatically add CPU security features for "custom" mode
If user selects specific CPU model to be configured for guest we will
automatically add CPU security features to make sure that the guest is
not vulnerable to these CPU HW bugs.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-03-19 13:45:49 +01:00
Pavel Hrdina 6423f653fd domain: cpu: introduce set_model function
We will need to pass another variable into the setter so we cannot use
the property setter.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-03-19 13:45:49 +01:00
Pavel Hrdina 4a8b6363c0 domcapabilities: introduce get_cpu_security_features
Get all CPU security features that we should enable for guests.

In order to do that we need to get CPU definition from domain
capabilities and modify the XML so it is in required format for
libvirt CPU baseline APIs.  We will prefer the baselineHypervisorCPU
API because that considers what QEMU actually supports and we will
fallback to baselineCPU API if the better one is not supported by
libvirt.

This way we can figure out which of the security features are actually
available on that specific host for that specific QEMU binary.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-03-19 13:45:49 +01:00
Pavel Hrdina 95d1275f57 domcapabilities: get list of CPU models from domcapabilities
Currently we just call libvirt API which will return all CPU models for
specific architecture known to libvirt and we offer all of them to users
in GUI.  Let's switch to domain capabilities where we have more details
about these CPUs such as whether each model is usable with current QEMU
binary.  If libvirt can detect the usability we will offer only CPU
models that QEMU can actually run.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-03-19 13:41:53 +01:00
Pavel Hrdina 8183ba279c domcapabilities: fix CPUModel usable attribute
It is not True/False attribute, it can contain 'unknown' value as well
which means libvirt cannot figure out whether the CPU model is usable
with that specific QEMU binary.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-03-19 13:41:51 +01:00
Pavel Hrdina f7bdebc0de tests: capabilities: remove testCPUAPI
This test case is pointless, get_cpu_values() calls only libvirt API
which will return list of CPUs known to libvirt and we check whether
that list is correct.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-03-19 13:41:49 +01:00
Pavel Hrdina 8f870c3fca tests: xmlparse: use set_special_mode function
CPU mode is never set directly using mode attribute, instead we use
setter function with some extra logic that needs to be done.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-03-19 13:41:46 +01:00
Pavel Hrdina 9fdbbca27f domcapabilities: fix detection if host-model is safe to use
According to libvirt documentation for host-model [1] it is safe to use
it only if 'fallback' attribute is set to 'forbid', this indicates that
the libvirt and QEMU are new enough and can safely filter list of cpu
features that will be guaranteed to be visible inside of the guest.

[1] <https://libvirt.org/formatdomain.html#elementsCPU>

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-03-19 13:41:31 +01:00
Cole Robinson 74bbc3db15 urldetect: Check also for 'treeinfo' (bz 1689252)
Trees published to akamai CDN via Red Hat Satellite can't have .dotfiles
in them. More details here:

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

So we also need to check for .treeinfo. Anaconda does this too so it's
a long known issue.

https://bugzilla.redhat.com/show_bug.cgi?id=1689252
2019-03-18 14:24:07 -04: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 584ab2f05d kernelupload: Don't mark internal error as translatable (bz #1688101)
This message is not really informative or actionable for the user,
and difficult to explain to translators

https://bugzilla.redhat.com/show_bug.cgi?id=1688101
2019-03-15 13:44:05 -04:00
Christian Borntraeger 5bc847ebb0 virt-install: Do not warn about consoles on s390x
s390x guests usually detect the sclp or virtio console. The current
warning might actually break setups. Let us disable the warning.

Reported-by: Andre Wild <wild1@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-14 18:21:51 +01:00
Vasudeva Kamath 648115334d virt-install: Add driver_queues argument to --controller
<controller> can have additional <driver> sub element with queues as property,
which is currently not exposed via virt-install. This commit exposes this option
similar to queues in network configuration.

(crobinso: add test case)
2019-03-12 10:17:06 -04:00
Cole Robinson 81b26de46d tests: test_urls: centos5 detection works now 2019-03-12 09:50:28 -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 d97b528710 virt-install: Deal with "--cdrom" unattended installations
When dealing with unattended installation, we safely can assume that
"--cdrom" can be treated as "--location". The reason for that is that
we'll need to, under the hooks, extract its kernel/initrd and perform an
initrd injection.

This commit makes "--unattended" work properly when combined with
"--cdrom".

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-08 17:11:38 -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
Fabiano Fidêncio eae4ff3b42 unattended: Properly set the installation source
The installation source, which can be either "media" or "network",
should be properly set depending on whether we're installing from a
media or performing a tree based installation.

We have to mind here that any media that is set as "netinstall" variant
has to have its installation source set accordingly.

An different approach for this would be to generate the script
specifically from the media whenever a media is passed. However, IMO, it
would just add two new codepaths and having the media passed around
without a real gain against the method chosen.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-08 17:10:41 -05:00
Fabiano Fidêncio 0d4f50d001 installertreemedia: Pass media down to prepare_install_script()
Let's pass the media down to prepare_install_script() as it'll be used
to:
- select the preferred installation source;
- be passed down to the get_install_script() method;

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-08 17:04:40 -05:00
Cole Robinson b2402b278a installtreemedia: Grab libosinfo media from urldetect
This will be needed for upcoming unattended changes
2019-03-08 17:01:26 -05:00
Cole Robinson 9c5d252a2c unattended: bump minimum version based on set_installation_url
And silence pylint warnings on older libosinfo
2019-03-08 16:57:40 -05:00
Fabiano Fidêncio f49e49a560 installertreemdia: Set user specified --location as the installer URL
The location has to be passed down to the generate_install_script()
method whenever a tree based installation is being performed.

Although Libosinfo provides information about the URL to be used when
performing a tree based installation, cases where the users prefer to
use, for any specific reason, their own URLs should be covered as well.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-08 16:55:42 -05:00
Cole Robinson 4cf7e0066f urldetect: Always put libosinfo detection first
Even if we are shortcircuiting based on a passed os-variant value,
osinfo always gets priority
2019-03-08 16:54:57 -05:00
Cole Robinson 39590c4d1c urldetect: Move the store lookup shortcircuiting
...to _build_distro_list()
2019-03-08 16:54:26 -05:00
Cole Robinson 9688815237 urldetect: Rework _allstores building a bit
Rename it ALLSTORES since it's a global variable
Split out the building from the altering
2019-03-08 16:52:33 -05:00
Cole Robinson 18e60c5e47 devices: disk: drop dead s390 check
The scsi check above will always trigger for s390, so this path won't
ever be hit
2019-03-08 11:40:08 -05:00
Cole Robinson 32034c6847 Revert "devices: disk: Use virtio-scsi for CDROMs where supported"
This reverts commit a746150bef.

See discussion:
https://www.redhat.com/archives/virt-tools-list/2019-March/msg00058.html

Apparently some debian versions struggle with this. Let's stick with
the old method until there's a sufficiently compelling reason to change

Some adjustment is required to deal with changes added by later patches
2019-03-08 11:39:20 -05:00
Cole Robinson 6780bc0c0e tests: clitest: Tweak test input to match latest libvirt
rbd volumes no longer report format=raw. adjust the test input
to generate the expected output.
2019-03-06 14:35:15 -05:00
Andrea Bolognani 971f9d517d addhardware: Don't prevent ppc64/pseries from using virtio-scsi
This doesn't seem to do anything, as we end up with with a
virtio-scsi controller anyway both when using virt-install and
when using the GUI, and it's not correct anyway because there's
nothing preventing ppc64/pseries guests from using virtio-scsi.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-06 14:00:11 -05:00
Andrea Bolognani db6c7070e2 devices: disk: Don't prefer virtio-scsi for aarch64/virt
Back when this was introduced in 2014 (commit aa772f01e1) using
virtio-scsi instead of virtio-blk made sense, because virtio-pci
support on aarch64/virt was still not widely available and
virtio-mmio couldn't do hotplug.

These days, however, virtio-pci availability is something that
we can assume is present on any remotely reasonable deployment
target, so it's better to no longer behave differently than
other architectures.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-06 14:00:11 -05:00
Andrea Bolognani a746150bef devices: disk: Use virtio-scsi for CDROMs where supported
We already use virtio-blk for regular disks whenever possible,
and there's no good reason not to do the same with virtio-scsi
when dealing with CDROMs instead of artificially limiting its
use to s390x and ppc64/pseries guests.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-06 14:00:11 -05:00
Andrea Bolognani 47753eab26 guest: Use virtio-scsi where supported
Right now we're limiting use of virtio-scsi to ppc64/pseries
and aarch64/virt guests, but there's really no reason not to
use it wherever it's available.

This results in virtio-scsi being now used on s390x, where no
other sensible SCSI controller implementation is available
anyway, and x86, where you alreayd didn't want end up using
lsilogic.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-06 14:00:11 -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
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