Commit Graph

2050 Commits

Author SHA1 Message Date
Cole Robinson 55fd4ccd23 uitests: Add connection login console lookup testing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:04:36 -04:00
Cole Robinson 485dddf2ed uitests: Add connection user/pass auth testing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:04:36 -04:00
Cole Robinson f6e880b195 uitests: Add connection nodedev and agent event testing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:03:51 -04:00
Cole Robinson 306c6be12f uitests: Add connection tick failure testing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:03:51 -04:00
Cole Robinson 14232e1aa7 connection: Don't process errors in tick_from_engine
We haven't shown error dialogs for failed connections for a long
while, so all this processing isn't accomplishing anything anymore

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:03:51 -04:00
Cole Robinson 29f866e6f3 uitests: add connection object blacklist testing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-02 12:59:25 -04:00
Cole Robinson a10d746c41 gfxdetails: Update UI a bit
Refactor the internals to cleanly separate the pieces that fill in
the UI, and the pieces that react to UI state to dynamically show/hide
fields.

Improve spice GL warnings while he are here, and several other minor
fixes

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 20:10:34 -04:00
Cole Robinson bd4b53e7da netlist: Remove some leftover print debugging
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 18:04:29 -04:00
Cole Robinson ba33a6c99d details: Remove explicit video heads and ram reporting
RAM is rarely changed from the default
heads does not have any explicit virt-manager support
and both are viewable from the XML editor.
So remove the explicit fields for them

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 17:32:50 -04:00
Cole Robinson 9b5d9eb9eb systray: add a standalone window impl for uitests
This gives us as much coverage as possible without relying on too much
host desktop config

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 16:59:20 -04:00
Cole Robinson 4348d4b128 systray: Don't rebuild the menu on every change
This works fine for the StatusIcon backend, but for the appindicator
backend which communicates every menu changes over dbus this is
super slow. Instead update the menu in place when objects change
state or disappear

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 16:58:04 -04:00
Cole Robinson 408b3023bc viewers: Remove hidden grab-keyboard gsettings
This was added in 2014 per user request but we never exposed it in the
UI. This is fairly advanced needs from the console viewer IMO and is
better left to console specific tools like virt-viewer, per our
DESIGN.md

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 14:27:11 -04:00
Cole Robinson c40a9e3fed delete: Move show_instance to the proper class
It shouldn't be associated with the shared baseclass

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 14:27:11 -04:00
Cole Robinson e45a2228dc objects: Erase the notion of connkey
Make it explicit that all uses of this is actually the object
name. We already leaked this abstraction in several places so better
to make it explicit. This also communicates to users that this is a
field that is not immutable so it shouldn't be used as a unique key

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 14:27:11 -04:00
Cole Robinson 8ff0da7664 connection: Pass object in -added/-removed signals
And not connkey. connkey == name, and name can change with object
rename, so it's a bad pattern to propagate that connkey can be used
as a static lookup key for objects. This begins unwinding it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 14:27:11 -04:00
Cole Robinson e4c0191f83 createvm: Only check network selection on final page
Otherwise early 'change' signals can give inconsistent
behavior WRT default 'advanced' expander state

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 14:27:11 -04:00
Cole Robinson 1a3a89d949 uitests: finish delete.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-30 15:59:39 -04:00
Cole Robinson 30e021bd3d uitests: finish createvm.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-30 14:23:24 -04:00
Cole Robinson 5442b6a890 createvm: Fix checking for empty KVM caps
This code path was never hit because it came after caps.guest_lookup
which errors in this case. We need to check things earlier

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-30 14:23:24 -04:00
Cole Robinson af0162caa2 createvm: Remove the xen PV-only warning
Nowadays this should be rare or possibly not even exist

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-30 14:23:24 -04:00
Cole Robinson c36f232370 uitests: Finish console.py and viewers.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-30 10:34:44 -04:00
Cole Robinson e414fc3bdc viewers: Drop old style VNC socket handling
In all modern local cases we will be using openFD to get a direct
file descriptor from the VM, so this code should never be triggered
nowadays

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 16:49:52 -04:00
Cole Robinson 940bd3873e console: Replace auth-rejected with auth-error signal
Should be similar here. auth-rejected is hard to trigger anyways

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 16:17:45 -04:00
Cole Robinson d5f7089ef2 uitests: finish engine.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 16:17:45 -04:00
Cole Robinson b0294a1bc6 testmock: Split apart the first-run option
Break it into disable-libguestfs, fake-systemd-success, and
firstrun-uri suboptions, and adjust using code to match

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 15:04:49 -04:00
Cole Robinson 7769d9a1e4 engine: Move the first run systemd handling to connectauth.py
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 13:23:34 -04:00
Cole Robinson 64e3ff1d08 uitests: console/keyring/viewer coverage work
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 13:23:34 -04:00
Cole Robinson 2c86eefa5b virt-manager: Drop the DISPLAY error handling
Gtk nowadays doesn't raise an exception, it just exits directly

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 13:21:43 -04:00
Cole Robinson c8ed6534e5 connection: Remove some outdated pretty hv labels
And also the embedded label, our default behavior covers
this well enough for what is likely to be an obscure case

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 13:21:21 -04:00
Cole Robinson 87eb36dda1 uitests: Finish virtmanager.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 12:37:52 -04:00
Cole Robinson 687658832e uitests: details/domain/config coverage additions
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 12:37:52 -04:00
Cole Robinson 301892f6b9 serialcon: Modernize code style
* Privatize a bunch of stuff
* Make public API explicit
* Add a few minor public APIs to avoid accessing internal state

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 12:37:12 -04:00
Cole Robinson e9c937691d uitests: Finish serialcon.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 12:37:12 -04:00
Cole Robinson fa82508e53 virt-manager: drop libvirt 0.6.0 version check
This is comically old and completely unrealistic anyone would
attempt to use that nowadays.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 12:37:12 -04:00
Cole Robinson a2ad7b4f2f domain: Add test mocking for IP address APIs
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-28 08:47:20 -04:00
Cole Robinson f06cc11546 config: Move more password handling to keyring.py
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-28 08:47:20 -04:00
Cole Robinson ab903ef69b domain: Fix clearing topology when VM has dies= in XML
We need to use the topology.clear() helper to properly empty
out everything

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-27 19:41:28 -04:00
Cole Robinson 34c6d1c7ea virtinst: cpu: Move topology elements to their own class
This is a no-op but will help with a future bug fix

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-27 19:41:28 -04:00
Cole Robinson ade6c34a96 domain: Have test driver report fake job_info data
Helps us test more of the UI

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-27 19:41:28 -04:00
Cole Robinson b764773cfe domain: Remove qemu VNC SKIPAUTH bug workaround
This was added in cb182f7e3 in Mar 2017 to work around a bug in
qemu 2.9. This bug only affects the case of virt-manager running
locally with that version, which after three years should be rare
to non-existent. Remove the workaround

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-27 19:41:28 -04:00
Cole Robinson eda08f4c79 details: Big code modernization
* Privatize a lot of stuff
* Separate out many callbacks as thin wrappers around the real code
* Simplify registering EDIT_ handlers
* Organize things better

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-27 18:10:11 -04:00
Cole Robinson eea394b9d3 uitests: Increase details + domain + vmwindow coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-27 18:10:11 -04:00
Cole Robinson 701164c664 details: Don't blacklist machine 'none'
Libvirt has done this for us for a long time

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-27 18:10:11 -04:00
Cole Robinson 7d22f7b5dc details: Fix handling failed 'unapplied changes'
The return values from config_apply were not consistent

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-27 18:10:11 -04:00
Cole Robinson 4fd9255f9a details: Remove the threads warning for CPUs that don't support it
This is pretty obscure, and if it's problematic then libvirt
or qemu should be throwing an error or otherwise reporting it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-27 18:10:11 -04:00
Cole Robinson 70a5cb7b55 gfxdetails: Improve UI interaction with spice GL + rendernode
* Unset rendernode when spicegl is de-selected
* Set rendernode by default when spicegl is first selected

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-27 08:35:52 -04:00
Cole Robinson f74c061061 uitests: Finish asyncjob.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 16:24:39 -04:00
Cole Robinson cfd6d6ead4 uitests: Finish vmmenu.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 16:24:39 -04:00
Cole Robinson 4c1b35f7e7 uitests: Finish migrate.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 16:01:30 -04:00
Cole Robinson b06d7c47f3 domain: Fake jobinfo support for the test driver
This let's us test more code, including behavior that's closer to
standard QEMU driver behavior

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 16:01:30 -04:00
Cole Robinson 3425d514be migrate: Remove localhost hostname warning
Latest libvirt actually checks against UUID so this isn't accurate
anymore

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 16:01:30 -04:00
Cole Robinson 25d23b1d8b uitests: finish manager.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 16:01:30 -04:00
Cole Robinson e9ee0f6d4b uitests: add some mock inspection.py testing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:26:12 -04:00
Cole Robinson 0af6bdb56f inspection: Fill in fake data for test:/// URIs
This helps with testing

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:06 -04:00
Cole Robinson 48695199c5 inspection: Break out _perform_inspection
This clearly separates the pieces where we interact with
libguestfs, vs our internal wiring

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:06 -04:00
Cole Robinson b59a30ad77 uitests: Finish addhardware.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:06 -04:00
Cole Robinson 1684049fa3 virtManager: Misc coverage annotations
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:06 -04:00
Cole Robinson 627fa2f611 addhardware: Simplify input_pretty_name
Drop the 'Generic' prefix for all strings which isn't particularly
meaningful.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 147f918ffd addhardware: Use dictionary pattern for pretty labels
It's shorter and saves us the pain of adding coverage
for every option

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson ab92693a56 uitests: finish preferences.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson fd5216c184 uitests: Finish createconn.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson bb1180fb40 Move virtmanager test cli handling to testmock.py
We will be adding more stuff here, so let's move it out
of the main virt-manager script

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 5ccbcb898f uitests: Finish netlist.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson ea49c1d932 netlist: Rework the 'no network' case
Always force a network selection. If we have to fall back to
manual bridge UI because nothing else exists, show a warning.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 153dcba126 uitests: test createvm.py with an empty connection
Fix the 'No networking' createvm case that it shows was broken

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 463c42773c createvm: Drop explicit warning about no net + URL install
This case should be exceedingly rare, and we already show
a visual warning about 'no network'. So let's drop this

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson bc32852e17 connection: Remove unused 'vm-renamed' signal
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson f15cdd732d graphics: Remove spice GL/rendernode version support warnings
The versions we are warning about are all over 4 years old, and
these warnings were initially just informative to help users know
when the config wasn't going to work. Drop most of it. Still warn
in the UI when a VM misconfig will prevent spice GL from working

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson c2dbdbfab1 uitests: Finish snapshot.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 5ecacfdfed uitests: Finish error.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 4b4f2ddba3 uitests: Finish addstorage.py coverage
We need to wire up some craziness to make path permission
searching fail, but this is a critical area to get correct
so it is worth it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 95bf8bf6b9 uitests: Cover more createvm validation checks
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson e3be4b677e error: Remove some dead code
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 2f4aa652d3 error: Try not to split val_err over multiple lines
Helps grepping for val_err usage, and grepping for error strings

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson be2b308ae4 createvm: Break out _validate_oscontainer_bootstrap
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 57f916461f uitests: Finish fsdetails.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 7bfe8139c0 uitests: Add module_trace.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 5c10f4e394 storagebrowse: Fix set_browse_reason
We can't call this at init time, we need to do UI changes on demand

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson c323ecfd55 fsdetails: Rework xml builder APIs
Don't have the caller call a validate function, they all catch
errors anyways. Let the build step raise error if there's a problem

