Commit Graph

1262 Commits

Author SHA1 Message Date
Pavel Hrdina
c0710c74ff choosecd: change order of check operations
The current order of check operations is wrong.  First we set the new
path for the disk in question and after that we check whether some
guest already uses a disk with the same path.

The issue is that virt-manager returns a cached list of guests in
path_in_use_by() and the cached guest has the disk path already
updated.

Ideally we don't update the path at all, but we do it to run some
checks before the path is actually changed.  In order to fix the
referenced bug, change the order of check operations.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-19 20:04:39 -04:00
Pavel Hrdina
fd420fdacd domain: invalidate domain caps if machine type is changed
This forces to reload domain capabilities.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-19 10:40:09 +02:00
Cole Robinson
901dbaf4b7 details: Fix displaying isa panic device 2017-09-15 19:36:58 -04:00
Chen Hanxiao
04e35b2d85 pycodestyle: fix all E124 warnings
Fix all E124:
     Closing bracket does not match visual indentation

   Also remove ignore options of E124

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-09-09 23:21:42 +08:00
Pavel Hrdina
12117ba148 connection: change blacklist from array to dict
If initialization of new object fails we put it into blacklist and
newer parse it again until virt-manager is restarted.  This helps to
reduce number of failures if some object fails initialization every
time.

However, there are some cases where we put object into blacklist
incorrectly.  One of the cases is while creating new storage pool.
If the storage pool requires to be build before started but user
doesn't check to build it as well the start of the new storage pool
fails.  The issue is that at first we define that object which triggers
a lifecycle event for storage pool and queues new poll operation over
storage pools.  Before the poll operation starts the starting of the
storage pools fails and we undefine that storage pool before it is
initialized.  The initialization fails and the storage pool is never
managed from that point.

This patch modifies the blacklist to allow 3 failures before we give up
on a specific object and if the object is initialized without error
we remove it from blacklist completely.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-09 10:12:12 +02:00
Pavel Hrdina
f1976155cd sshtunnels: use <listen> element to get UNIX socket for graphics
Graphics devices has a new XML element to configure UNIX socket path:

  <graphics type='vnc' socket='/path/to/socket'>
    <listen type='socket' socket='/path/to/socket'/>
  </graphics>

  <graphics type='spice'>
    <listen type='socket' socket='/path/to/socket'/>
  </graphics>

and as you can see SPICE uses only the new XML element.  For VNC the
old 'socket' attribute is for backward compatibility.

In order to connect to SPICE graphics on remote host using SSH tunnel
we need to get the UNIX socket path from <listen> element.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-09 10:11:42 +02:00
Pavel Hrdina
f14b1f88a0 domain: only the first device from each group is bootable
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1488480

This also fixes an issue with floppy not showing at all, the proper
boot.dev name is 'fd' but we were looking for 'floppy'.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-09 10:11:04 +02:00
Pavel Hrdina
abcff9e230 domain: use migrateToURI3() for tunneled migration
The migrate3() API doesn't support tunneled migration.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-09 10:10:39 +02:00
Pavel Hrdina
5d0296d438 domain: use correct name for variables in migration code
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-09 10:10:39 +02:00
Pavel Hrdina
9f191da5c5 devicepanic: add all models supported by libvirt
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-09 10:09:46 +02:00
Pavel Hrdina
36230c9a18 devicepanic: use model instead of address.type
There are multiple models of the panic device, the address type is only
one and is valid only for "isa" model.

To not break the virt-install/virt-xml the command line parser needs to
be updated.  Before this patch there was only one parameter that
configured the "iobase".  Now the first parameter configures a model
but to keep it backward compatible it follows these rules:

1. there is only one parameter and it matches known model:

  --panic isa

  <panic model='isa'>
    <address iobase='0x505' type='isa'/>
  </panic>

2. there is only one parameter and it doesn't match any model:

  --panic 0x505

  <panic model='isa'>
    <address iobase='0x505' type='isa'/>
  </panic>

