Commit Graph

2050 Commits

Author SHA1 Message Date
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
Cole Robinson 1ad470c021 inspection: Some cleanups
* Simplify the queue data, just push in VM data to refresh
* Do less work in threads
* Slight rework of updating inspection data in the VM

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-02-01 22:02:59 -05:00
Cole Robinson 53aba9204d connection: Fix stats polling
Commit 419f8cd31b messed up the dopoll rework, which meant we
never called stats polling on the master object list. Fix it, but
do so by unwinding the redundant internal _update routines

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-02-01 21:28:07 -05:00
Cole Robinson 5573aeb441 createnet: Fix XML editor error when dhcp fields are empty
We need to handle the case when ip == None

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-29 18:53:31 -05:00
Cole Robinson 635073eef5 createnet: Drop row coloring validation
Because we are a single screen now, just let libvirt perform
the validation for us

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-29 18:53:31 -05:00
Cole Robinson 140a1f3b15 cloner: Drop ability to clone a paused VM
Generally this doesn't work with qemu metadata locking nowadays,
and it was never a safe idea to begin with, because disk contents
could be in an inconsistent state.

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-29 18:34:38 -05:00
Cole Robinson 3859725739 createvm: Fix showing 'Import' disk UI
We were triggering the wrong install page number, after adding
the Manual Install option

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-29 18:34:38 -05:00
Cole Robinson b671c7cf41 libvirtobject: Always define even if XML isn't different
This should be a rare occurence, and it ensures that the UI reflects
the latest XML

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-29 18:34:28 -05:00
Cole Robinson 519fed3b91 addhardware: Remove dead virtio-scsi collision code
The way we set controller_model earlier, means all the virtio-scsi
allocation code is essentially never set. That code does still fix
a valid case of when trying to add a scsi device when there isn't
any remaining slots open, but that should be rare enough that I'm
fine telling the user to edit manually set up a controller themselves
first.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-29 06:52:29 -05:00
Cole Robinson bd4b841b10 addhardware: Remove IO and scsi reservation options
These were removed from the Details dialog previously, but I forgot
to remove them from addhardware too

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-29 06:44:41 -05:00
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 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 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 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 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 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 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 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
Cole Robinson 8ed9eef905 netlist: Use same default policy as virt-install
virt-manager's logic is hard to follow, and gives weird results
by just choosing the first bridge device it finds more or less.

Use virt-install's logic: bridge if it is the default route,
otherwise network 'default' if it exists

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson 66e1eb7324 netlist: Add 'Macvtap device...' manual entry
Similar to the bridge option. We will be removing the explicit
device listing support soon, so this will be required for specifying
a macvtap device

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson 00da972b14 netlist: Rename 'Specify shared device' to 'Bridge device...'
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson 227d6982ae virtManager: Drop macvtap 'source mode' UI
Some related bits were discussed here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html

"""
  * macvtap is kinda problematic in general because it doesn't provide
    out of the box host<->guest communication, and it requires a
    special XML option just to get working ipv6. Users that know they
    want it usually know this distinction, but if someone chooses it
    without understanding the implications it can cause confusion.
    This puts it hovering the intermediate/advanced user line which
    makes me want to not advertise it as prominently as we currently do,
    with an explicit list of host interfaces
"""

Part of this is that the only source_mode that will work in a useful
way for the vast majority of users is mode=bridge. Any of the other
modes either require special hardware, permissions, or other
configuration. Default to bridge mode. The XML editor is there for
anyone that knows they need something different

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson 4c3c53f773 virtManager: Remove network portgroup UI
portgroups are a way to group logical chunks of settings inside
a <network> object. They are a quite advanced feature that I expect
many few users are using, and the ones that are using it are certainly
advanced enough to edit the XML directly.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson 8263d5c705 netlist: Reorganize row building a bit
This should be a no-op.

* Remove unused is_active field
* Access row indexes with named fields
* Move the row building outside the main class, to make it clear
    these are just helper methods

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson a18117ae30 createvm: Remove the PXE install network warning
This is pretty obscure, and PXE installs will likely be reworked
in the near future. Drop it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson 4fce7dde9a virtManager: Remove LXC idmap UI
This is pretty obscure, and requires a large amount of UI surface
to handle correctly. Users can use the XML editor if they know they
need or want this.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:32 -05:00
Cole Robinson 137b73df75 virtManager: Only allow editing disk bus for new VM
This was proposed here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html

"""
* disk: bus editing: maybe keep this for the customize wizard, but
it should go away for existing disks, changing it for an existing VM is
definitely a 'shoot yourself in the foot' type of thing for most users
"""

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:18 -05:00
Cole Robinson 7547905d79 virtManager: Remove max memory UI and memory hotplug support
This was proposed here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html