Drop some validation checks that libvirt should be performing for us

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 4c439cda21 uitests: Add vsockdetails full coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson bc9d6cf6d5 Drop some explicit openvz handling
I don't think many, if any, people are using virt-manager with
openvz. Drop the specific handling the filesystem UI, users can use
the raw XML editor if they need special behavior

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 7a63fb95ec object: Finish off non-domain code coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 9d34d1da0b libvirtobject: Centralize most tick() implementations
Basically all non-domain objects just need to check to see
if status changed, which will also refresh the XML if
a change occurs. This all works to ensure we are initializing
XML at tick time

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson f22e060190 Always assume objects support .isActive()
All drivers that support the listAll APIs, which we depend on,
also are new enough to support isActive, so stop checking support

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 9a9eb165ed uitests: Add host*.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 6f8c305d62 tests: uitests: Add createvol.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 0babd6b27f createnet: Add full uitest coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 886339e8dd virtManager: add coverage annotations and remove dead code
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 8f4341bee8 host: Move xmleditor init earlier
It can be triggered via callbacks which may fire early,
so initialize it first

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 543ddba9f2 hoststorage: Fix some UI issues with initial offline conn
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson d9b3108436 hostnets: Fix some UI issues with initial offline conn
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 760d98ba64 network: Rework dhcp_leases usage to avoid dead code
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 045c8c108d network: Drop dead code in pretty_format_mode
There isn't any XML that hits this case that I can find.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 766d7c47c3 hostnets: Remove route UI label
This is an uncommon configuration. Users can see
the details in the XML editor

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson d0e725f439 gfxdetails: Remove explicit SDL UI fields
Users can look at the device XML easy enough, and very few people
are using SDL with libvirt

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson deeda106c1 createpool: Remove pool-created callback
The intent is this would select the newly created pool in the
UI after the user creates it. With async events though this
is racy and doesn't tend to work as expected.

