Commit Graph

1541 Commits

Author SHA1 Message Date
Fabiano Fidêncio 0f1acc9f8f osdict: Always return the most generic tree
Some OSes, as Fedora, have variants (which we rely to be standardised on
osinfo-db side), which we can use to return the most generic tree
possible, in case no profile is specified, in order to avoid failing to
install a "Workstation" system because a "Server" variant tree was used.

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

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-09-11 16:22:40 -04:00
Cole Robinson 0eb571f9e1 cli: Add --tpm backend.encryption.secret=
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-09-04 08:29:58 -04:00
Menno Lageman 0254558e6e cli: add --features kvm.hint-dedicated.state=
QEMU version 2.12.1 introduced a performance feature under commit
be7773268d98 ("target-i386: add KVM_HINTS_DEDICATED performance hint").
Support for this performance hint was added in libvirt 5.7.0 by commit
cb12c59dac04 ("qemu: support for kvm-hint-dedicated performance hint").

This patch extends virt-install's existing --features option to insert the
appropriate XML into the guest definition if this feature is specified
on the command line.

    E.g. --features='kvm.hint-dedicated.state=on' would result
    in the following XML:

      <features>
        ...
        <kvm>
          <hint-dedicated state='on'/>
        </kvm>
        ...
      </features>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Menno Lageman <menno.lageman@oracle.com>
2019-09-03 14:04:18 -04:00
Cole Robinson 1f0c262051 cli: Add --controller driver.iothread
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-08-28 13:17:32 -04:00
Cole Robinson cee3f6b48e cli: Add --disk driver.iothread
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-08-28 12:43:56 -04:00
Athina Plaskasoviti 2e49041d85 cli: Add --clock timer[0-9]*.catchup options
Added:
-timer[0-9]*.catchup.threshold
-timer[0-9]*.catchup.slew
-timer[0-9]*.catchup.limit

Catchup attributes need timer with assigned tickpolicy=catchup.

XML Mapping:

<clock>
  ...
  <catchup threshold="X" slew="X" limit="X"/>
  ...
</clock>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-08-19 15:39:47 -04:00
Athina Plaskasoviti cc60d558c0 cli: Add --cputune memorytune options
--memorytune[0-9]*.vcpus
--memorytune[0-9]*.node[0-9]*.id
--memorytune[0-9]*.node[0-9]*.bandwidth

XML Mapping:

<cputune>
  ...
  <memorytune vcpus="X">
    <node id="X" bandwidth="X"/>
  </memorytune>
  ...
</cputune>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-08-19 15:39:47 -04:00
Athina Plaskasoviti 9cea262b85 cli: Add --cputune cachetune options
- cachetune[0-9]*.vcpus
- cachetune[0-9]*.cache[0-9]*.level
- cachetune[0-9]*.cache[0-9]*.id
- cachetune[0-9]*.cache[0-9]*.type
- cachetune[0-9]*.cache[0-9]*.size
- cachetune[0-9]*.cache[0-9]*.unit

XML Mapping:

<domain>
...
  <cputune>
  ...
    <cachetune vcpus="X">
      <cache level="X" id="X" type="X" size="X" unit="X"/>
    </cachetune>
  ...
  </cputune>
...
</domain>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-08-19 15:39:47 -04:00
Cole Robinson 92f6109eef tests: osdict: Add coverage testing for driver helpers
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-08-06 17:59:05 -04:00
Athina Plaskasoviti 7f8648c53d cli: Add --boot initdir, inituser, initgroup options
XML Mapping:

<os>
...
<initdir>X</initdir>
<inituser>X</inituser>
<initgroup>X</initgroup>
...
</os>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-08-03 19:34:18 -04:00
Cole Robinson e77066b713 osdict: Use get_short_id_list
Some osed have multiple short-ids, like debian10 also has debianbuster.
Use the API if it's available. This will make it easier to remove
our back compat aliases eventually
2019-08-01 18:57:36 -04:00
Cole Robinson b85a5558f9 tests: Fix testsuite with older libosinfo
We need to handle if get/set_installation_url is missing
2019-07-31 17:43:49 -04:00
Athina Plaskasoviti e70ead5098 cli: Add --blkiotune device[0-9]*.read_bytes_sec/write_bytes_sec/read_iops_sec/write_iops_sec options
XML Mapping:

<blkiotune>
  <device>
    ...
    <read_bytes_sec>X</read_bytes_sec>
    <write_bytes_sec>X</write_bytes_sec>
    <read_iops_sec>X</read_iops_sec>
    <write_iops_sec>X</write_iops_sec>
    ...
  </device>
</blkiotune>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-07-25 19:13:13 -04:00
Athina Plaskasoviti 9afe51a0f8 cli: Add --keywrap cipher[0-9]*.name=aes|des, cipher[0-9]*.state=on|off
XML Mapping:

<domain>
...
  <keywrap>
    <cipher name="X" state="X"/>
  </keywrap>
...
</domain>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-07-23 16:59:32 -04:00
Cole Robinson 567463a07c tests: Drop iso symlinking
This was originally added so we had stable paths in the XML. It's
not required anymore, and if it becomes an issue we should fix it
by scrubbing the compared xml
2019-07-17 17:47:46 -04:00
Cole Robinson 2897951ce1 tests: Drop os.system calls
Use python native code instead. This seems to avoid an occasional
crash or abort of some sort with latest libosinfo
2019-07-17 16:54:59 -04:00
Cole Robinson f4d62660f1 tests: Don't use the root logger
Stops logging spam from requests
2019-07-16 16:53:22 -04:00
Cole Robinson 0df8577e11 test_urls: dont try ftp:// with --force-libosinfo 2019-07-16 16:53:14 -04:00
Cole Robinson 3eeef679da test_urls: Remove dead mageia link 2019-07-16 16:53:08 -04:00
Athina Plaskasoviti 2b24a85884 cli: Add --clock timer[0-9]*.track, timer[0-9]*.mode, timer[0-9]*.frequency options
XML Mapping:

<clock>
...
  <timer track="X" mode="X" frequency="X"/>
...
</clock>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-07-15 16:11:51 -04:00
Cole Robinson a15770fbaf Fix codespell errors 2019-07-12 16:10:39 -04:00
Cole Robinson 0c223ab21f guest: Don't set default uefi if firmware= is set 2019-07-12 16:01:21 -04:00
Fabiano Fidêncio e5980863dd unattended: Always set "media" as install-source for ISOs
Let's set "media" as installation source for all the ISOs, even the
net-installer ones, as this can be dealt with on osinfo-db side.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-12 15:07:22 -04:00
Cole Robinson e678d94b45 tests: Add debian10 URL testing 2019-07-11 14:29:17 -04:00
Cole Robinson aaa065d38e createpool: Add more coverage testing 2019-07-03 19:37:01 -04:00
Cole Robinson 616a7f2dd5 createpool: Simplify LVM volume group UI
Only show the volgroup name, and nothing else, which is all mostly
extraneous

https://bugzilla.redhat.com/show_bug.cgi?id=1316977
2019-07-03 19:37:01 -04:00
Cole Robinson 105553563a storage: Simplify source pool enumeration
Don't return an XML object stub, just return the relevant data.
Make it explicit that we currently are only supporting lvm
enumeration
2019-07-03 19:37:01 -04:00
Cole Robinson fd8847c24e storage: test default_target_path 2019-07-03 19:37:01 -04:00
Cole Robinson 199e9593bf storage: test default_source_name 2019-07-03 19:37:01 -04:00
Cole Robinson 9d7b20d3de storage: Add lots of coverage testing and exemptions 2019-07-03 19:37:01 -04:00
Cole Robinson f64655a843 storage: Replace pool supports_property with supports_X
Makes usage more explicit, and easier to track for coverage testing
2019-07-03 19:37:01 -04:00
Fabiano Fidêncio 58c6876450 unattended: Read the passwords from a file
Let's not expose the user/root password in the CLI and, instead, let's
rely on a file passed by the admin and read the password from there.

'CVE-2019-10183' has been assigned to the virt-install --unattended
admin-password=xxx disclosure issue.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-03 13:25:26 -04:00
Cole Robinson 5312a9611b virt-install: Revive --wait 0 as alias for --noautoconsole
This was the behavior prior to last release, and we received
a bug report about it. Revive it, but warn about the recommended way
to do it