"""
* UI maxmem and maxcpu notions, and related memballoon and cpu hotplug
operations. These have been in the UI forever but I'm not sure people
actually use them. cpu hotplug has always been a mess, and unless the
user plans ahead by setting a high maxmem value ballooning is only good
for reducing memory. These all sound like advanced usage to me that
just confuses the typical usecase of adding more mem or vcpus to an
offline VM. And the hotplug operations with virsh are simple to invoke.
So I'd like to drop this from the UI
"""

The remaining field sets both max and current memory in the
inactive XML

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:24:22 -05:00
Cole Robinson 0335c9ce62 virtManager: Remove maximum VCPUS API and VCPU hotplug
This was proposed here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html

"""
* UI maxmem and maxcpu notions, and related memballoon and cpu hotplug
operations. These have been in the UI forever but I'm not sure people
actually use them. cpu hotplug has always been a mess, and unless the
user plans ahead by setting a high maxmem value ballooning is only good
for reducing memory. These all sound like advanced usage to me that
just confuses the typical usecase of adding more mem or vcpus to an
offline VM. And the hotplug operations with virsh are simple to invoke.
So I'd like to drop this from the UI
"""

The remaining UI field now sets both maximum and current VCPU
allocation.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:24:20 -05:00
Cole Robinson b4b497e28f virtManager: Remove network virtualport UI
This was proposed here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html

"""
* network virtualport configuration: this is some really obscure
stuff for configuring VEPA for macvtap devices. I don't think it gets
any usage in practice. I think a smaller subset of this UI is shared
with openswitch config but I believe it's just a single field, we
could keep that even though I don't think many people use it either
"""

This removes it all. The openvswitch piece was not properly wired
up anyways, since it requires setting virtualport type for a bridge.
For users that know they need that, they can add it via the XML
editor.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:22:18 -05:00
Cole Robinson 3c861131dd virtManager: error: Break long lines in error dialogs
Errors from libvirt can be super long, and stretch out the dialog like
crazy.

This causes some changes in test suite output, so adjust tests to
match

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:21:59 -05:00
Cole Robinson a162a3b845 virtManager: Remove disk driver_io UI
This was proposed here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html

The default driver_io value we use seems to be sufficient. It's very
rare to hear that users need to change the value to something
different, and if they do, they are advanced enough users that can
edit the XML directly IMO.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-25 14:30:07 -05:00
Cole Robinson 2367e70efa virtManager: Remove magic spapr-* device handling
We have lots of spapr-* pretty printing and some magic handling
spread around the codebase. These devices have fallen out of favor
and are rarely used, so drop the special handling

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-25 14:30:07 -05:00
Cole Robinson b583ea7e66 virtManager: Remove disk SCSI reservations UI
This is another advanced feature with a limited appeal. Users that
know they need this can set it directly with the XML editor

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-25 14:30:07 -05:00
Cole Robinson d9c0384607 virtManager: Remove disk SGIO UI
This is a very advanced field that is only shown for a quite
advanced disk device='lun' config. Users that know they need this
can easily set the value via the XML editor

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-25 14:30:07 -05:00
Cole Robinson 79fe886ac8 virtManager: Remove disk format/driver_type UI
This was proposed here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html

"""
* disk: storage format: this was from before the days when we
storage-ified everything and we could get the disk format wrong, telling
qemu it has a raw image when it's qcow2. shouldn't be needed anymore for
normal virt usage
"""

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-25 14:30:07 -05:00
Cole Robinson 1066867583 virtManager: Remove disk serial UI
This was proposed here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html

"""
* disk: serial: I know this is useful in some cases but seems quite
obscure. I think the XML editor is fine unless there's some common
usecase I'm missing
"""

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-25 13:45:43 -05:00
Cole Robinson bd82ef6529 virtManager: Remove spice tlsport UI
This was discussed here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html

tlsPort is an advanced config feature. With the XML editing support,
it's less important to have this as a first class UI element. Users
that know they need this setting can set it directly in the XML

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-24 17:04:29 -05:00
Cole Robinson 7251ea25c2 virtManager: Remove graphics keymap UI
Removing this was discussed here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html

For a decade, qemu and xen and virt-manager work together to
make setting a manual keymap redundant. Advertising it in the UI does
more harm than good, because users may think they need to specify
one when in the vast majority of cases it will give worse behavior.