It's fixable but it would likely require hanging around for
a period of time waiting for the signal to fire, which
takes more work. Just drop it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson f61bf516df createpool: Remove 'build' checkbox
We only showed it for disk pools, and it determined whether we
partition the device or not. I don't think this gets much
usage and there are much better tools for that job. If users
aren't sure what they are doing they can lose data.

Drop the UI, which always defaults to build=False for disk
pools, and expect the user to partition the device themselves.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson 8dd3b8ba20 virt-manager: Add --test-options gsettings-keyfile
This will let us test some difficult code paths in the uitests.
Rework the `--test-options first-run` behavior to use a temporary
keyfile rather than the memory backend, to unify the code paths

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Pavel Hrdina e8bf16b983 details: fix detection of firmware auto-selection
Commit <15a9502b7b7a263c4d66ff2b3f31c209f58fe0b4> fixed firmware
detection but incorrectly. It will always show only "UEFI" even if
the firmware auto-selection is not used because the function is_uefi()
checks both the old style and the new auto-selection.

We have to check only for the auto-selection option.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2020-08-13 16:40:53 +02:00
Jan-Marek Glogowski ce5aba6a36 Add USB cdrom and ramfb video
Both are needed to install Windows 10 Arm64 from ISO.

Signed-off-by: Jan-Marek Glogowski <glogow@fbihome.de>
2020-08-12 14:03:58 -04:00
Cole Robinson aa89a48371 xmlutil: Centralize all 'programming error' exceptions
Raise them directly instead of adding the hard to read conditional
into the function

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 19:08:27 -04:00
Pino Toscano 8a085bfea1 i18n: translate UI string
A visible UI string must be translatable.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-15 10:22:26 -04:00
Pino Toscano 2760b20c84 i18n: create single strings for texts/messages
Use single strings with proper placeholders for texts, so there is no
need to join together bits of translated texts.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-15 10:22:26 -04:00
Pino Toscano 392caac8b4 i18n: add missing placeholder name in string
Fixes commit 71f034d6b6.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-15 10:22:26 -04:00
Pino Toscano 22fe62be34 i18n: fold placeholder into string
There is not really anything to leave out of the string, simply
translate it as a whole.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:24:14 -04:00
Pino Toscano 494a453ee8 i18n: use single string for error/warning
Avoids few string puzzles.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:24:14 -04:00
Pino Toscano 6f30ab2437 i18n: use plural forms where needed
Use plural forms for strings that depend on a runtime value, like a
count. This way they will get the proper string for the actual value.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:24:14 -04:00
Pino Toscano 8872e1e962 i18n: show localized accelerators in Send key menu
Turn the menu labels into GTK accelerator strings, so we can parse them
to convert them into a proper user representation.