3. there are two parameters:

  --panic isa,iobase=0x505

  <panic model='isa'>
    <address iobase='0x505' type='isa'/>
  </panic>

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-09 10:09:46 +02:00
Pavel Hrdina
9655f7dfaf virtManager: remove panic iobase from GUI
This is advanced configuration and it's not required to configure
at all to have a working panic device.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-09 10:09:46 +02:00
Chen Hanxiao
b44aa0e3bb pycodestyle: fix all E131 warnings
Fix all E131:
     Continuation line unaligned for hanging indent

   Also remove ignore options of E131

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-08-26 20:03:21 +08:00
Christian Ehrhardt
e76b904656 engine: improve message about missing binaries
The message when failing to connect can be misleading as package names
will differ per Distribution as well as not apply for e.g. self built
binaries.
This changes the message in a way to be more generic not implying literal
package names.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2017-08-16 17:32:18 -04:00
Chen Hanxiao
c92aade081 pycodestyle: fix all E203 warnings
Fix all E203 whitespace before ':'
   Also remove E203 ignore option of pycodestyle

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-08-11 00:01:38 +08:00
Cole Robinson
cf522bfc0c engine: Remove manual line wrapping of connect error messages
This was needed once upon a time when the UI was wrong, but it
wraps correctly now
2017-08-07 18:17:00 -04:00
Cole Robinson
9e7426b64f engine: Drop offer to install askpass package (bz 1354304)
Dealing with packagekit across desktops and in a consistent
manner is a pain. This code path is rarely exercised and difficult
to test, so just fallback to giving a hint error message and
let the user install if they care.
2017-08-07 17:41:52 -04:00
Cole Robinson
cc72f74f97 packageutils: Ensure packages argument is a list
It's easy to screw this up from the callers, and gives weird
interactions with apper
2017-08-07 17:27:30 -04:00
Cole Robinson
4cdae27cb2 engine: With --test-first-run, don't try default URI detection
default URI detection gets testing via the 'connect' dialog, this
makes it easier to test the fallback when no packages are locally
present
2017-08-07 17:27:30 -04:00
Cole Robinson
08a7eaed4d config: If --test-first-run, fill in some default package names
Simplifies testing the feature from git
2017-08-07 17:25:55 -04:00
Radostin Stoyanov
b93cc3bbc9 pycodestyle: Do not use bare 'except:'
A bare 'except:' catches all exceptions [1], including SystemExit,
KeyboardInterrupt, and GeneratorExit (which is not an error and should
not normally be caught by user code). In situations where you need to
catch all “normal” errors, you can catch the base class for all normal
exceptions, Exception [2].

[1] https://docs.python.org/2/howto/doanddont.html#except
[2] https://docs.python.org/2/library/exceptions.html#Exception
2017-08-02 13:57:43 -04:00
Radostin Stoyanov
00ffb3340e Remove unintentionally added '+' 2017-08-02 13:15:27 -04:00
Radostin Stoyanov
89e5783cad create: Auto-generate fs path if not provided
Use default place to store file systems of bootstraped containers.

If the current user has effective UID 0 use:
    /var/lib/libvirt/filesystems/<container-name>

otherwise use:
    ~/.local/share/libvirt/filesystems/<container-name>
2017-08-02 13:13:57 -04:00
Radostin Stoyanov
c5264a2390 create: Stop if virt-bootstrap has failed
Prevent container creation if virt-bootstrap has not finished
successfully.
2017-08-02 13:13:17 -04:00
Cole Robinson
a9903ae0e0 connection: Remove clear_cache callback
It doesn't actually accomplish what we want for the virt-manager case,
and cache_new_pool should cover our needs now
2017-07-20 17:30:37 -04:00
Cole Robinson
4792c7cb8e connection: Add a default impl of cache_new_pool
Inserts it into the cache, and adds its associated volumes too
2017-07-20 17:30:36 -04:00
Cole Robinson
a9d9c0d035 connection: rename s/add_new_pool/cache_new_pool/g
Better describes exactly what's going on
2017-07-20 17:29:55 -04:00
Cole Robinson
5cffae0c68 connection: Fix virt-manager UI cache_new_pool impl
The current implementation calls _new_object_cb, which isn't
expected to be run from a non-main thread, and can cause crashes.

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

Switch the impl to just wait for 3 seconds for the pool to show
up in our cache.
2017-07-20 17:28:36 -04:00
Cole Robinson
9863a963fe virtManager: clone: drop redundant clone setup
We already handle all these steps in the validation() step, which
happens directly before this code.
2017-07-20 17:27:22 -04:00
Chen Hanxiao
21ce859356 gfxdetails: add checkbox for password visibility toggle
This patch add a checkbox for password visibility toggle.
    As we stored password of SPICE/VNC in clear text in XML,
    it's easy to use in UI.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-07-19 12:26:02 -04:00
Cole Robinson
5c66c7010c baseclass: Document some functions
And drop a bit of redundant code that we haven't needed for a while
2017-07-19 10:35:19 -04:00
Cole Robinson
7d03190cb5 spice: s/OK/Close/ in USB redirection dialog (bz 1465907)
To make it more clear that USB redirection happens immediately