With the XML editing UI, users still have a way to do this by hand
if they really know what they are doing.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-24 17:04:29 -05:00
Cole Robinson 419f8cd31b pollhelpers: Streamline usage a bit
* Explicitly define the build 'cb', don't use lambda
* Rename pollhelpers arguments, clarifying use of cb
* Check support status in pollhelpers
* Move 'dopoll' checking up a level in vmmConnection

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-24 17:04:29 -05:00
Cole Robinson 4147f760e8 connection: Explicitly error if domain listing APIs are not supported
This will be more important when we drop old domain polling APIs,
because it will be more likely we encounter an old libvirt or weird
connection without the expected API support

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-24 15:39:41 -05:00
Cole Robinson 1aff5a611e connection: Remove is_*_capable wrappers
Call the conn.support check directly. Move the check logging to
the initial startup path

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-24 15:39:41 -05:00
Lily Nie b2a424baa6 delete: remove redundant code
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2020-01-24 10:27:15 -05:00
Lily Nie 3c6a5f4536 delete: Add _destroy_vm method
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2020-01-21 19:53:53 -05:00
Lily Nie 928c049c9d delete: Add _delete_disks method
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2020-01-21 19:53:53 -05:00
Lily Nie 52782a4958 delete: Add _delete_vm method
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2020-01-21 19:53:53 -05:00
Lily Nie 8ae0c8ca0e delete: Add _vm_active_status method
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2020-01-21 19:53:53 -05:00
Lily Nie 92200ef413 delete: Add _get_title_text method
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2020-01-21 19:53:53 -05:00
Lily Nie 1ae83cbb82 delete: Add _get_disk_datas method
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2020-01-21 19:53:53 -05:00
Lily Nie 4971e47566 delete: Add vmmDeleteStorage class
We should try to hide all the self.vm vs self.disk differences into
individual functions to make the code easier to follow and to avoid
touch those values by accident in the future

Reviewed-by: Cole Robinson <crobinso@redhat.com>
2020-01-21 19:53:53 -05:00
Cole Robinson 9346c22134 baseclass: Log if emit() called from non-MainThread
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-15 15:19:55 -05:00
Lin Ma 15a9502b7b details: Fix showing the firmware type in case of firmware auto selection
For a shutoff VM, If user select uefi firmware auto selection, e.g.
<os firmware='efi'>
...
</os>

Its firmware information is set to 'BIOS' in details, This is incorrect.
This fixes it.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Lin Ma <lma@suse.com>
2020-01-15 10:21:46 -05:00
Cole Robinson af3d678bdd domain: Only log once about waiting for qemu agent for set_time
Rather than one every wait period, which spams the debug logs

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-14 14:21:30 -05:00
Michael Weiser b7a223030b virtManager: object: domain: Stop set time thread
Wire up stoppping of the time setting thread for actions that make
setting of guest time pointless.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
2020-01-14 14:10:28 -05:00
Michael Weiser f29196f3af virtManager: object: domain: Increase set time timeout
With the potential for annoyance eliminated, raise the timeout for guest
agent connectivity to 30 seconds.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
2020-01-14 14:10:28 -05:00
Michael Weiser 9aa5997dd7 virtManager: object: domain: Add timeout config
Make the guest agent wait timeout and sleep interval properties of the
thread manager class better visibility and easier adjustment.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
2020-01-14 14:10:28 -05:00
Michael Weiser bfafe1e4b2 virtManager: object: domain: Spawn thread for set time
Sleeping in a loop waiting for the qemu guest agent to come online would
leave an annoying progress dialog while the domain would actually be
fully useable already. Additionally, multiple progress dialogs could
actually accumulate on screen if the user managed to suspend/resume fast
enough or the timeout was just long enough.

Defer regular retries into a separate thread to allow the progress
dialog to disappear immediately after the actual action completed. The
thread is encapsulated in a new class _vmmDomainSetTimeThread which
holds state, decides whether to at all wait for an agent to come online
or even try to set the guest time in the first place. It also holds
state (thread running or not), configuration (timeout and retry
interval) and provides an interface to start and stop the time setting
operation.

A later patch will wire up stopping the operation.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Suggested-by: Cole Robinson <crobinso@redhat.com>
2020-01-14 14:10:28 -05:00
Michael Weiser 4f8a27688d virtManager: object: domain: Refactor guest time setting
Sleeping in a loop waiting for the qemu guest agent to come online
leaves an annoying progress dialog while the domain may actually be
fully useable already. Additionally, multiple progress dialogs can
actually accumulate on screen if the user manages to suspend/resume fast
enough or the timeout is just long enough.

To avoid these, we want to defer retries into a separate thread to allow
the progress dialog to disappear immediately after the actual action
completed.

