Commit Graph

1890 Commits

Author SHA1 Message Date
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
Pino Toscano 83f1544d32 inspection: create and use a separate vmmInspectionApplication
Instead of passing around the raw results of
g.inspect_list_applications(), create an helper vmmInspectionApplication
object with the data of an inspected application that we use.  This is
done for different reasons:
- when using the data, it is easier to use member variables instead of
  looking up values in a dictionary
- we keep only the data needed, slightly lowering the memory/objects
  used for the inspected applications
- it will be easier to switch from g.inspect_list_applications() to
  g.inspect_list_applications2() without changing code outside the
  inspection code

Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-04-18 13:44:34 -04:00
Pino Toscano 6a5b06b8ed inspection: save the package format
Save the package format of a guest as part of its inspection data, so
later on it can be used to tweak other results (like the version of
installed packages).

Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-04-17 19:11:12 -04:00
Pino Toscano ceed47558c inspection: fix check of mounted filesystems
The old code basically always set filesystems_mounted to True, even when
no filesystems were mounted successfully, unless
g.inspect_get_mountpoints() failed (very unlikely).

Instead, set it when at least one filesystem is mounted; considering
that the first filesystem to be mounted is usually /, then failing to
mount it will usually prevent the mounting of the others.  In any case,
we can try to extract data even when only / is mounted, which can work
depending on the mount points of the guest.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-04-17 19:11:12 -04:00
Pino Toscano ac2949bab3 inspection: simplify mount points sort/mount
Rely on the Python 3 sorting facilities to sort the mount points using
a key based on the length of the mount point, doing the same effect as
the old compare function.

As side change required by this, enable python_return_dict on the
GuestFS handle, so we get proper hashes instead of lists.  This requires
libguestfs 1.22, which is 6 years old by now (and other virt-manager
requires are way more recent than that).

Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-04-17 19:11:12 -04:00
Pino Toscano cf9f4a73f4 inspection: remove extra try/catch block
This block only catches failures in g.inspect_get_mountpoints(), as the
g.mount_ro() calls are already within own try/catch blocks.  Considering
that:
- g.inspect_get_mountpoints() is a simple API to query one of the
  results of the inspection, it is very unlikely that it fails
- the whole _inspect_vm function (that contains the inspection code) is
  already run within an own try/catch block, so even a failure in
  g.inspect_get_mountpoints() will not crash virt-manager
then just remove this extra try/catch block.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-04-17 19:11:12 -04:00
Cole Robinson 03fe68dedd addhardware: separate device building and explicit validation
Have two clear paths. This will be useful when we add direct XML
editing UI
2019-04-14 20:48:36 -04:00
Cole Robinson cda9525a87 netlist: separate device building and explicit validation
Have two clear paths. This will be useful when we add direct XML
editing UI
2019-04-14 20:22:02 -04:00
Cole Robinson 11ffe2e569 addstorage: separate device building and explicit validation
Have two clear paths. This will be useful when we add direct XML
editing UI
2019-04-14 20:22:02 -04:00
Cole Robinson eb870e4658 addstorage: Drop prompting to start default pool
Just let virtinst try and start it for us, and fail if it's the
startup fails. Prompting about this doesn't really buy us anything
2019-04-14 20:22:02 -04:00
Cole Robinson 202ac53831 addhardware: Drop self._dev
Return the generated virtinst device up through the call chain.
Makes the flow a lot more sensible, and will be needed for separating
device building from extra UI validation/prompting
2019-04-14 20:22:02 -04:00
Cole Robinson 5a90b669ff addhardware: Use vmmHost style error page paradigm
Rather than making the error page one of the hardware pages which is
the wrong layering approach
2019-04-14 18:24:35 -04:00
Cole Robinson c3ea2d3119 host: Don't try to confirm changes on window close
It's a bit of a pain to get right, so only do it on net/pool list
change
2019-04-14 18:24:04 -04:00
Cole Robinson f7ba2f2f99 error: Add helper confirm_unapplied_changes
For the common dialog we use to confirm changes
2019-04-14 18:24:04 -04:00
Cole Robinson f246895a66 storagelist: Modernize code style
* Have clear UI callbacks
* Group functions
* Simplify active_edits
* Remove no longer needed _reset_pool_state
* Clean up selection callbacks
2019-04-14 18:24:04 -04:00
Cole Robinson 86a13699ce host: separate out hostnets.ui and hostnets.py
Helps organize things by limiting the files to a single class of
operations, and follows the storagelist.py pattern
2019-04-14 18:23:58 -04:00
Cole Robinson 891968085c host: Modernize code style
* Privatize non-public functions
* Have clear UI callbacks
* Group functions
* Simplify active_edits
* Remove no longer needed reset_net_state
2019-04-14 17:05:14 -04:00
Cole Robinson de773179ef host: Remember window dimensions
Like we do for details and manager windows, save window size in
gsettings and remember it across app runs
2019-04-14 17:05:14 -04:00
Cole Robinson 3784864e10 baseclass: Add is_visible
Remove the duplicated implementations everywhere
2019-04-14 17:05:14 -04:00
Cole Robinson 5367f3343a details: Clean up vsockdetails on window cleanup 2019-04-13 16:45:26 -04:00
Cole Robinson f2239bad00 console: Use popup_at_rect
Added in gtk 3.22 to fix some wayland ambiguity. Needed for sway wm
multimonitor apparently:

https://bugzilla.redhat.com/show_bug.cgi?id=1694379
2019-04-07 13:54:00 -04:00
Cole Robinson 927d668215 virtManager: Use popup_at_pointer
Added in gtk 3.22 to fix some wayland ambiguity. Needed for sway wm
multimonitor apparently:

https://bugzilla.redhat.com/show_bug.cgi?id=1694379
2019-04-07 13:54:00 -04:00
Cole Robinson 70b42134d2 console: Don't use nested function for send_key click cb 2019-04-07 13:54:00 -04:00
Cole Robinson 4a95d1ba74 console: OverlayToolbar cleanups
- Privatize unaccessed variables
- Use standard __init__ pattern
- Drop some __init__ variables
2019-04-07 13:54:00 -04:00
Pavel Hrdina 8720637cff virt-manager: add new checkbox to control CPU security features
By default we copy CPU security features to the guest if specific CPU
model is selected.  However, this may break migration and will affect
performance of the guest.  This adds an option to disable this default
behavior.

The checkbox is clickable only on x86 and only on host where we can
detect any CPU security features, otherwise a tooltip is set to notify
users that there is nothing to copy.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-04-04 15:32:42 +02:00
Cole Robinson 091dae5d65 Fix a couple new pylint warnings 2019-04-01 16:18:00 -04:00
Pavel Hrdina fb5136a6a9 domain: cpu: automatically add CPU security features for "custom" mode
If user selects specific CPU model to be configured for guest we will
automatically add CPU security features to make sure that the guest is
not vulnerable to these CPU HW bugs.

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

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

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-03-19 13:41:53 +01:00
Erik Skultety 67acebc2b3 Fix a few issues reported by codespell
There were a few minor typos across the codebase which codespell pointed
out.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2019-03-18 13:04:53 -04:00
Andrea Bolognani 971f9d517d addhardware: Don't prevent ppc64/pseries from using virtio-scsi
This doesn't seem to do anything, as we end up with with a
virtio-scsi controller anyway both when using virt-install and
when using the GUI, and it's not correct anyway because there's
nothing preventing ppc64/pseries guests from using virtio-scsi.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-06 14:00:11 -05:00
Marc Hartmayer ee5f3eab4b support: Add SUPPORT_CONN_DEVICE_BOOT_ORDER
...and use it in domain.py.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:34 -05:00
Pavel Hrdina a02fc0d022 virtManager: clone: build default clone path if we know how
Function do_we_default returns only if we want to default to clone disk
even if we know how to create default clone path.  Only in case that the
storage pool is TYPE_DISK we don't know how to create default path and
we cannot default to clone that disk.  In all other cases as ReadOnly
disk or Shareable and so on we can prepare the default path for user if
they decide to clone it.

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

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-03-06 17:19:00 +01:00
Pavel Hrdina b206931eb9 virtManager: domain: override rename_domain in vmmDomainVirtinst
If user renames guest in VM details page before installation starts
there is no need to rename NVRAM file as well.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-03-05 15:49:23 +01:00
Cole Robinson ef279273af virt-manager: add --show-domain-delete
Launches delete wizard on top of a VM window, so when domain is
deleted, VM window disappears and the whole app exits
2019-03-04 14:04:34 -05:00
Pavel Hrdina 26a433fc42 virtManager: clone: check which storage pools supports volume cloning
When cloning a guest in virt-manager the GUI shows a list of disks and
select default cloning policy for every disk.  For storage pools where
we know that cloning is not possible we should not select that option
as default one.

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

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-03-04 13:23:45 +01:00
Pavel Hrdina a0b42327c6 graphics: move all listen code into one place
Instead of duplicating the code into CLI and GUI move it into graphics
device file which is used from both places.  This also fixes a bug in
virt-xml where changing listen to address was not working.

This also changes behavior to always configure one listen type when
using CLI listen option or GUI.  If user wants to modify only specific
listen type they can use listens[] options from CLI.

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

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-02-28 11:48:09 +01:00
Cole Robinson ae8a4f3db3 engine: Fix first run startup error (bz 1674040)
unitpath can be used uninitialized