https://bugzilla.redhat.com/show_bug.cgi?id=1724287
2019-07-03 13:12:19 -04:00
Cole Robinson f3e7b9a8f0 cli: Finish off test coverage 2019-07-03 13:12:10 -04:00
Cole Robinson 3a1f10c6c5 cli: Remove warnings about spice and GL
libvirt catches the missing support here, and the warnings are not
accurate because these values can work with SDL and EGL headless.
2019-07-02 14:58:44 -04:00
Cole Robinson 1277f5ebb1 clitest: Add non-testsuite virt-install stub
For hitting some logging code paths that are disabled for the
testsuite
2019-07-02 12:55:53 -04:00
Cole Robinson 5824cccf23 tests: test_urls: Add a fedora ftp:// example 2019-07-01 19:32:57 -04:00
Cole Robinson 2df7a6bab4 tests: test_urls: Actually test centos7 aarch64 2019-06-25 10:15:42 -04:00
Cole Robinson 2c49c3887c tests: test_urls: Better error report overwriting 2019-06-24 19:39:07 -04:00
Cole Robinson e4b4834a58 uitests: newvm: More attempts to make the PXE test less flakey 2019-06-18 10:01:26 -04:00
Athina Plaskasoviti b6563b90e5 cli: Add --numatune options memnode[0-9]*.cellid, memnode[0-9]*.mode, memnode[0-9]*.nodeset
XML Mapping:

<numatune>
...
  <memnode cellid="X" mode="X" nodeset="X"/>
...
</numatune>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-06-17 17:41:25 -04:00
Andrea Bolognani eda3c22458 guest: Add memory balloon by default
libvirt already does this for pretty much all QEMU guests, but
ARM virt guests for example don't get a memory balloon by default
at that level of the stack.

virt-manager is in a good position to make sure defaults are
consistent across architectures, and there's no downside in having
the device in the XML passed to libvirt anyway.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-06-17 13:52:07 -04:00
Andrea Bolognani 1502417566 tests: Add a couple of virt-xml memballoon tests
We're going to slightly change how the device is handled in
a minute, and we want to make sure we don't break existing
functionality while doing so.

Note that the existing singleton-config-* test cases already
provide coverage for both enabling and disabling the memory
balloon in virt-install.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-06-17 13:50:11 -04:00
Cole Robinson 8c5e0797e5 tests: dist: Drop forbidden import test
It's broken, and in practice it has not turned out to be an issue
preventing gdk or gtk from leaking into virtinst
2019-06-17 13:32:55 -04:00
Cole Robinson 728fd7cf7b cli: Don't generate path with 'None' if --name not specified
Use 'disk' instead. It will take some work to unwind this so
that the path isn't generated until a name is truly specified
2019-06-17 01:04:58 -04:00
Cole Robinson 6215c86fa2 virt-install: Warn about --location $DIR needing extra args
https://bugzilla.redhat.com/show_bug.cgi?id=1677019
2019-06-17 00:12:32 -04:00
Cole Robinson 16362671e9 virt-install: Add --install no_install=yes|no
This just formalizes the behavior of things like --import and
--livecd
2019-06-17 00:12:32 -04:00
Cole Robinson 230545bdb3 virt-install: Make bare '--wait' mean 'wait indefinitely' 2019-06-17 00:12:32 -04:00
Cole Robinson e9439a8ef1 virtinst: Move multiple installer .py files to virtinst/install/ 2019-06-17 00:12:32 -04:00
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 2c03ea5c92 hostnets: Remove SR-IOV info listing
This is fairly advanced stuff and it should be fine to get this
info from the XML editor page
2019-06-16 23:48:51 -04:00
Cole Robinson 59873f3876 hostnets: Remove QoS viewing/editing
This is fairly niche, and can be reviewed or edited with the XML
editor
2019-06-16 20:25:42 -04:00
Cole Robinson fe0e36499b uitests: prefs: Another attempt to fix XML editor flakiness 2019-06-16 19:33:45 -04:00
Cole Robinson 9c8e879ff0 virt-install: Add --boot firmware= 2019-06-16 17:15:08 -04:00
Cole Robinson 53f075ab76 virt-xml: Warn if libvirt discards our defined changes
This can happen if we try to remove a default device, like
 a ps2 mouse on x86, but it can happen for many other reasons as well

https://bugzilla.redhat.com/show_bug.cgi?id=1405263
2019-06-16 17:08:59 -04:00
Cole Robinson 52c6094c65 virt-xml: Denest and comment code flow a bit
Add lots of early exits to remove implicit fall through
behavior that I find hard to follow
2019-06-16 16:47:05 -04:00
Cole Robinson 0221471e4f virt-xml: If no XML diff is generated, explicitly warn 2019-06-16 16:37:48 -04:00
Cole Robinson 4973564e65 virt-clone: add --skip-copy option
This is the flip side to the --force-copy option. We already
have the plumbing internally