In preparation for that, add a new class _vmmDomainSetTimeThread that
will eventually manage that separate thread for guest time setting
operations. Move the current code for waiting for the qemu guest agent
into it without any semantic changes.

Make set_time() and agent_read() of vmmDomain accessible from the
outside so that _vmmDomainSetTimeThread can call back into them. Add
has_agent() to be able to find out if the domain has an agent configured
without leaking the actual agent config.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Suggested-by: Cole Robinson <crobinso@redhat.com>
2020-01-14 14:10:28 -05:00
Michael Weiser 827c948121 virtManager: object: domain: Simplify agent ready check
Just return the boolean value of the condition for simlicity.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
2020-01-14 14:10:28 -05:00
Cole Robinson a9cbc4e583 error: Set a cap on error dialog text size
Otherwise we can get some crazy sized dialogs with errors from
libvirt

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-14 12:40:39 -05:00
Pino Toscano b1b9e4b688 Avoid string puzzle
Do not join two parts of sentences together, because it is problematic
to translate. Instead, use a different sentence depending on the
condition.

Fixes commit d52c9d1ffa.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-01-14 12:40:25 -05:00
Lily Nie 2138cca6a5 Handle the warning messages for disk device and non-disk device differently
add a remove-non-disk function and move the yes/no confirmation handling there

Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-12-23 16:43:05 -05:00
Michael Weiser d62ca8220b details: snapshots: Warn of saved state on creation
Add a confirmation dialog when creating a new snapshot if there is saved
memory state so the user is aware that memory state will not be part of
the snapshot.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Suggested-by: Cole Robinson <crobinso@redhat.com>
2019-12-23 16:27:52 -05:00
Michael Weiser a8c25450bd details: snapshots: Drop saved state on restore
Refuse to restore a non-running state from snapshot while there is saved
memory state in order to avoid filesystem corruption. Present a message
to the user to that effect and let them choose to either abort the
operation or drop the saved state before restoring the snapshot.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Suggested-by: Cole Robinson <crobinso@redhat.com>
2019-12-23 16:27:52 -05:00
Michael Weiser 8084639cd8 virtManager: object: domain: Fix snapshot run check
snap.is_running() returns a boolean and checking that against
VIR_DOMAIN_RUNNING worked by pure coincidence only. Just use the bool
value and give it a more speaking name while at it.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
2019-12-23 15:35:38 -05:00
Lily Nie d52c9d1ffa Offer to delete the storage files without removing the VM
we should let users decide whether they want to also delete the
storage files or just dev from UI when they click the Remove button

Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-12-18 16:29:58 -05:00
Lily Nie 8b7854af1f Modify the remove_xml_dev function
add a remove_disk function,so that we can do some special things when remove a disk

Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-12-18 16:29:58 -05:00
Christian Ehrhardt 2a63003133 virtManager: disambiguize LXC
LXC can be many things and in particular when seeing just "LXC" in the
virt-manager UI one might think of either
- Libvirt-LXC => https://libvirt.org/drvlxc.html
- Linuxcontainers LXC => https://linuxcontainers.org

Clarify that this is specifically Libvirt-LXC

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2019-12-17 17:56:54 -05:00
Michael Weiser adbcb06dd4 virtManager: object: domain: Set time on unpause and revert
Wire up setting of guest time on snapshot restore and resume from pause.
Do not try to set time if the restored snapshot does not contain a
running domain state.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Suggested-by: Cole Robinson <crobinso@redhat.com>
2019-12-17 17:51:05 -05:00
Michael Weiser fa7d3eeb7b virtManager: object: domain: Check for guest agent
For qemu, only run the API if the VM has the qemu guest agent in the
XML. If it is present, wait for it to come online instead of
unconditionally retrying a number of times.

Reuse agent function agent_ready() from refresh_interface_addresses()
and refactor it into two methods of which get_agent() can be used to
check for agent presence and further work with the channel object.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Suggested-by: Cole Robinson <crobinso@redhat.com>
2019-12-17 17:51:05 -05:00
Michael Weiser 163eea6924 virtManager: object: domain: Restrict time sync to qemu
Only run the API for qemu and test drivers, they are the only ones
that support it. This will save spamming logs with error output.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Suggested-by: Cole Robinson <crobinso@redhat.com>
2019-12-17 17:51:05 -05:00
Michael Weiser 8457145608 virtManager: object: domain: Set time on resume
Use a potentially available agent inside the domain to update guest time
after resume. Based on the same function in Nova[1].