https://bugzilla.redhat.com/show_bug.cgi?id=1674040
2019-02-08 15:50:15 -05:00
Cole Robinson 10973c7932 guest: Add find_device to Guest
It operates on a Guest object, so it makes sense
2019-02-07 17:36:10 -05:00
Marc Hartmayer 12e8456da2 domain: Move set boot order responsibility to guest
Move set boot order responsibility to guest XML builder.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:50 -05:00
Marc Hartmayer c5f8f3e640 guest: Add get_boot_order method
Add 'get_boot_order' method. This method has an optional parameter for
getting the legacy boot order defined in the OS node of the domain
definition.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:50 -05:00
Marc Hartmayer 853237aebc domain: Move get boot order methods to guest
Move get boot order methods to guest XML builder. For this we must
replace self.get_bootable_devices() with
self.get_bootable_devices(exclude_redirdev=True) in the
_get_device_boot_order and set_device_boot_order to have no
functionality change.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:50 -05:00
Marc Hartmayer d0c2750da5 domain: Move use_device_boot_order to guest
Move use_device_boot_order to guest XML builder and rename it into
'set_device_boot_order'.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:50 -05:00
Marc Hartmayer f06a16bffd domain: Try to untangle __use_device_boot_order
Operate only on @boot_order and @guest and not on @self. This allows
us to refactor this functionality in the next patch. Additionally,
simplify the used algorithm without functionality change.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:49 -05:00
Marc Hartmayer e6c14e2e79 domain: Try to avoid self access since we're operating on guest
Try to avoid self access since this function operates on the guest
definition only. This is needed for later refactoring as it will
reduce side-effects.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:49 -05:00
Marc Hartmayer 735d8b75c9 domain/guest: Add get_bootable_devices() method
Add a method to the Guest XMLBuilder for getting all bootable devices
of the guest definition with the option to exclude the redirdevs in
the returned list.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:49 -05:00
Marc Hartmayer 3365838b1b Move (find|compare)_device to guest.py
Move (find_compare)_device functions to guest.py as it will be used
there in an upcoming patch.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:49 -05:00
Cole Robinson bc98c21758 installer: Remove need_scratchdir
create.py doesn't really need to know about it. It just needs to know
what paths the install process is going to be accessing.
2019-02-07 13:58:55 -05:00
Pino Toscano 1018ab4484 inspection: handle failures in application listing
The Python binding of libguestfs errors out in case any of the details
(e.g. summary, description) of an application are not proper UTF-8.
This seems a rare situation, which nevertheless causes the failure of
the inspection of a guest, making the rest of the metadata not used.

While these encoding issues are tackled, and fixed in python-libguestfs
(or libguestfs itself), gracefully handle the failure of
inspect_list_applications(), so at least the rest of the details of a
guest are used/shown.
2019-02-07 09:59:28 -05:00
Cole Robinson c6dd050147 netlist: Assume type=network if source/@network present (bz 1669265)
When a VM is using interface type=network with a forward mode=bridge
network, on qemu domain startup the runtime XML will be changed to
type=bridge and both source/@bridge and source/@network will be filled
in, which breaks some assumptions virt-manager had internally.
Unfortunately this isn't easy to test with the unittest driver either.

https://bugzilla.redhat.com/show_bug.cgi?id=1669265
2019-02-04 17:43:42 -05:00
Cole Robinson f7508d024d addhardware: Fix setting optimal default net model
We were unconditionally reseting it to the first list entry
2019-02-03 19:47:54 -05:00
Cole Robinson 21465e2af7 create: Differentiate detection between cdrom and location
Behind the scenes there is a difference, like windows media won't
validate as a 'location' because it doesn't have a direct bootable
kernel/initrd.
2019-02-03 16:15:54 -05:00
Cole Robinson a391613b9f engine: More logging for --test-first-run 2019-02-03 15:46:32 -05:00
Cole Robinson 314ceab878 connectauth: Convert dialog to glade format 2019-02-03 15:23:05 -05:00
Cole Robinson 4b5cfe3cbb createvol: Fix showing backing store UI on first run (bz 1670266)
Whether we check for a vol-format value shouldn't be dependent
on whether the UI is on screen (is_visible), but whether the UI
is requested to be shown (get_visible)

https://bugzilla.redhat.com/show_bug.cgi?id=1670266
2019-02-03 12:37:41 -05:00
Cole Robinson 9e4287321f urlfetcher: Drop explicit prepare/cleanup calls
We can do this automatically easily enough. The downsides of
not cleaning up are pretty minor these days anyways without
the 'mount' handling
2019-02-03 12:05:18 -05:00
Pino Toscano bce4cc4ef8 inspection: fix check of null icon
Recently the Python binding of libguestfs was adapted to properly use
bytes in APIs that return data, instead of (ab)using strings [1].
This change was done only when built for Python 3, which has this
distinct bytes and strings.

Because of that, now the 'icon == ""' (empty string) checks fail, using
whatever inspect_get_icon() returns, including empty arrays of bytes.
Hence, change the checks to use the length of the data as condition, as
also the libguestfs Python API documentation says.  Leave also the
checks for None, in the remote case the API will return None in the
future for no data.

[1] 0ee02e0117
2019-01-30 18:06:26 -05:00
Pavel Hrdina 943b2a400e details: allow to remove video device if it's not the last one
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1659354

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-01-28 17:55:38 +01:00
Lin Ma eadb5b6193 vsockdetails: Show CID for active VM if the attribute auto is set to yes
Signed-off-by: Lin Ma <lma@suse.com>
2019-01-21 13:49:56 +01:00
Slavomir Kaslev 63db4de0b5 Remove Author lines from files
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
2019-01-15 13:55:53 -05:00
Pavel Hrdina ad77f4fe83 createnet: fix typo introduced by commit dae8642bb
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-01-15 15:55:44 +01:00