https://bugzilla.redhat.com/show_bug.cgi?id=1564865
2019-06-16 14:41:54 -04:00
Cole Robinson 88f52f956e urldetect: Don't use dict ordering for URL detection
ALLSTORES was implicitly using dict() ordering. This exposed
a bug in our code on debian ci which was nice, but it should
be deterministic. Hardcode the ordering
2019-06-16 14:41:54 -04:00
Cole Robinson df82856021 tests: Finish cloner.py coverage 2019-06-16 14:37:56 -04:00
Cole Robinson dcd0b2ac81 cloner: Fill out test coverage 2019-06-15 16:15:01 -04:00
Pavel Hrdina d6b6397ce0 virtManager: xmleditor: warn when switching to XML tab
If there are unapplied changes in the UI warn user when they tries to
switch to XML editor.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-06-15 15:05:28 +02:00
Cole Robinson 524002da02 virt-xml: Abide domain name for --build-xml
https://bugzilla.redhat.com/show_bug.cgi?id=1648939
2019-06-14 21:37:50 -04:00
Cole Robinson d40975c493 guest: Add back spice virtio-serial for windows
This was removed in v2.0.0, but we've had some complains since then

https://bugzilla.redhat.com/show_bug.cgi?id=1660123
2019-06-14 20:51:43 -04:00
Cole Robinson c52e220504 devices: disk: Handle pool=iscsi-direct volumes
I don't have a working setup for this so I'm not positive
it actually works, but this roughly matches what I see in
libvirt test suite data and docs

https://bugzilla.redhat.com/show_bug.cgi?id=1658511
2019-06-14 20:35:41 -04:00
Cole Robinson b9981b4623 createpool: Drop disk and netfs pool source listing
Both of these are awkward to use and IMO not really useful.
2019-06-14 17:16:48 -04:00
Cole Robinson ab7b3c189f Move virtcli/cliconfig.py to virtinst/buildconfig.py
There's really no reason for the split, just contain it all
within virtinst for simplicity
2019-06-14 17:12:19 -04:00
Cole Robinson ef972cf2ea virtinst: support: add full code coverage testing 2019-06-14 14:00:13 -04:00
Cole Robinson 54a28485df tests: Use assertRaises more 2019-06-14 13:04:56 -04:00
Cole Robinson bd7d213cf8 virt-xml: Add more test coverage 2019-06-14 12:37:35 -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 34f42cc673 installer: Make test suite override paths a bit more descriptive
Have them incorporate the basename of the path we are replacing.
This gives some validation that we are manipulating the correct files
2019-06-13 21:53:41 -04:00
Cole Robinson aafbca9e75 tests: Fix running on non-latest osinfo-db 2019-06-13 21:27:59 -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 3b396e8321 virt-install: Split out --wait handling into a helper class
And add much more clitest coverage
2019-06-13 16:02:58 -04:00
Cole Robinson 8234b55fe8 tests: clitest: Fill in much more virt-install coverage 2019-06-13 16:02:52 -04:00
Cole Robinson 7ef20e26b0 Revert "guest: Don't hardcode vcpus = 1"
This reverts commit 66fe00ddee.

Turns out it's not that simple. Indeed libvirt sets the default
when no <vcpus> XML is present, but if you do --vcpus cpuset=X
libvirt will error that there's no vcpu value set. So for back
compat and generate safety let's keep setting it.
2019-06-13 14:40:06 -04:00
Cole Robinson a9d33d49db osdict: Add testing and finish of code coverage 2019-06-13 14:00:04 -04:00
Cole Robinson 9cbe5f9742 virt-install: Move --install kernel/initrd handling to installtreemedia
This essentially gives us kernel upload, http access, and initrd inject
for free, and ensures that the source file is kept in pristine shape
2019-06-13 14:00:04 -04:00
Cole Robinson b746d919a9 virt-install: Add --install kernel_args=X,kernel_args_overwrite=yes|no
--install kernel_args=X acts like --extra-args. If
kernel_args_overwrite=yes is also specified, it overwrites whatever
default kernel args we would have used for the install method.
2019-06-13 14:00:04 -04:00
Cole Robinson 69d5e62cbb tests: Add an example of --extra-args with post install --boot cmdline=X 2019-06-13 14:00:04 -04:00
Cole Robinson 216b1f2a2d installer: Reject --unattended method=cdrom on remote connection
It's not wired up yet
2019-06-13 14:00:04 -04:00
Cole Robinson 69c20d5256 installer: install_{kernel,initrd} imply an install phase 2019-06-13 14:00:04 -04:00
Cole Robinson b4cc9c7cea uitests: Fix prefs XML editor flakeyness 2019-06-13 13:50:52 -04:00
Cole Robinson 2266b650a5 preferences: Disable XML editing by default
This adds a field in gsettings and preferences UI to enable
XML editing. It's off by default. The XML tab page is still visible,
but the textview is not editable, and there's a warning at the top:

  XML editing is disabled in 'Preferences'.
  Only enable it if you know what you are doing.