[1] 414df1e56e

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
https: //bugzilla.redhat.com/show_bug.cgi?id=1222069
Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
2019-12-17 17:51:05 -05:00
Cole Robinson 82b75a93b6 delete: Add _DiskData class for tracking path delete metadata
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-11-20 15:22:03 -05:00
Cole Robinson 57a1f19841 delete: Clean up code layout a bit
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-11-20 14:47:07 -05:00
Cole Robinson fb2bfd610f details: Use Guest.lookup_domcaps helper
This ensures the Guest object domcaps cache is primed as well, which
prevents the CPU security features handling from constantly refetching
domcaps info.

We need to tweak the cache invalidation check in Guest to handle
some of the test suite hackery we do

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-11-12 14:20:36 -05:00
Michael Weiser 51d84c54cb connection: Avoid repeated default pool creation attempts
During startup virtinst.StoragePool.build_default_pool() tries to
determine whether the default storage pool already exists. Because
events have not yet been processed, the list of existing storage pools
is still empty. Therefore it seems as if it does not exist yet and
build_default_pool() falls back to creating it which causes an error
message from libvirtd in the system log:

libvirtd: operation failed: pool 'default' already exists with uuid.

Move default pool creation after event processing to avoid these
redundant creation attempts.

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
2019-11-12 12:28:34 -05:00
Florian Ludwig ae19d6d6ec fix resizing of spice clients with guest resizing enabled
Fixes 1414718
2019-11-12 11:46:35 -05:00
Fabiano Fidêncio d9736db9d9 addhardware: Add "bochs" display to the video list
https://bugzilla.redhat.com/show_bug.cgi?id=1753644

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-10-04 11:17:14 -04:00
Cole Robinson aadaaf8785 manager: Don't hardcode black text color
Improves readability on dark theme

Resolves: #52

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-10-02 10:32:04 -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 4d86e1129b createpool: Add _get_visible_text helper 2019-07-03 19:37:01 -04:00
Cole Robinson f21d7e4c27 storage: Add explicit StoragePool.lookup_default_pool
Rather than adding an option to build_default_pool which is only
used in one location
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
Cole Robinson b8074b4505 storage: Replace volume supports_property with supports_format
Helps to make usage more explicit
2019-07-03 19:37:01 -04:00
Cole Robinson 657b2bcb26 storage: move supports_volume_creation to virtManager
It's the only user
2019-07-03 19:37:01 -04:00
Cole Robinson 4a0b7f61c8 storage: move pool pretty printing to virtManager
It's the only user
2019-07-03 19:37:01 -04:00
Cole Robinson 267f226134 xmleditor: Fix the gtksource version checking
Previous commit was incomplete
2019-06-18 10:50:49 -04:00
Cole Robinson 033e97021e xmleditor: Handle gtksourceview3 as well as gtksourceview4
API differences don't seem to affect our usage
2019-06-18 09:54:58 -04:00
Cole Robinson 3062b5ce08 virtManager: Move a lot of misc files to lib/ 2019-06-17 00:12:32 -04:00
Cole Robinson fa3f25dc1c virtManager: rename connect.py -> createconn.py
connect.py is too ambiguous, and this naming is more consistent
2019-06-17 00:12:32 -04:00
Cole Robinson 121cf5528d virtManager: rename create.py -> createvm.py
To be more consistent with other create wizard naming
2019-06-17 00:12:32 -04:00
Cole Robinson b15510f3fd virtManager: rename storagelist to hoststorage
To match hostnets naming, and to be a bit more clear
2019-06-17 00:12:32 -04:00
Cole Robinson 16a608c37b virtManager: move vmwindow components to virtManager/details 2019-06-17 00:12:32 -04:00
Cole Robinson 9be836102e virtManager: move device UI files to virtManager/device/ 2019-06-17 00:12:32 -04:00
Cole Robinson a6c07fbfdc virtManager: Move object .py files to virtManager/object/ 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 e25318e037 console: Fix graphics_type_pretty invocation 2019-06-16 20:19:26 -04:00
Cole Robinson 337e84083f storagepool: Force refresh XML on refresh signal
The XML will report things like updated capacity information,
which we want to mirror in the UI

https://bugzilla.redhat.com/show_bug.cgi?id=1447962
2019-06-16 19:43:20 -04:00
Cole Robinson a2a09a49c7 clone: Fix syntax error 2019-06-16 19:23:27 -04:00
Cole Robinson b513388979 domain: Remove internal 'cloning' marker
qemu nowadays should reject the common cases here with its default
image locking. Our impl wasn't very good anyways so let's just leave
it up to the lower layers
2019-06-16 17:32:41 -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 5eb5913f34 domain: Ensure nvram path before trying to access it
https://bugzilla.redhat.com/show_bug.cgi?id=1667025
2019-06-14 21:50:08 -04:00
Cole Robinson d61f9d9995 details: Check for mac conflict in customize wizard
https://bugzilla.redhat.com/show_bug.cgi?id=1660467
2019-06-14 21:11:37 -04:00
Cole Robinson 147a3b4790 preferences: Disable systray option if we know it won't work
Basically on wayland, if appindicator isn't available