There is a small behaviour change: the menu items do not have mnemonics
anymore by default.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:24:14 -04:00
Pino Toscano 36b3f9bee1 i18n: further improve label for controller
It seems that the index is optional, so use a proper string for this
case.

Fixes commit 00fa636682 in this file.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:24:14 -04:00
Pino Toscano bceeb23967 i18n: do not translate regexp
There is no point to translate an internal regular expression; worse,
a wrong translation can break the regular expression.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Pino Toscano 15a2354559 i18n: use single strings for connection/uri
Create single strings for connection/uri hints & tooltips, so it is
easier to translate them, and there are not glued like puzzles.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Pino Toscano 6a39f2bb8b i18n: use single strings for network list in clone dialog
Create single strings for the networks in the clone dialog, including
all the available information at once instead of join pieces together.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Pino Toscano 71f034d6b6 i18n: fix string puzzles in error messages
Do not split the error messages and the error details, but rather use a
single string with proper placeholders. This avoids string puzzles.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Pino Toscano ed836c7138 i18n: avoid string puzzle
Create the complete sentence as single message, instead of joining an
existing message with few words more.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Pino Toscano e300dd5da8 i18n: improve labels for disk
Use whole strings for the labels of disks, including the bus (if
available), and the index.

There are still generic fallbacks for the disk types not explicitly
handled.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Pino Toscano 9c7df6a7cd i18n: translate "device on address" string
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Cole Robinson 00fa636682 tests: uitests: Fix after string changes
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano 7b46ee1947 i18n: improve label for floppy
Shortcut all the checks, and directly return the whole string (index
included) to show for floppies.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano 664197bcc7 i18n: improve label for filesystem
Use a single string with a placeholder for the path to avoid a string
puzzle.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano 5609a7f083 i18n: improve vmmAddHardware.disk_pretty_bus
Use a static mapping of translated strings, instead of manipulating the
string.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano 224bb91afc i18n: improve label for redirector
Use placeholders for the bus name, and the index; the latter is part of
the string, to avoid a string puzzle.
Also use vmmAddHardware.disk_pretty_bus() to get the proper translated
string of a bus.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano 90e2bdcb3e i18n: improve translatability of vmmAddHardware.input_pretty_name
A single "Generic" message glued together with capitalized names of bus
and type is a really bad string puzzle:
a) the parts cannot be moved around, while they could depending on the
   language