When the setting is enabled, the warning goes away and the textview
is editable. This puts a roadblock up for people that don't know what
they are doing, but still advertises the feature and keeps the
UI surface difference fairly small between on/off states.
2019-06-13 07:17:34 -04:00
Cole Robinson 2a1cf411dd tests: Add XML editing UI tests 2019-06-13 07:17:34 -04:00
Andrea Bolognani c88e492331 guest: Enable qemu-ga by default on s390x
It was disabled with commit 2aca20141e back in 2015, but
these days we have it enabled for all other architectures and
there doesn't seem to be a good reason for s390x to keep being
the outlier.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-06-13 09:16:45 +02:00
Cole Robinson 1f4a5a1b43 cli: Add --install bootdev=X,kernel=X,initrd=Z
This is the beginning of a big --install option, which will be used
for tweaking less common elements of the install process
2019-06-11 17:55:09 -04:00
Cole Robinson a4a577bd23 tests: Finish off installer and kernelupload coverage 2019-06-11 17:55:09 -04:00
Cole Robinson de90716eb4 unattended: Choose a default profile name if none specified
We default to 'desktop' if none specified, otherwise we choose the
first alphabetical profile available. Make bare '--unattended' a
valid option
2019-06-11 17:55:09 -04:00
Cole Robinson 034d112181 unattended: Finish off code coverage testing 2019-06-11 17:55:09 -04:00
Cole Robinson 13b3790829 virt-install: Print when we set default memory and disk
Since we never defaulted here before, print out the values we are
setting. Users can see right away if they actually want those values
or not.
2019-06-11 17:55:09 -04:00
Cole Robinson cb0e37786f tests: clitest: More infrastructure to skip default arguments
To allow testing virt-install without default --ram added for example
2019-06-11 17:55:09 -04:00
Cole Robinson b3e6ebe28b virt-install: Generate default --name
This uses the same logic as virt-manager. The name is mostly
derived from --os-variant naming, but we have fallback defaults too.