https://bugzilla.redhat.com/show_bug.cgi?id=1666597
2019-06-14 20:05:09 -04:00
Cole Robinson aabde5bbe6 domain: Remove pre-startup USB collision check
Libvirt nowadays will throw an explicit warning about this
exact situation. It doesn't guide people to virt-manager UI, but
then again it should be obscure enough that it doesn't warrant this
special corner case code to inform the user
2019-06-14 20:04:18 -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 d9729855ee guest: break out disable_hyperv_for_uefi
Having this at set_uefi time complicates the domain XML building
machinery, where we don't want things to have osinfo access.
Rearrange it so that editing cases call this explicitly, and
the XML builder just deals with it at the set_defaults time
2019-06-13 17:55:37 -04:00
Cole Robinson 19bcec651c virt-install: Push validation down into the installer
It's hard to validate whether something like --extra-args or
--initrd-inject is supported based on the command line arguments. It's
easier to let the installer.py figure it out because it's the
authoritative source
2019-06-13 14:00:04 -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 a5f4033493 details: add xmleditor UI
Handling this is a bit different from other bits, because:

1) the <device> editing paradigm is unique. We need to replace the
   device in line in the XML which is a new operation
2) the New VM customize pattern is tricky and needs lots of
   special handling
2019-06-13 07:15:46 -04:00
Cole Robinson df80852952 addhardware: add xmleditor UI 2019-06-13 07:15:46 -04:00
Cole Robinson 0937c1e54b createvol: add xmleditor UI 2019-06-13 07:15:46 -04:00
Cole Robinson 68b3cb16e5 createpool: add xmleditor UI 2019-06-13 07:15:46 -04:00
Cole Robinson 50d13d8c12 storagelist: add xmleditor UI 2019-06-13 07:15:46 -04:00
Cole Robinson 7d9d8d9237 createnet: add xmleditor UI 2019-06-13 07:15:46 -04:00
Cole Robinson 5f4510b4df hostnets: add xmleditor UI 2019-06-13 07:13:43 -04:00
Cole Robinson 18af72212b xmleditor: Add the shared code
The XML editor ui is a two tabbed notebook, one 'Details' tab
and one 'XML' tab. The latter has a gtksourceview and allows editing
the raw libvirt XML for whatever the selected object is.