b) the type cannot be translated, and things like mouse/keyboard/tablet
   are usually translated
c) "generic" as adjective must get the proper gender depending on the
   name it refers to

Hence, unroll 6 more whole strings for the most common combinations of
type and bus. Otherwise, use strings with the type, as it is needed
because of (c) above. At last, fallback to a generic string, still
allowing (a) above. In both cases of fallback, the bus is still properly
translated.

In all the cases, use constants instead of explicit identifier strings.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano e391489b49 i18n: translate custom URI string in new conn dialog
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano 106d6b5478 i18n: improve items in destination combo
Translate as a whole the UI description of a URI along with the detail
for it, if available. This way there is no string puzzle, and it is
possible to tune the detail string according to the language.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano 839b5501cf i18n: translate whole title in migration dialog
Translate the whole string of a title in the migration dialog, including
the markup, so there is no string puzzle.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano deb6462843 i18n: avoid string puzzle in display autoport string
When updating the checkbox aobut the automatic port, set a full string
(without or with the port) instead of "cutting" an existing label.
Not only it avoids to manipulate a UI string, it also allows translators
to properly translate the whole string that includes a port.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano d58b3fedaa i18n: improve label for controller
Use a proper string with placeholders for the controller name and index,
to avoid string puzzles.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano d5fc02c6ae i18n: improve labels for TPM
Use separate strings for the path case, and for the generic case (i.e.
the version), to avoid string puzzles.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano 9d81aae894 i18n: improve labels for RNG
Use a separate string in case it has an associated device to avoid a
string puzzle.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano aa369e7a8d i18n: improve labels for serial/parallel/console
Split the handling of serial, parallel, and console in their own cases,
as the common code is less than the non-common one.

