Commit Graph

7124 Commits

Author SHA1 Message Date
Cole Robinson
4cb775773f devices: disk: Add change_bus()
Taken from virt-manager code. Move it here because it is strictly
an XML operation, and it will be easier to unit test

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-29 06:44:33 -05:00
Cole Robinson
0f295ec5dc devices: disk: Add more test coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-29 06:40:43 -05:00
Cole Robinson
5d643f8fd9 devices: disk: Drop dead code
The way the previous block is structured, this condition will
never trigger

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-28 20:03:50 -05:00
Cole Robinson
01ccaf03be setup: Run codespell on more files
And fix the results

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-28 14:31:28 -05:00
Cole Robinson
c3b4a713c1 DESIGN: Add more links to explicitly rejected requests
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-28 14:23:23 -05:00
Cole Robinson
d9d5caad0d virtinst: connection: Drop is_closed() helper
We have is_open, just use that

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-28 11:42:33 -05:00
Cole Robinson
4f7e25e9fe uitests: Fix with latest delete wizard
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-28 11:39:14 -05:00
Cole Robinson
0e355b218a delete: Improve text for storage deletion
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-28 11:39:14 -05:00
Cole Robinson
e48ce4a31e delete: Default to not removing storage for disk removal
This is the old default we've always used, so better to stick with it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-28 11:39:14 -05:00
Cole Robinson
03a6272f81 delete: Code cleanups
* Comment the individual classes
* Move abstract methods to their own logical section
* Simplify some shared code calls

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-28 11:39:14 -05:00
Cole Robinson
1a9e2f4f76 delete: Don't run UI routines from a thread
Pull the remove_devobj_internal call outside of the async job,
otherwise we can have X11 threading issues

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-28 11:39:14 -05:00
Lily Nie
3ab35320a1 Use remove_devobj_internal function instead of vm.remove_device
remove_devobj_internal function handles more things than vm.remove_device.
We should call it first before performing the storage deletion.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
2020-01-28 11:39:14 -05:00
Lily Nie
1e36ce05e3 Change remove_devobj_internal to a static method,and move it to vmmDeleteStorage
So that the callback doesn't need to be passed into the init function,
and vmmDetails can call that function directly

Reviewed-by: Cole Robinson <crobinso@redhat.com>
2020-01-28 11:39:14 -05:00
Lily Nie
af59cd9825 details: remove all usage of 'self' in remove_devobj_internal function
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2020-01-28 11:39:14 -05:00
Lily Nie
71befc0f5d details: add a remove_devobj_internal function
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2020-01-28 11:39:14 -05:00
Cole Robinson
11d6536542 guest: Finish off test coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 13:08:12 -05:00
Cole Robinson
dbcebeb734 guest: Move VM replace helper to cloner
It's the only user. Rework it a bit and add full coverage

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 13:08:12 -05:00
Cole Robinson
796ba8f3c5 guest: Fix --graphics spice usage if USB is disabled
We already have a check for this for adding a tablet device, do
the same for redirdev devices

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 13:08:12 -05:00
Cole Robinson
860dba6923 guest: Remove disable_default_memballoon
The Guest code isn't triggerable because of the way the cli code
was invoking it, as a <memballoon> device would always be added.
Because libvirt accepts model=none, and that's what '--memballoon none'
will translate to anyways, we don't need any special handling here

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 13:08:12 -05:00
Cole Robinson
fd71d7fea5 guest: Remove bogus conditional
This incorrectly always evaluates to True. But no one ever complained
so let's keep that behavior the same

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 13:08:12 -05:00
Cole Robinson
6d2483f09d virtinst: install: Fill out more test coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 13:08:12 -05:00
Cole Robinson
3440d8c59d urlfetcher: move mock code to the testsuite
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 13:08:12 -05:00
Cole Robinson
c64009ecdd domaincapabilities: Finish test coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 13:08:12 -05:00
Cole Robinson
dcab14e0b4 domain: cpu: Finish test coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 13:08:12 -05:00
Cole Robinson
6f95ebc7fd devices: controller: Add get_attached_devices
Move the opencoded impl out of virt-manager details.py and into
virtinst, since this is entirely about XML comparison. Add tests for
it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 13:08:12 -05:00
Cole Robinson
ec580f82a2 tests: Cover Guest.find_device and Device.compare_device
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 07:38:53 -05:00
Cole Robinson
3e5d530fce devices: interface: add coverage for new bridge changes
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 07:00:29 -05:00
Cole Robinson
e40f71a689 tests: cli: Cover DeviceVideo bochs default
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 06:57:52 -05:00
Cole Robinson
91d4c39bb6 tests: cli: cover --controller address=X failure
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 06:57:37 -05:00
Cole Robinson
eb5e087366 tests: Add full coverage for pollhelpers and VirtinstConnection
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 06:57:37 -05:00
Cole Robinson
cf76c1517c connection: Simplify keepAlive error checking
This checking is overly involved, keepAlive is not an essential
feature, so just log an error if it fails

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 06:57:37 -05:00
Cole Robinson
f023b9f8c9 connection: Drop dead __getattr__ code
__getattr__ is only called when an attr is not already found
in __dict__, so this path will never trigger

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 06:57:37 -05:00
Cole Robinson
7ccba87966 connection: Share helper function for fetch APIs
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 06:57:37 -05:00
Cole Robinson
156926b78d connection: Drop glib usage for cache dir
Our fallback implementation is the same as glib for all usage we
care about, so don't bother with calling glib

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 06:57:37 -05:00
Cole Robinson
49d16912c3 setup: Skip coverage report when tests are aborted or skipped
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 06:57:37 -05:00
Cole Robinson
e784376699 tests: Rename all test files to have test_ prefix
This will help for a possible future conversion to pytest

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 06:57:37 -05:00
Cole Robinson
78c8aef75e tests: Move all data directories to data/
This cleans up the file hierarchy a bit

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 06:57:37 -05:00
Cole Robinson
8fe0a208db Move virt-* code into their modules
This layout is closer to what most python modules have nowadays.
It also simplifies testing and static analysis setup.