API users will programmatically insert the xmleditor notebook into
their UI, with the existing UI under the details tab.
2019-06-13 07:13:43 -04:00
Cole Robinson ecb60c3062 Drop use of logging.info
Just use logging.debug in these random places
2019-06-11 17:55:09 -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 387614c641 generatename: Move libvirt collision handling to callers
Make every caller pass an explicit cb that handles libvirt
collision processing. Makes it easier to see exactly what is going
on at the call impls
2019-06-11 17:54:45 -04:00
Cole Robinson 47a6f3a6d5 storage: Handle guest collision checking
This pattern is already used in two places. Formalize and centralize
it
2019-06-11 17:54:45 -04:00
Cole Robinson 58dfe05344 virtManager: Remove some unnecessary generatename collidelist usage
The libvirt callbacks will handle this for us already
2019-06-11 17:54:45 -04:00
Cole Robinson 6e6a0b8a6a connection: Use shared default pool lookup logic
It wasn't abiding a different pool name pointing to our default
path
2019-06-11 17:54:45 -04:00
Cole Robinson e27202d178 createpool: Use StoragePool.default_target_path
Indirectly, rather than the less useful get_default_dir
2019-06-11 17:54:45 -04:00
Cole Robinson abb4719cee addstorage: Drop non-storagepool fallback code
This isn't tested, and the usecase will error later anyways when
we attempt to create storage.
2019-06-11 17:54:45 -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 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 6677f677da util: move generate_name to generatename.py 2019-06-07 18:16:53 -04:00
Cole Robinson c2de4d7c36 util: Move get_cache_dir to VirtinstConnection
Renaming it get_app_cache_dir so it doesn't conflict with get_cache_dir
usage in virtManager
2019-06-07 17:53:15 -04:00
Cole Robinson 6f5cd58ead util: Move pretty_* into virtManager code 2019-06-07 17:21:25 -04:00
Cole Robinson ca10e4094b util: move is_error_nosupport to SupportCache 2019-06-07 16:49:19 -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 3d2f678c0f support: Add a SupportCache class
For now it just contains all the SUPPORT ID numbers and public
functions.
2019-06-07 15:56:23 -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 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 9e56169813 connection: Drop unused filter_nodedevs devcap value 2019-06-05 16:35:34 -04:00
Cole Robinson 8221061ec5 domain: Absorb conn.get_nodedev_count
It's the only user
2019-06-05 16:35:34 -04:00
Cole Robinson d2462367ee virt-manager: Add --test-options
Will take a string of comma separated options which we can use to
tweak app behavior, for testing. Convert the existing --test-* options
to use the same abstraction internally. This will make it easier to
add new test options in the future
2019-06-05 16:28:05 -04:00
Cole Robinson 72dd4c8f83 config: Disable libguestfs inspection with --test-first-run
Adds some non-determinism to the active tests and pollutes the logs
2019-06-05 11:15:28 -04:00
Cole Robinson f2304664d6 snapshots: Split out vmmSnapshotNew class
Simplifies code org
2019-06-05 11:15:28 -04:00
Cole Robinson 318e0c0a39 vmwindow: Clean up vmmDetails on window cleanup 2019-06-05 11:13:33 -04:00
Cole Robinson d6e241897f createpool: Fix a couple gtk stderr warnings 2019-06-05 11:13:33 -04:00
Cole Robinson 5e7322edca libvirtobject: Make _redefine overrides more clear 2019-06-05 11:13:33 -04:00
Cole Robinson 0b4c6dd066 addhardware: tpm: select version 2.0 by default
The full default selection of CRB + version 1.2 is explicitly
rejected by libvirt. Select version 2.0 by default so it has
a chance of working
2019-05-17 15:57:53 -04:00
Cole Robinson 9d78759ac5 devices: redirdev: Use CharSource
redirdev does the same internally for libvirt, so let's follow that
pattern, and fix the fallout
2019-05-14 11:57:50 -04:00
Cole Robinson 6d46e37e09 devices: rng: Use CharSource
Re-use CharSource, just like libvirt does internally. Adjust all
callers to match. Rename type -> backend_model while we are here,
because type is ambiguous
2019-05-14 11:57:50 -04:00
Cole Robinson b2b9d7d366 devices: char: Add CharSource
Move all ./source handling into CharSource, which will be reused by
other device classes as well. This requires us to add ../ handling
into our xmlapi xpath engine
2019-05-14 11:57:50 -04:00
Cole Robinson 1b3e8e1a32 addhardware: Remove supports_property usage
It's not a pattern I think is worth extending in the future, and
make internal refactorings more difficult. Drop it, and drop it
from tpm and char devices since it is now unused
2019-05-13 14:06:32 -04:00
Cole Robinson bd6f751657 details: Drop char supports_property usage
Whether we show something in the UI should be more dependent on
whether it's actually set in the XML, not some internal hardcoded
list which can go out of date.
2019-05-13 13:38:46 -04:00
Cole Robinson e6eb1d447b devices: char: Rename some properties to better match XML
* bind_port -> bind_service
* source_host -> connect_host
* source_port -> connect_service
2019-05-13 12:35:55 -04:00
Cole Robinson a6495bb38f domain: virtinst: custom implement _redefine_xmlobj 2019-05-13 12:09:39 -04:00
Cole Robinson cfa1a0569b create: Use self._guest less in install path
Pass it around to all the callbacks as needed. Makes the flow easier
to follow
2019-05-13 12:09:39 -04:00
Cole Robinson a54b83072a addhardware: Remove unused is_customize_dialog 2019-05-13 12:09:39 -04:00
Cole Robinson 201dfdb23e netlist: Don't spam logs with errors on app shutdown 2019-05-13 12:08:55 -04:00
Cole Robinson 583dae7af5 details: Clarify config_apply variable names 2019-05-13 12:08:55 -04:00
Cole Robinson a506e3c108 details: Have a separate hw column for unique key
Right now we overload the DEVICE column for non-device pages
like overview or memory. Add a separate column for KEY, and have
DEVICE==None for non-device pages
2019-05-13 12:08:55 -04:00
Cole Robinson 491da67cbf details: Add _make_hw_list_entry helper 2019-05-13 12:08:55 -04:00
Cole Robinson 03bddaaeb3 details: Hardcode list icon size
We use the same value everywhere, so don't include it in the model
2019-05-13 12:08:55 -04:00
Cole Robinson f947afc3df details: split out a top level vmwindow
vmmVMWindow handles all the menuing, and coordinating between the
console, snapshots, and details panel. Simplifies the details
code a bit which will help when we add xmlediting
2019-05-13 12:08:55 -04:00
Cole Robinson ad4f869405 netlist: Don't spam logs with errors on app shutdown 2019-05-13 12:08:55 -04:00
Cole Robinson 1752b22828 createnet: Drop _validate routines
It's a mix of stuff libvirt already catches, UI sanity checking
like if user specified an empty field, and prompting for really
obscure corner cases. This stuff isn't important enough to carry
around all this code IMO
2019-05-13 12:08:55 -04:00
Cole Robinson 4141f5c79b createnet: Shrink to one page
Name and forward mode config are always visible. ipv4, ipv6, and
domain name are under their own expanders which are collapsed by
default.