Use separate strings in case the port number is available to avoid
string puzzles.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano 864fbfbbcf i18n: translate labels for NICs
Translate the labels for a NIC, both when a MAC address is available and
when it is not.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano 42463cde9c i18n: simplify vmmAddHardware.controller_pretty_desc
Shortcut the specific cases, avoiding string puzzles; keep using
vmmAddHardware.controller_pretty_type() otherwise.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano 838c8524d2 i18n: translate all controller types
Translate all the types of controllers (e.g. USB, PCI, etc), so they can
be translated/translitterated in case they need to be.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano 2927299411 i18n: improve labels for channels
Use separate string in case we have the channel name, and in case we
have the channel type.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano 0145d9838b i18n: fix few spellings
"iSCSI", "KVM", "QEMU", "UNIX", "UUID", "VirtIO", "XML", "vCPU".

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Cole Robinson fec9f0b136 po: Fix message format warnings printed from xgettext
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-11 19:18:38 -04:00
Cole Robinson a8d2438d5a devices: interface: Rename is_conflict_net -> check_mac_in_use
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-06 10:17:10 -04:00
Cole Robinson f27e203732 cli: Skip MAC collision error with --check mac_in_use=
There's valid cases where a VM can be defined with a conflicting MAC
address. Prior to  ebd6091cc8 and related refactorings we were more
lax here if the conflicting VM wasn't running, but now we are blocking
some valid usage.

Hoist the validation check up to cli.py and add --check mac_in_use=off
to skip the validation. Advertise it like we do for other checks, so
now a collision error will look something like:

The MAC address '22:11:11:11:11:11' is in use by another virtual
machine. (Use --check mac_in_use=off or --check all=off to override)

Reported-by: Pino Toscano <ptoscano@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-06 10:17:10 -04:00
Cole Robinson 5733d8941c addhardware: Fix invoking netlist validate()
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-06 10:17:10 -04:00
Cole Robinson 3ea9a96961 tests: pylint: Silence some false positives
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-04 18:05:27 -04:00
Daniel Henrique Barboza 721108002d netlist.py: remove the extra 'None' return in get_network_selection()
Commit v2.2.1-200-g4c3c53f7 ("virtManager: Remove network portgroup
UI") removed 'portgroup', the fourth value of the returned tuple in
get_network_selection(), and all related code that was using this
extra value.

That change forgot to change the line where, if no rows are found, a
tuple with "None" values is returned. The "None" tuple is still
returning 4 "None" values. Since no remaining code is checking for
a fourth value, this is benign and has no impact in the logic.

'pylint' does not seem to care though, and it is complaining about
'unbalanced-tuple-unpacking' because, in the condition mentioned above,
a fourth "None" value is returned and no one is bothering checking for
it.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2020-07-04 17:56:57 -04:00
Daniel Henrique Barboza 97eda595d3 virtManager/clone.py: codespell fix
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2020-07-04 17:56:57 -04:00
Han Han f34f73622d rng: add builtin rng backend model
The builtin rng backend uses getrandom syscall to generate random, no
external rng source needed, introduced from libvirt v6.1.0.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Han Han <hhan@redhat.com>
2020-04-21 13:05:42 -04:00
Cole Robinson f6eee380a2 preferences: Fix dialog when invalid keygrab is set
https://bugzilla.redhat.com/show_bug.cgi?id=1810106

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-04-13 12:44:47 -04:00
Cole Robinson e79b550419 Fix pylint with latest pylint version
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-30 16:04:12 -04:00
Stefan Berger cd1713c6f2 tpm: add SPAPR (ppc64) device model
Add support for the tpm-spapr device model for pSeries VMs.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-03-30 15:59:37 -04:00
Cole Robinson 1afdc7ae32 createvm: Rework to track all Guest/Installer params explicitly
Rather than build a guest and installer instance depending on where
we are in the UI, track each input property in an explicit class, so
we can rebuild the guest/installer on demand with data accumulated
up to that point.

This makes the flow easier to follow and simplifies a lot of hacks we
have to do when backing up through the wizard, because we are trying
to unwind changes from an existing object, rather than just blowing
it away and easily reassembling it with updated info.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-02-05 19:39:45 -05:00
Cole Robinson eb605cccd8 tests: uitests: More createvm testing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-02-05 19:39:45 -05:00
Cole Robinson bea5e56c26 virtinst: connection: Add is_privileged
Replace the is_session and is_system distinction with variants
of is_privileged. This matches what libvirt uses internally, and
will help with supporting qemu:///embed at some point

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-02-03 07:05:11 -05:00
Cole Robinson 67ef81895e virtManager: Convert to CSS for most color usage
* Add CSS data in config.py and install it
* Strip out all hardcoded colors and use style class annotations
* Fix colors to be more theme appropriate to fix dark theme look

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-02-03 07:05:11 -05:00