Keep virt-* wrappers locally, for ease of running these commands
from a git checkout.

Adjust the wrapper binaries we install on via packaging to be
pure python, which makes things like running gdb easier.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 18:27:20 -05:00
Cole Robinson
3538a8df79 details: Fix perf icon with adwaita-icon-theme
We need to fallback to a more generic value if the
preferred icon is not around

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 15:41:21 -05:00
Cole Robinson
d0d672e6d5 virt-install: Change PXE warning to be less authoritative
https://bugzilla.redhat.com/show_bug.cgi?id=1693891

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 14:26:19 -05:00
Cole Robinson
b5e3b724cf Add DESIGN.md
This is derived from the mailing list discussion here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00108.html

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 12:14:18 -05:00
Cole Robinson
1002128c7b oslist: Only handle 'activate' if the oslist is visible
Otherwise when we press enter for an already selected OS, it chooses
the first alphabetic entry in the list, overwriting our selection

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson
c6e85295e8 createvm: Grab OS list focus for manual install page
Since the page requires input and can't progress until the user enters
some value here, grab focus for the OS list

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson
ba24d877bf createvm: Remove 'Network boot (PXE)', add 'Manual install'
For the dialog flow, these options are the same, the only effect
is that there's no longer an initial network boot phase.

PXE is dependent on an external server setup that is not common
in the scheme of things, so giving it a first class option on the
front of the new VM wizard isn't really sensible. Users that want
to PXE boot can easily do so via the 'customize before install'
option, or just manually create a VM and edit the boot device as
they see fit.

Explicitly advertising a Manual option is nicer for users that
just want to create a VM and deal with install later, among many
other minor use cases.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson
18358d5096 tests: uitests: Make find() exception output nicer
Overwrite the internal exception, which is not interesting

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson
f073ad6fb6 createvm: Remove kernel/initrd/dtb/kernel args UI
Add an info message that these can be set via the
'Customize before install' option. Duplicating this doesn't add a ton
of value here IMO

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson
0bf65e6ce8 preferences: Remove old Interface confirm option
This hasn't been relevant since that UI was removed

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson
d410773af8 virtManager: Remove virInterface polling
There are no more users of interface objects in the code. Remove
all the polling support, and all the remaining references to
interface objects throughout the code base

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson
212c5f813d createnet: Add field for specifying forward device
And drop the explicit forward device listing. Similar to what
we did with bridge/macvtap domain <interface>

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson
c92c454fde virtManager: Drop interface list for bridge and macvtap
Some related bits were discussed here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html

macvtap is problematic for inexperienced users so we shouldn't
be broadly advertising it, plus our device listing was incomplete
anyways.

Both bridge and macvtap device listing are largely dependent on
the libvirt virInterface APIs, which have varying degrees of
completeness across distros and are not particularly reliable to
begin with.

Drop both of these in favor of the available support for manually
specifying a device name

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00