Print the name to stdout so users are informed about what we are
doing.
2019-06-11 17:55:05 -04:00
Cole Robinson 078348fbbf create: move generate_name to Guest
This will be used by virt-install.
Tweak the logic a bit to not have 'generic' in the name
2019-06-11 17:54:45 -04:00
Cole Robinson 01a07a1051 virt-install: Share required option logic for resources
There's some cases we were incorrectly setting osinfo defaults, when
mem or storage values had already been specified elsewhere
2019-06-11 17:54:45 -04:00
Cole Robinson 66fe00ddee guest: Don't hardcode vcpus = 1
libvirt has set this as the default forever, we don't need to set it
2019-06-11 17:54:42 -04:00
Cole Robinson 17d157820f guest: move libosinfo resource setting to virt-install
This puts all the default resource setting in one place, and the
only place that was depending on it, as virt-manager explicitly sets
the values on its own. This will be used in future patches to add
more default setup and report the values to the user
2019-06-11 17:51:25 -04:00
Cole Robinson e859d17e1a tests: Add an unattended netinst test case 2019-06-11 17:51:25 -04:00
Cole Robinson cc366fff7d cli: Add more code coverage 2019-06-11 17:51:25 -04:00
Cole Robinson 75101ce27b tests: clitest: Remove some redundant argcomplete tests 2019-06-11 17:51:25 -04:00
Cole Robinson c33eb562c2 devices: graphics: Test remaining code coverage 2019-06-11 17:51:25 -04:00
Cole Robinson b0b3ba4e1c devices: interface: Test remaining code coverage 2019-06-11 17:51:25 -04:00
Cole Robinson f056798918 virtinst: Add a bunch of # pragma: no cover 2019-06-11 17:51:25 -04:00
Erik Skultety 8ab9dcd33f virtinst: guest: Provide further SEV support checks
These include platform checks - libvirt & QEMU - as well as
configuration - SEV is only supported with UEFI.
Another configuration requirement made in this patch is Q35 machine,
since ADM recommends Q35 in their setups even though SEV can work with
the legacy PC machine type, but we'd have to turn on
virtio-non-transitional for all virtio devices with some other potential
pitfalls along the way.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2019-06-11 13:00:34 -04:00
Erik Skultety 1a8728fc2d virtinst: guest: Fill in SEV platform specific data automatically
The data in question are 'cbitpos' denoting which addressing bit is the
encryption bit and 'reduced_phys_bits' denoting how many physical
address space we lose by turning on the encryption. Both of these are
hypervisor dependent and thus will be the same for all the guest
residing on the same host, but need to be specified for future migration
purposes.
But given we can probe them from domain capabilities, we don't need the
user to provide them and thus enhancing cli user experience. This
requires a new _SEV domaincapabilities XML class to be created so that
we can query the specific properties.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2019-06-11 13:00:34 -04:00
Erik Skultety 480a6834c2 virtinst: cli: Provide a default value for the 'policy' argument
Policy is a 4-byte bitfield used to turn on/off certain behaviour within
the SEV firmware. For a detailed table of supported flags, see
https://libvirt.org/formatdomain.html#launchSecurity.
Most of the flags are related to advanced features (some of them don't
even exist at the moment), except for the first 2 bits which determine
whether debug mode should be turned on and whether the same key should
be used to encrypt memory of multiple guests respectively.

>From security POV, most users will probably want separate keys for
individual guests, thus the value 0x03 was selected as the policy
default.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2019-06-11 13:00:34 -04:00
Erik Skultety 45f3a47c84 virtinst: cli: Introduce parser support for SEV launch security
Introduce both the launchSecurity XML and parser classes. While at it,
add launchSecurity as a property instance to the Guest class too.

The parser requires the 'type' argument to be mandatory since in the
future it will determine different code paths, therefore
'--launchSecurity foo=bar' is incorrect.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2019-06-11 13:00:34 -04:00
Erik Skultety 9bfdd92c0e tests: Introduce real-world AMD SEV domain capabilities
Rather than editing existing Intel domain capabilities by hand, use
capabilities from a real AMD HW. We're later going to use these to fill
in SEV platform specific data automatically.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2019-06-11 13:00:34 -04:00
Athina Plaskasoviti 7a52e4c80d cli: Add --numatune memory.placement
XML Mapping:

<numatune>
  ...
  <memory placement=X/>
  ...
</numatune>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-06-10 09:53:36 -04:00
Cole Robinson b4c9e4b114 tests: Skip unattended tests unless osinfo is new enough 2019-06-09 20:19:45 -04:00
Cole Robinson 4dd12e2e56 installer: Generate the unattended script only in installer
And pass it down to treemedia, which acts on our script wrapper
object. This is conceptually a bit simpler because we can see in
one place what data feeds the script build process, depending on
installer props
2019-06-09 20:19:42 -04:00
Cole Robinson ae5e9d9a2c virtinst: Add full test coverage for xml*.py files 2019-06-09 19:00:03 -04:00
Cole Robinson 361657ad15 virtinst: Add a lot of test code coverage
* Delete dead code
* Add tests for various device default code paths
* Rework certain conditions a bit so code coverage always hits them
2019-06-09 18:59:50 -04:00
Cole Robinson 261a0a0482 domain: seclabel: Drop some unneeded logic
* imagelabel is a runtime only XML attribute which we don't use at
  all, so drop parsing
* drop validation checks that libvirt will do for us
2019-06-09 18:34:48 -04:00
Cole Robinson b5a664bd1b virtinst: move UI only functions into virtManager
These throw off code coverage testing. They are mostly:

* pretty* device helpers
* network + snapshot validation + creation routines
2019-06-09 18:33:45 -04:00
Cole Robinson c9233aa6c3 tests: uitests: Run whole suite without testsuite hacks
We want to hit real network fetching, etc.
2019-06-09 14:26:03 -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 0113455065 tests: osdict: add basic list_os unittest 2019-06-09 10:40:26 -04:00
Cole Robinson d9b41bf887 tests: Add clitest coverage for network-install resources 2019-06-09 10:14:48 -04:00
Cole Robinson 4a04af38f1 tests: clitest: Add windows unattended unittest 2019-06-08 15:33:37 -04:00
Cole Robinson 08baf0ee5f unattended: Handle libosinfo returning kernel url arg
Latest libosinfo will handle this. Check for it so we don't end up
with double options on the command line
2019-06-08 13:03:08 -04:00
Cole Robinson 635361f0bd tests: Add osinfo URL and URL unattended tests 2019-06-08 10:20:36 -04:00
Cole Robinson f01a534cfb tests: Use testsuirebr0 as the fake bridge name
It's more obvious in the output than 'eth0'
2019-06-08 09:24:33 -04:00
Cole Robinson b97003ddfc interface: Get more unittest coverage of _default_* 2019-06-08 09:24:25 -04:00
Cole Robinson f3b0830cf3 tests: Add run_without_testsuite_hacks decorator 2019-06-08 09:11:00 -04:00
Cole Robinson e9dcb4056d installer: Rework some test suite urlfetcher hacking
Rather than alter where we save the files, behave like normal but
only change what we store in the XML
2019-06-07 21:40:47 -04:00
Cole Robinson 37adfb0150 urlfetcher: Add http and ftp unit test mocking 2019-06-07 21:25:41 -04:00
Cole Robinson 6caa085f6c tests: test_urls: Update 2019-06-07 21:13:51 -04:00
Cole Robinson 388850f04e virtinst: Rename util to xmlutil
The only functions left in there are largely for xml handling, so
make it explicit
2019-06-07 18:21:24 -04:00
Cole Robinson c603ea4084 util: Move *_meter to progress.py 2019-06-07 17:32:51 -04:00
Cole Robinson 7d17d5d03b virtinst: Run register_libvirt_error_handler on import
We basically want this everywhere, and transparently, so run it on
import like we do for gettext setup
2019-06-07 16:56:57 -04:00
Cole Robinson ecc3e3d34e support: add is_libvirt_error_no_domain
Repurpose the generic util.exception_is_libvirt_error for the one
purpose that it's actually used, add it as a SupportCache staticmethod,
and test it
2019-06-07 16:44:14 -04:00
Cole Robinson f85e6def55 support: Convert callers to the new format 2019-06-07 16:26:03 -04:00
Cole Robinson 566a4681a8 support: Rework support check invocations
SupportCache.check_support(SUPPORT_FOOBAR, args) becomes
SupportCache.foobar(args)

And SupportCache absorbs the caching infrastructure from
VirtinstConnection.

For now we add some hackery to hide the API change from callers, but
this will be undone in the next patch
2019-06-07 16:25:39 -04:00
Cole Robinson e58d765ae5 tests: xmlconfig: Add tests for real uuid and mac generation 2019-06-06 18:35:36 -04:00
Cole Robinson 50addfebca nodedev: Drop the non-standard .parse() handling 2019-06-05 16:35:34 -04:00
Cole Robinson ab0c99057b nodedev: Fold DRMDevice into NodeDevice 2019-06-05 16:35:34 -04:00
Cole Robinson 87b2ea4672 nodedev: Fold SCSIBus into NodeDevice 2019-06-05 16:35:34 -04:00
Cole Robinson 8d13125564 nodedev: Fold StorageDevice into NodeDevice 2019-06-05 16:35:34 -04:00
Cole Robinson eeb7babef7 nodedev: Fold SCSIDevice into NodeDevice 2019-06-05 16:35:34 -04:00
Cole Robinson cf3bc3eb3b nodedev: Remove unused USBBus parsing 2019-06-05 16:35:34 -04:00
Cole Robinson b7ac99473d nodedev: Fold USBDevice into NodeDevice 2019-06-05 16:35:34 -04:00
Cole Robinson a0881bc6f2 nodedev: Fold PCIDevice into NodeDevice 2019-06-05 16:35:34 -04:00
Cole Robinson ca804c5b5e nodedev: Fold NetDevice into NodeDevice 2019-06-05 16:35:34 -04:00
Cole Robinson 966b0b5a6b nodedev: Drop cap 'system' parsing
We don't use it for anything internally
2019-06-05 16:35:34 -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 2510c299f5 Use shutil.which instead of distutils find_executable
The former is the more standard library method for this
with python3
2019-06-05 16:35:34 -04:00