This will fit better with the XML editor pattern and reduce the
urge to squeeze more UI elements into the now smaller wizard
2019-05-13 12:08:55 -04:00
Cole Robinson 7322d906b4 createnet: Turn forward mode selector into single combo box
Rather than a mix of radio buttons and other combo boxes.
This follows the pattern we more commonly use in other UI, and
makes it easier to hide UI elements that aren't relevant for
specific choices, like the possibly large SR-IOV selector
2019-05-13 12:08:55 -04:00
Cole Robinson 4b414cbcca createnet: Remove explanatory network labels
This wizard is sufficiently obscure that I don't think it's
really valuable to try to explain networking concepts with
UI labels. If users don't know what they are trying to create
by using this wizard, there's no way we are going to adequately
explain to them what they are looking at. The example values
should be self explanatory enough anyways
2019-05-13 12:08:55 -04:00
Cole Robinson 1fa0f7261b createnet: drop the @ipv6 setting
This only applies for inter VM traffic when ipv6 networking is
disabled, which IMO is pretty obscure. If users want ipv6
connectivity, just enabling ipv6 will handle it appropriately
2019-05-13 12:08:55 -04:00
Cole Robinson 0ae80d84d7 createnet: Remove static route configuration
This is fairly advanced stuff IMO and complicates the UI, and
it's inflexible as it only allows a single route. Drop it
2019-05-13 12:08:55 -04:00
Cole Robinson 1b6b6b10e3 createvol: Always generate a default name
Let's users just quickly click through, gives more testing
to the name_hint path
2019-05-13 12:08:55 -04:00
Cole Robinson bad894ad8c createvol: Modernize code style
* Have clear UI callbacks
* Group functions
* Privatize internal methods
* Don't carry around _vol internally
2019-05-13 12:08:55 -04:00
Cole Robinson 3694f45939 createpool: Modernize code style
* Have clear UI callbacks
* Group functions
* Don't carry around _pool internally
2019-05-13 12:08:55 -04:00
Cole Robinson 5b0b90c33e createpool: Switch to a single page
Just combine the pages. This simplifies the code and navigation, and
makes it easier to add XML editing
2019-05-13 12:08:55 -04:00
Cole Robinson 85a7b2cd61 virtManager: interface: Remove unused code after UI removal
Removal all the virtManager bits that are no longer used
2019-05-13 12:08:55 -04:00
Cole Robinson a5ae150201 guest: Rename curvcpus and cpuset to better match XML hierarchy 2019-05-12 17:25:47 -04:00
Cole Robinson 12440b00c1 osdict: return _OsResources to callers
Use the class helper routines to save some tedious dict management
2019-05-12 17:25:47 -04:00
Cole Robinson 135b97637e guest: Rename memory properties to match XML values
Right now we have:

* memory -> ./currentMemory
* maxmem -> ./memory
* hotplugmaxmem -> ./maxMemory

Which is just a mess to know what we might be really setting behind
the scenes. Rename the properties to match the XML element name, and
adjust all users to the new names. cli options aren't changed though
2019-05-12 17:25:47 -04:00
Cole Robinson 274d686252 host: Ellipsize long net/pool object names
https://bugzilla.redhat.com/show_bug.cgi?id=1698088#c5

Reported-by: Martin Kolman <mkolman@redhat.com>
2019-04-18 15:31:14 -04:00
Pino Toscano 23b87295fc details: avoid extra check when showing application names
The current code already prefers the "display name" over the "name" of
each application; hence, use "name" only if the "display name" is not
available.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-04-18 13:44:34 -04:00
Pino Toscano 4f79c22bf4 inspection: switch to g.inspect_list_applications2
Use the non-deprecated g.inspect_list_applications2() call to list the
installed applications.  It is available since libguestfs >= 1.20, which
is lower than the current requirement (i.e. 1.22).

Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-04-18 13:44:34 -04:00