https://bugzilla.redhat.com/show_bug.cgi?id=1465907
2017-07-17 15:46:12 -04:00
Cole Robinson
a0a8470362 connection: Cache host arch CPU model list on startup
Rather than hardcode x86_64
2017-07-17 11:47:01 -04:00
Cole Robinson
ca56f74ed7 capabilities: Fix model list caching for different archs (bz 1451113)
We could return cached x86_64 results for aarch64 VMs

https://bugzilla.redhat.com/show_bug.cgi?id=1451113
2017-07-17 11:47:01 -04:00
Radostin Stoyanov
90e03297b1 create: Show details of container bootstrap
Get get information about the progress from virt-bootstrap
and show it on GUI.
2017-07-13 14:45:28 -04:00
Radostin Stoyanov
c29cce2673 asyncjob: Add enable/update details methods
Add virtual terminal emulator (Vte) in which could be shown details
of background running process.

Usage example:

- To enable details:
> asyncjob.details_enable()

- To show text inside the Vte:
> asyncjob.details_update("Some text here")
2017-07-13 14:45:28 -04:00
Radostin Stoyanov
10799edd76 create: Show progress of container bootstrap
Display the current status and progress from virt-bootstrap.
2017-07-13 14:45:28 -04:00
Radostin Stoyanov
ebf9d294ef create: Call virt-bootstrap asynchronously
The bootstrap method is called at the end of the "create dialog" (when
"Finish" button is clicked).

We handle two cases:

1. When virt-bootstrap fails. User re-clicks the 'Finish' button and we
reattempt the container bootstrap.

2. When virt-bootstrap succeeds, but something later in the install
fails, like XML define. If user re-clicks 'Finish' we don't attempt
virt-bootstrap again, just use the directory path.
This is achieved by unchecking the 'install-oscontainer-bootstrap'
checkbox is unchecked if virt-bootstrap succeeds.

Log messages from the virtBootstrap's logger are stored in string
buffer and shown in case of failure.
2017-07-13 14:45:28 -04:00
Cole Robinson
a51929fcd3 snapshots: Handle XML chars in snapshot name (bz 1468912)
https://bugzilla.redhat.com/show_bug.cgi?id=1468912
2017-07-10 17:51:04 -04:00
Radostin Stoyanov
12962ece71 gschema: Populate/Store previous container URLs 2017-07-10 15:06:01 -04:00
Radostin Stoyanov
bf90eea463 create: Validate input on container bootstrap
- Show error if source URL is not provided.
- Require password for authentication to source registry when username
  is provided.
- Show error if destination path is not directory.
- Show error if the user has no write permissions to destination path.
- Show Yes/No dialog if the destination directory is not empty.
2017-07-10 15:06:01 -04:00
Radostin Stoyanov
bb2e5c0899 create: Add support for OS tree creation
Allow container bootstrap when connected to local Libvirt LXC driver
and if virtBootstrap module is available.
2017-07-10 14:51:31 -04:00
Radostin Stoyanov
550770626f create: Don't use 'os' as variable name 2017-07-10 09:36:37 -04:00
Cole Robinson
9718dc6c28 gfxdetails: Select manual rendernode by default, if available
Rather than the 'auto' mode, since a manual path is required for
qemu:///system to have a chance of working
2017-07-10 09:33:51 -04:00
Cole Robinson
ae836304f9 guest: Drop references to ia64
Nothing modern supports it, don't even bother
2017-06-28 15:17:20 -04:00
Cole Robinson
5c93db2974 addhardware: rng: default to /dev/urandom
If libvirt supports it. This is the recommended default nowadays
2017-06-27 15:43:06 -04:00
Cole Robinson
a213c8d9e9 details: Allow removing USB controllers on non-x86
It's only x86 where we are forced to have a USB controller (more or
less), so make it VM arch dependent
2017-06-27 15:35:54 -04:00
Cole Robinson
30e2f314a7 details: Don't allow changing model for PCI controller
It's not functional for any case we really care about. Also don't allow
attempting to 'remove' it either.
2017-06-27 15:32:54 -04:00
Cole Robinson
0672b86450 details: Simplify PCIe controller listing
Don't list every <controller>, just filter it all down to one listing.
There isn't anything interesting to tweak anyways, at least not anything
the UI supports.
2017-06-27 15:28:12 -04:00
Cole Robinson
bef22b6279 fsdetails: Simplify ram conversion
Libvirt will only ever output unit='KiB', so we don't need to worry
about converting between different values. Delete the helper code
2017-06-27 14:21:18 -04:00