Commit Graph

1481 Commits

Author SHA1 Message Date
Pavel Hrdina
b9bc3b605a delete: undefine only persistent domain
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1517119

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-11-24 17:39:58 +01:00
Lin Ma
2eb455c97f addhardware: Correctly calculate virtio-scsi controller index
Because sata, usb and scsi use same device prefix: sd*, They will be
included into occupied list while we add virtio-scsi disks, This is
wrong and may cause adding additional virtio-scsi controller.

How to reproduce:
1. fresh install a qemu guest.
2. add 6 virtual USB disks.
3. add disk A on scsi bus.
   (then a virtio-scsi controller 0 will be added automatically)
4. add disk B on scsi bus.
5. observe.

Expected:
disk A and disk B  should be connected to virtio-scsi controller 0 because
controller 0 has enough available slots.

Actual:
disk A was connected to virtio-scsi controller 0.
An additional virtio-scsi controller 1 was added and disk B was connected
to it because virt-manager thought the virtio-scsi controller 0 doesn't
have available slot.

Signed-off-by: Lin Ma <lma@suse.com>
2017-11-22 16:50:33 -05:00
Cole Robinson
7fc7e94f21 addhardware: Fix virtio-scsi controller target calculation
More details here: https://www.redhat.com/archives/virt-tools-list/2017-November/msg00014.html

Reported-by: Lin Ma <lma@suse.com>
2017-11-22 16:50:33 -05:00
Lin Ma
2e85ad5675 details: Show controller description + index
This patch and future patches can help users to better recognize which
disks connect to which scsi controllers.

Signed-off-by: Lin Ma <lma@suse.com>
2017-11-21 17:18:56 -05:00
Radostin Stoyanov
73de828524 systray: Remove redundant variable assignment
The explicit assignment of "name" is unnecessary.
2017-10-27 10:10:08 +02:00
Cole Robinson
3be78d1f3f addhardware: Don't allow panic option where it isn't supported
Like aarch64, basically any arch that doesn't have an explicit panic
model
2017-10-27 09:47:38 +02:00
Cole Robinson
d82022bd2c manager: Drop python2 only cmp() usage
Manually implement it
2017-10-21 19:41:33 -04:00
Chen Hanxiao
7f1b4cee82 pycodestyle: fix all E125 warnings
Fix all E125:
     Continuation line with same indent as next logical line

   Also remove ignore options of E125

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-10-21 23:26:16 +08:00
Radostin Stoyanov
f41aafc721 Use enumerate instead of range and len 2017-10-20 13:18:31 -04:00
Radostin Stoyanov
69c84bea47 Import reduce() from functools module
The built-in function reduce() [1] has been moved in the functools
module [2] [3].

[1] https://docs.python.org/2/library/functions.html#reduce
[2] https://docs.python.org/3/library/functools.html#functools.reduce
[3] https://docs.python.org/2/library/functools.html#functools.reduce
2017-10-20 13:18:31 -04:00
Radostin Stoyanov
75210ed37c Replace StringIO with io.(StringIO or BytesIO)
StringIO and cStringIO modules no longer exists in Python 3. [1]
Use either io.StringIO [2] for text or io.BytesIO [3] for bytes.

[1] http://docs.python.org/3.0/whatsnew/3.0.html
[2] https://docs.python.org/3/library/io.html#text-i-o
[3] https://docs.python.org/3/library/io.html#binary-i-o
2017-10-20 13:18:31 -04:00
Radostin Stoyanov
dff00d4fc0 Remove deprecated statvfs module
The statvfs module has been removed in Python 3. [1]
It is replaced by os.statvfs which is also available in Pyhton 2.

[1] https://docs.python.org/2/library/statvfs.html#module-statvfs
[2] https://docs.python.org/3/library/os.html#os.statvfs
2017-10-20 11:49:14 -04:00
Radostin Stoyanov
e2ad4b2fde Convert iteritems() to items()
In Python 2 iteritems() [1] returns an iterator over the dictionary and
items() [2] returns a list of pairs.

In Python 3 iteritems() does not exist and items() returns a view of
the dictionary's items.[3]

[1] https://docs.python.org/2/library/stdtypes.html#dict.iteritems
[2] https://docs.python.org/2/library/stdtypes.html#dict.items
[3] https://docs.python.org/3/library/stdtypes.html#dict.items
2017-10-20 11:49:14 -04:00
Radostin Stoyanov
63fce081ed pycodestyle: Use isinstance() for type checking
This is E721 in pycodestyle [1]:
   "do not compare types, use ‘isinstance()’"

The main differece between "type() is" and "isinstance()" is that
isinstance() supports inheritance. [1]

This can be seen in the example below:
    >>> type(True) is int
    False
    >>> isinstance(True, int)
    True

As we can see in python 'bool' a subclass of 'int'.

[1] https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
[2] https://docs.python.org/2/library/functions.html#isinstance
2017-10-20 11:49:13 -04:00
Cole Robinson
2fe444323b engine: Don't attempt --test-first-run if --connect passed
Which we do for uitests, we don't want it trying to connect to
qemu:///system while uitests are running
2017-10-20 11:47:15 -04:00
Lin Ma
23aaf8527d network: Set bridge name to None instead of blank
Trigger libvirt error if user leaves 'net-bridge-name' GtkEntry
blank when specifying shared device name.

Signed-off-by: Lin Ma <lma@suse.com>
2017-10-19 18:09:19 -04:00
Cole Robinson
9617d1267d systray: Use APPLICATION_STATUS for appindicator
Not OTHER, as the reporter points out this shouldn't be used, and
causes issues on KDE

https://bugzilla.redhat.com/show_bug.cgi?id=1501173
2017-10-18 19:14:17 -04:00
Lin Ma
083dfcc8ec host: Show details about the network of SR-IOV VF pool
Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-10-09 10:22:48 +02:00
Pavel Hrdina
3b76964365 domain: don't add URI into params for tunneled migration
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1456185

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-10-03 12:24:39 +02:00
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
Cole Robinson
b9d0f267fd connection: Rename is_test_conn -> is_test
To match virtinst connection helper names
2017-06-27 14:13:36 -04:00
Cole Robinson
1600ac39f0 fsdetails: Fix displaying filesystem type=ram devices
And add a test XML example to demonstrate it
2017-06-27 14:08:44 -04:00
Cole Robinson
3d81ef097a ui: addhardware: Add virtio tablet/keyboard options 2017-06-27 12:39:17 -04:00
Cole Robinson
4e7a6ad728 tests: pylint: Silence/fix a bunch of new warnings 2017-06-16 12:54:56 -04:00
Pavel Hrdina
b690908aa4 virtinst: enable secure feature together with smm for UEFI
The secure feature actually enforce the secure boot if Secure Boot
Mode is configured.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-06-07 20:49:45 +02:00
Cole Robinson
1d0b4a0a9e connect: Handle \ in username
We need to quote URL values in the username, that's what libvirt expects.
Unquote the values before caching them in the URI object, so console
connections continue to work

https://bugzilla.redhat.com/show_bug.cgi?id=1452389
2017-06-01 14:26:46 -04:00
Pavel Hrdina
4f8e795c6a virtinst: if required by UEFI enable SMM feature and set q35 machine type
If we detect that the UEFI image is build to require SMM feature we
should configure the guest to enable SMM feature and set q35 machine
type.  Without this user wouldn't be able to boot the guest.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-06-01 09:58:46 +02:00
Pavel Hrdina
1686511886 virtManager.connection: introduce cb_add_new_pool
The cb_add_new_pool callback will add a newly created storage pool
into virt-manager's cache so we don't have to wait for the libvirt
event to be handled.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-05-22 19:43:49 +02:00
Radostin Stoyanov
c5627b1fa9 Remove redundant call of strip()
Remove redundant call of the strip() function. It is already done in lines 1302 and 1303.

https://github.com/virt-manager/virt-manager/blob/master/virtManager/create.py#L1302
https://github.com/virt-manager/virt-manager/blob/master/virtManager/create.py#L1303
2017-05-17 12:26:51 -04:00
Pavel Hrdina
86e2c23d71 interface: don't print error for active interface without an IP address
If there is no IP address for active interface we need to skip
probing it.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-05-10 12:35:42 +02:00
Cole Robinson
f551d7e55d Replace file() usage with open()
Same semantics, but the latter is needed for python3
2017-05-05 14:53:12 -04:00
Cole Robinson
34c193108c Use python3 compatible octal notation 2017-05-05 14:52:11 -04:00
Cole Robinson
62feeb02a8 Switch to python3 style 'except X as Y' notation
Which also works with python2.7
2017-05-05 14:52:11 -04:00
Lin Ma
733d541624 network: add support for network forward mode 'open'
libvirt added network forward mode 'open' by commit 25e8112d, No any
iptables rules are added to this virtual network.

This patch adds support to create such a virtual network.

Signed-off-by: Lin Ma <lma@suse.com>
2017-05-03 14:15:02 -04:00
Pavel Grunt
1f68cf2b01 Do not use deprecated gdk_cursor_new
It relies on the presence of X cursor fonts in the system. Use
recommended gdk_cursor_new_from_name and use cursor names that works
on different backends.

Deprecated since Gdk 3.16

https://bugzilla.redhat.com/show_bug.cgi?id=1442612
2017-05-03 13:38:23 -04:00
Chen Hanxiao
645edb176d domain: treat VIR_DOMAIN_CRASHED not as runnable but rather as stoppable
If we set on_crash as `preserve`, we'll get a crashed
VM state.
At this time, it's impossible to start this VM.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-05-03 13:38:07 -04:00
Pino Toscano
7866cfec1b osdict: add "macos" type
Give macOS OSes an own type, so they have their own entry in the list of
OS types.
2017-04-27 15:57:40 -04:00
Pino Toscano
fa9ee6cd94 osdict: rename "unix" type to "bsd"
It really holds BSD OSes, so rename it to match the reality.
2017-04-27 15:57:40 -04:00
Pino Toscano
0eabf343ee create: refactor combobox with distros
When showing all the OSes, the list of distributions for some types of
OSes (Linux, UNIX) will get insanely long, and thus very hard to scroll.
As solution, introduce groups for some of the OS families, leaving the
ones without a defined group into a "Others" group.

To keep the completion working in the editable combobox, add a separate
completion model for the completion entry, providing all the OSes
directly there as simple list.

There are a number of changes related to this:
- the model for the OS comboboxes is now a TreeStore, and the iterations
  on the OS variant keep that into account
- there are better UI labels for OS types and groups
- when there are no groups for a type, add all the OSes directly, just
  like now
- optimize the way types are added to the combobox: when not adding all
  of them, filter out those not "supported"
- optimize the way OSes are added to the combobox: query only for the
  list we need (supported or all, not both), and group them according
  to the hash defined
- add separator + "show all" options only when not showing all of them
- _add_os_row now is called only when needed, so remove its "supported"
  parameter
2017-04-27 15:57:40 -04:00
Cole Robinson
cd0e3a897c sshtunnels: Detect listen type=none for VNC (bz 1445714)
https://bugzilla.redhat.com/show_bug.cgi?id=1445714
2017-04-27 15:29:05 -04:00
Cole Robinson
c0a3234633 baseclass: share wizard cursor setting code 2017-04-27 15:00:17 -04:00
Cole Robinson
6d1a3db421 createnet: Cleanups around hostdev UI 2017-04-04 15:20:33 -04:00
Lin Ma
97c8412df6 network: add support to create SR-IOV VF pool
Create a network with a device pool containing all the VFs of an SR-IOV device.

Signed-off-by: Lin Ma <lma@suse.com>
2017-04-03 19:15:11 -04:00
Cole Robinson
0610cd6acb console: Ensure bool value used for set_sensitive call
Seen in a bug log file:

[Tue, 28 Mar 2017 12:05:21 virt-manager 2465] DEBUG (cli:251) Uncaught exception:
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/details.py", line 1303, in refresh_vm_state
    self.console.details_update_widget_states()
  File "/usr/share/virt-manager/virtManager/console.py", line 1025, in details_update_widget_states
    return self._update_vm_widget_states()
  File "/usr/share/virt-manager/virtManager/console.py", line 597, in _update_vm_widget_states
    self._refresh_widget_states()
  File "/usr/share/virt-manager/virtManager/console.py", line 663, in _refresh_widget_states
    self.widget("details-menu-vm-screenshot").set_sensitive(is_viewer)
TypeError: Argument 1 does not allow None as a value
2017-03-29 12:07:50 -04:00
Cole Robinson
14f3efa810 libvirtobject: Add better __repr__ for debugging 2017-03-29 12:07:50 -04:00
Cole Robinson
2c8ed52813 Fix some pylint 2017-03-27 17:27:14 -04:00
Charles d'Hondt
b545201617 Added OpenVSwitch Network Detection
Small patch to allow VMM to detect OpenVSwitch

Signed-off-by: Charles d'Hondt <charles.dhondt@gmail.com>
2017-03-24 16:42:45 -04:00
Pavel Hrdina
cb182f7e3a graphics: skip authentication only for VNC with listen type none
This is in fact a bug in QEMU so we have to workaround this issue
to allow to connect to guest with VNC and listen type none.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-03-23 15:26:19 +01:00
Cole Robinson
cfc4e903b7 details: Remove some debug printing 2017-03-22 12:28:04 -04:00
David Thurstenson
a86c119e1c Fix ambigous label on Autostart checkbox
When the Autostart checkbox on the host Virtual Network or Storage tabs
is deselected, the label reads "Never", and when selected the label reads
"On Boot". This changes these labels to always read "On Boot".
2017-03-22 11:53:00 -04:00
Cole Robinson
aefea61fa0 create: Fix some minor UI issues with vz installs 2017-03-22 11:40:04 -04:00
Mikhail Feoktistov
5a70b946c7 Add GUI to create wizard for virtuozzo containers
Add virtuozzo hypervisor to connection list.
Add radio buttons for choosing VM or container virtualization type.
New wizard window for setting template name for containers.
2017-03-22 11:00:50 -04:00
Mikhail Feoktistov
c25ea6537b Tune default device list for Virtuozzo containers
Virtuozzo supports virtio NIC.
Also add default VNC graphics.
Privnet feature and emulator device have no sense for vz containers.
2017-03-17 13:36:15 -04:00
Cole Robinson
8f39de8243 ui: details: Tweak RNG page a bit 2017-03-08 17:48:26 -05:00
Cole Robinson
8eee62712e gfxdetails: Add more errors/warnings around spice GL
Add warning icons with informative tooltips. Desensitive UI rather
than hide it if the hypervisor doesn't support things. A few other
usability tweaks
2017-03-08 16:07:32 -05:00
Cole Robinson
f61e586b77 domain: rename: Fix when nvram pool is newly created
We don't have any way at the momemnt to synchronously update cached
object lists. So if old_nvram will create a pool for the nvram dir
(/var/lib/libvirt/qemu/nvram), new_nvram won't see that new object
in our cache, will attempt to create it itself, and raise an error.
Next attempts succeed though.

We can avoid this by not even setting new_nvram.path, that step was
redundant anyways since we are setting a vol_install right afterwards.
This way, new_nvram is getting a reference to the parent_pool object
via the vol_install, so it doesn't even check the pool object cache.
2017-03-08 14:22:44 -05:00
Cole Robinson
3030c585b9 domain: rename: don't overwrite nvram error
Just raise whatever error is throw, so we have the backtrace if needed
2017-03-08 13:22:09 -05:00
Pavel Hrdina
92c230d111 domain: add support to rename domain with nvram vars file
Libvirt storage API doesn't support renaming storage volumes so
we need to copy the nvram file and remove the old one.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-03-08 08:24:57 +01:00
Cole Robinson
07f1a4e168 ui: Use 'Shut Down' vs 'shutdown' consistently 2017-03-06 22:05:35 -05:00
Cole Robinson
1ac02d2ade ui: clone: Delay error if default storage doesn't have enough space
Just ignore the error populating the initial paths, otherwise we can't
even open the dialog
2017-03-06 22:05:34 -05:00
Cole Robinson
b6630c2a63 clone: Don't error if disk doesn't have a backing volume 2017-03-06 22:05:34 -05:00
Pavel Hrdina
8225cac648 virtManager.delete: don't allow deleting SCSI disks
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-03-06 14:31:42 -05:00
Pavel Hrdina
31e923dbdf virtManager.clone: don't generate default clone_path for some storage pools
Libvirt doesn't support creating volumes for some storage pools,
don't generate default clone_path for these storage pools.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-03-06 14:31:42 -05:00
Pavel Hrdina
79baf8e30c virtManager.clone: don't generate clone path if we don't default to clone
If we don't default to clone the disk in question don't try to generate
and assign default clone_path, this will force user to select the path
explicitly and avoid some unnecessary errors in debug log.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-03-06 14:31:42 -05:00
Pavel Hrdina
d93203022a virtManager.clone: set new manual path before we populate storage list
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-03-06 14:31:42 -05:00
Cole Robinson
0910c8dcfc domain: Use libvirt.VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH (bug 1379581)
It's what virt-viewer uses, and apparently it's needed for VNC
listen type=none

https://bugzilla.redhat.com/show_bug.cgi?id=1379581
2017-03-02 15:08:32 -05:00
Marc-André Lureau
b484d15258 virtManager/ui: add 3d acceleration checkbox to virtio video
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-03-01 17:58:30 -05:00
Marc-André Lureau
53d09bc28c virtManager/ui: add rendernode selection
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-03-01 17:57:57 -05:00
Marc-André Lureau
326dc03c23 virtManager/ui: add listen type option
Similarly to virt-install --listen=none, add a combobox to select
the listen type: "address" or "none" for now, as suggested by Pavel
Hrdina.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-03-01 17:56:52 -05:00
Marc-André Lureau
88942028b3 virtManager/ui: add opengl graphics option
Add an OpenGL checkbox to the Spice graphics options (only available if
SUPPORT_CONN_SPICE_GL).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-03-01 17:54:19 -05:00
Pino Toscano
ecd66a7df2 inspection: try harder to show a pkg summary
If a package has no summary, try to use the description (if available):
- if it is just one line (mostly because the package manager only has
  a single line as description of a package), then use it fully
- if it contains more lines, then take the first only, adding suspension
  dots to indicate it is longer than that
2017-03-01 16:32:57 -05:00
Pino Toscano
409ae0bcf4 inspection: add a way to refresh the inspection info
Introduce a 'Refresh' button in the 'Information' page of a VM, and
wire it up so a refresh of the inspection data for it is triggered.
2017-03-01 16:25:47 -05:00
Pino Toscano
436d4c544c details: refresh Information page on inspection data change
Refresh the 'Information' page when there are new inspection data
available, so they can be seen even without switching to a different
page and back.  This could be seen when starting virt-manager, and
opening quickly the 'Information' page of an uninspected guest.
2017-03-01 16:25:47 -05:00
Pino Toscano
45d0be9805 inspection: add vmmInspection.vm_refresh helper
Add a simple helper to force a new inspection of a VM.
2017-03-01 16:25:47 -05:00
Pino Toscano
67ed3e86df inspection: filter libguestfs VMs earlier
No need to do any job for them, so skip processing them altogether when
a new one is added.
2017-03-01 16:25:47 -05:00
Pino Toscano
d2ca54fce4 inspection: remove queue draining
Now we act for each item in the queue, so there is no more need to drain
it fully before doing anything.  Thus, turn _run into a simple
get+process+done loop.
2017-03-01 16:25:47 -05:00
Pino Toscano
7a696c8db8 inspection: handle duplicated conn-added signals
We might get 'conn-added' signals for the same connections more than
once, so make sure to skip a new connection notification when the
connection is already known.
2017-03-01 16:25:47 -05:00
Pino Toscano
ea5a6a3014 inspection: simplify VMs visit
Currently, the handling of the 'vm_added' element in the queue (added as
consequence of the 'vm-added' signal) is to act as trigger to rescan
every VM in every local connection; this operation is "fast" because
every VM except the newly added is already marked as visited. Still, it
is an not really efficient way to visit new VMs.

Instead, just push in the queue all the data we get in vm_added, so when
processing the queue we can process each VM straight away.  Because of
this, make sure to gracefully handle VMs that were removed while the
'vm_added' item for them was sitting in the queue (which is something
the old code did not handle properly).
2017-03-01 16:25:47 -05:00
Pino Toscano
0c019fb8e3 inspection: rename vmmInspection._process to _inspect_vm
It fits more the actual job of the function.
2017-03-01 16:25:47 -05:00
Pino Toscano
ad47e80ec2 inspection: extract vmmInspection._process_vm
Move the code that does the inspection handling of a VM to an own
function, so it can be used as-is later on.

It is just code motion.
2017-03-01 16:25:47 -05:00
Pavel Hrdina
b8dccf6aca virtManager/viewers: fix connection to remote SPICE with password
When connecting to remote SPICE we use ssh tunnel if the SPICE is
listening only on "localhost".  Our ssh tunnel scheduler uses locks
to serialize the requests for FD in order to not spam user for ssh
password.

However when the main_channel is connected and emits AUTH_ERROR
we ask user for password and request for new FD.  Unfortunately
after the new request is handled we didn't unlock the scheduler
and all other request would remain waiting for the lock.

We need to unlock every FD request for the SPICE main channel not
only the first one when the channel itself is created.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-02-10 09:43:20 +01:00
Pino Toscano
46f4abbb50 inspection: try low quality icons as fallback
When there is no high quality icon for a guest, try getting the low
quality icon.  This should make virt-manager show icons for Ubuntu and
Windows guests.
2017-02-09 16:29:27 -05:00
Pino Toscano
3c95d20994 inspection: consider also epoch for pkg version
When composing the string of the version of packages, prepend also the
epoch, as it is an important part of the package version.
2017-02-09 16:29:27 -05:00
Pino Toscano
ebf4ade208 inspection: show OS type in Inspection page
Show also a pretty label for the OS of the guest, in addition to
hostname and product name.
2017-02-09 16:29:27 -05:00
Pino Toscano
f7a726dc70 inspection: rename variable for OS type
'type' is ambiguous as name, it might conflict with the Python builtin.
Instead, rename it to 'os_type' to get rid of the issue altogether.
2017-02-09 16:29:27 -05:00
Pavel Hrdina
2df8dc39e8 virtManager/interface: detect whether IP address comes from DHCP server
When the network interface is up the active XML contains only IP address
even in case that the inactive XML was configured to get the IP address
from DHCP server.  To propagate this information back to UI we need to
get both XMLs to figure out current IP addresses and the configuration.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-02-06 09:11:00 +01:00
Pavel Hrdina
798a2e5080 virtManager/addhardware: get supported disk bus types from libvirt
Libvirt provides domain capabilities where supported disk bus types are
listed.  Virt-manager should try to get those bus types.  The old code
remains as fallback if domain capabilities doesn't contain the disk
bus types.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-01-24 08:37:17 +01:00
Cole Robinson
88bfdf4926 console: Fix resize to VM on wayland (bug 1397598)
Yet another issue with not using window.get_size() and instead using
its size allocation directly, which differ on wayland due to client
side decorations.

https://bugzilla.redhat.com/show_bug.cgi?id=1397598
2016-12-13 13:34:09 -05:00
Cole Robinson
107aa2b134 manager: Fix window size tracking on wayland (bug 1375175)
The method we were using is a common implementation bug,
explained here: https://wiki.gnome.org/HowDoI/SaveWindowState

https://bugzilla.redhat.com/show_bug.cgi?id=1375175
2016-12-13 13:34:09 -05:00
Cole Robinson
435de2d40c pylint: Fix some issues with F25 version 2016-12-13 12:36:49 -05:00
Seeteena Thoufeek
5a11cf0782 virt-manager generates invalid guest XML
The virt-manager application generates invalid guest XML when a
 spapr-vio SCSI model controller is changed to a virtio-scsi model controller.

1. Create a guest
2. Add an spapr-vio controller to the guest via this gui path:
->Add Hardware
->Controller
->Type SCSI
->Model Hypervisor default
At this point, there will be a valid spapr-vio SCSI controller defined:
    <controller type='scsi' index='0'>
      <address type='spapr-vio' reg='0x2000'/>
    </controller>
3.Now modify the above SCSI controller using this gui path:
->Choose "Controller sPAPR SCSI" on left pane
->Choose "VirtIO SCSI" for the Model on the right pane
->Apply
At this point, there will be a SCSI controller definition which is invalid due to an incorrect address type:
~# virsh dumpxml dotg2|grep -A2 -i scsi
    <controller type='scsi' index='0' model='virtio-scsi'>
      <address type='spapr-vio' reg='0x2000'/>
    </controller>
Any attempt to start the guest will throw this error:
error: Failed to start domain dotg2
error: internal error: process exited while connecting to monitor: 2016-12-02T17:45:12.989165Z qemu-system-ppc64le: -device virtio-scsi-pci,id=scsi0,reg=0x2000: Property '.reg' not found

virt-manager fails to realize that the address type needs to be changed to a PCI address for a virtio-scsi controller.

If you change the model, you are supposed to leave the address field empty, so that libvirt sets it correctly. Or change the address field also appropriately.

Note that this bug can be reproduced entirely within virt-manager.  No manual editing of guest XML is being done here.  So, fix is to make virt-manager delete the address field when the SCSI controller model is changed, allowing libvirt to automatically assign a new address with the correct type.

Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
2016-12-12 21:12:09 -05:00
Chen Hanxiao
b7eb3e57ea We can't clone a VM in some scenarios,
such as a VM is active.

This patch will disable 'Clone' label in VMActionMenu
if we can't clone a VM,
as same as we did for 'Clone' button in clone ui page.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2016-10-06 23:12:59 +08:00
Jim Fehlig
561f5cd3e6 virt-manager: drop 'xenmigr' scheme from Xen migration URI
For Xen, virt-manager uses a 'xenmigr' URI scheme, which is not
supported by the libvirt libxl driver. Attempting migration
fails with

libvirtError: invalid argument: unable to parse URI: xenmigr://myhost

The old xend-based libvirt driver supports this scheme, but also
supports an empty scheme. It's not clear what the 'xenmigr' scheme
is used for. 'xenmigr' is not referenced by any files in the Xen
code-base, including old branches with xend.

Drop setting scheme to 'xenmigr' when creating the Xen migration URI.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2016-09-08 11:47:52 -04:00
Jim Fehlig
0425975f38 virt-manager: use virDomainMigrate3 API
libvirt has supported the migration V3 protocol for many years now.
A nice feature of the virDomainMigrate3 API is that it will detect
the protocol version supported by the underlying hypervisor,
including whether it supports the extensible parameters variant,
and call the hypervisor API with parameters fixed up as needed.

Change virt-manager to use the virDomainMigrate3 API, allowing
migration to work with hypervisors that only support the extensible
parameters variant of the migration V3 API.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2016-09-08 11:47:45 -04:00
Jovanka Gulicoska
44dd5ae0a6 Fix storage pool refresh event signal
When creating a storage volume, it wouldn't show up in the list
since the refresh signaling was busted.
Code was using VIR_STORAGE_POOL_EVENT_REFRESHED which was dropped
from lifecycle event type, refresh is introduced as top level
event.
2016-08-19 11:06:44 -04:00
Pavel Hrdina
da81d4c32c console: don't use _close_viewer directly
Function _close_viewer should be always called together with setting
unavailable page.  Call only _activate_unavailable_page which does both things.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-08-18 10:36:04 +02:00
Pavel Hrdina
354877b90e console: set unavailable page while closing details window
We need to set unavailable page in order to trigger _init_viewer() function.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-08-18 10:36:04 +02:00
Jovanka Gulicoska
bc42fac710 Use node device update event support
API will be available in upcoming libvirt 2.2.0
2016-08-17 09:03:10 -04:00
Jovanka Gulicoska
ead5fdffff Use node device lifecycle events
API will be available in upcoming libvirt 2.2.0
2016-08-11 10:14:30 -04:00
Tristan Helmich
27703ca379 storage: Enable creation of zfs storave volumes 2016-08-09 11:48:34 -04:00
Chen Hanxiao
911dac0dfa snapshot: start snapshot when double-click the item of snapshot list
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2016-08-02 13:20:15 -04:00
Pavel Hrdina
810c73864a translation: mark some strings to be translated
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-07-26 09:32:14 +02:00
Cole Robinson
9a67fc4d6e storagepool: Don't double invoke 'refresh' when events are present
We need to tweak refresh() handling to work similar to the shared
XML and status caching in libvirtobject.py: when the user manually
invokes the refresh() operation, and storage events are set up,
we just invoke the refresh() but let the event loop handle
refreshing the cache.

This fixes a backtrace when invoking a manual refresh via the
host details dialog
2016-06-23 15:38:31 -04:00
Cole Robinson
cdf5d32434 libvirtobject: Rename refresh_...->recache_from_event_loop
Since 'refresh' is kind of ambiguous now that we support pool
refresh events
2016-06-23 14:48:04 -04:00
Cole Robinson
61a4318f85 storagelist: Remove unused function 2016-06-21 19:15:43 -04:00
Cole Robinson
e69cc002b1 viewers: spice: Catch failure to setup usbdev manager
Since some distros like openbsd don't compile support for
usb redirection, which makes this fail

https://bugzilla.redhat.com/show_bug.cgi?id=1348479
2016-06-21 09:01:32 -04:00
Cole Robinson
6d587c40bb storagepool: Don't refresh newly arriving pools
If they show up while a connection is 'active', it means they were
just defined/created, and thus a pool refresh is likely redundant
2016-06-20 17:21:46 -04:00
Cole Robinson
53459cb0f6 conn: Don't process any pool REFRESHED events during conn startup
When new pool objects appear, we call refresh() on them, to ensure
we have the latest data (in case manual changes were made to the
storage pool directory behind libvirt's back, which is quite common).

However with the storage event support, this results in lots of
REFRESHED signals during initial connection startup, which kick
off redundant object polling.

Avoid storage REFRESHED events if they come in before the connection
is finished starting up to skip this redundant polling.
2016-06-20 17:07:26 -04:00
Cole Robinson
6a740ff91c conn: Build default pool before registering events
Otherwise this triggers some event calls and results in double
polling during connection startup. Doesn't cause any issues, just
spams the logs and needless libvirt calls
2016-06-20 17:03:12 -04:00
Jovanka Gulicoska
b904d62e47 Use storage pool lifecycle events
API will be available in upcoming libvirt 2.0.0
2016-06-18 11:08:14 -04:00
Cole Robinson
20c2d5b6ff delete: Don't offer to delete floppy media by default
Even if it's not marked readonly or shareable, floppy media is
very likely to be a shared resource and not something that belongs
to the VM that the user will want to delete by default.
2016-06-17 13:06:35 -04:00
Cole Robinson
9f297eda5b virtinst: guest: drop 'continue_install' concept
continue_install is intended to facilitate windows XP style 3 stage
installs:

  stage 1: initial dos style disk setup, reboot
  stage 2: actual full installer, reboot
  stage 3: OS is functional, virt-install is done

The code assumed that we needed to keep the cdrom as the primary
boot device for the second stage, so virt-install/virt-manager needed
to hang around through the second stage run, wait until the VM shutdown,
then encode the final XML to boot of the disk.

Windows is and always has been smart enough to handle that case though...
after the initial boot, if we set the hd as the primary boot device
for stage 2, the disk bits that windows already installed will make
use of the cdrom as necessary. So the entire premise of continue_install
is irrelevant. Maybe back when it was added, when xen didn't even have
working ACPI support, this served a purpose, but I'm pretty sure we
can safely drop it nowadays.
2016-06-17 07:52:42 -04:00
Cole Robinson
5cd1b57852 create: customize: Fix inadvertent disk removal on install fail
If the first install attempt fails, then the second attempt succeeds,
we were still removing the disk images we created as though the
install never succeeded. We need to clear out the cached failed_guest
value via the customize dialog callback

https://bugzilla.redhat.com/show_bug.cgi?id=1342043
2016-06-16 19:47:49 -04:00
Pavel Hrdina
0acdea1dad virtManager.details: show firmware options also for XEN guests 2016-06-16 12:16:53 +02:00
Pavel Hrdina
5ecc2b440a virtManager.create: don't clear recommended machine if none is selected
This improves loading domcapabilities to get domcapabilities for recommended
machine, not for default machine.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-16 12:00:10 +02:00
Jovanka Gulicoska
053672764f storagelist: code cleanup
Remove cb() function calling pool.refresh, instead use pool.refresh
in vmmAsyncJob
2016-06-14 19:17:06 -04:00
Pavel Hrdina
2f0b40ac00 virtManager.config: fix pylint warning
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-10 18:05:39 +02:00
Pavel Hrdina
09cc6f3832 console: add support to forget password
If password for console is saved currently there is no way how to tell
virt-manager to forget that password.  This patch improves the authentication
page in order to provide a way how to forget password simply by unchecking the
"Save this password in your keyring".

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-07 20:03:27 +02:00
Pavel Hrdina
7e1bd1d762 console: fix checkbox to save password if it was loaded from keyring
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1302175

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-07 20:02:45 +02:00
Pavel Hrdina
7280dcf7df create: report an error if storage doesn't exists for import installation
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1305210

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-07 19:48:24 +02:00
Pavel Hrdina
b327191a20 maint: fix pylint warnings wrong-import-order
standard import "import logging" comes before "from gi.repository import GLib"

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-07 17:37:06 +02:00
Pavel Hrdina
efd1d2dd07 cpu: config: replace host-cpu-model by host-model-only
Commit f5c32063 replaced host-cpu-model by host-model-only but forget those two
places.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-07 09:06:13 +02:00
Pavel Hrdina
2d554aca7b ui: remove "Restore Saved Machine..." from File menu of Connection Details
Commit 839ce682 removed deprecated support of save/restore which was replaced by
managedsave feature.  This is a leftover that wasn't removed together with that
commit.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-05-31 13:09:48 +02:00
Pavel Hrdina
4506d49ff5 addhardware: don't remove QXL if VNC graphics are configured
Commit 1a6e803a introduced a fix for bogus behavior of QXL+VNC where
there was no cursor visible by disabling this configuration in
virt-manager.  We should enable it again because this is a supported
configuration and the bug was actually in QEMU.

This is now fixed in qemu-2.6.0 [1] so revert commits 1a6e803a and
67ca0a9f.

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

[1] http://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg00507.html

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-05-20 18:10:24 +02:00
Pavel Hrdina
bf99c0ce82 virt-manager: fix --show-domain-creator to not depend on manager window
Commit a0c2fdf4 fixed a bug that there was no way how to close the app.

The original issue isn't present anymore but reverting that commit isn't
enough.  We need to increment/decrement window count while
showing/closing the create window in order to not exit right after
the create window is opened.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-05-20 12:02:03 -04:00
Cole Robinson
0891fc9ee1 manager: Clean up new conn/vm handling 2016-05-20 11:44:18 -04:00
Cole Robinson
c65e9d1e16 manager: fix --show-domain * manager conn populating
We need to register the conn internally before connecting
vm-added, otherwise the VMs don't end up in the UI
2016-05-20 11:44:18 -04:00
Cole Robinson
eea9b27696 console: Fix and simplify 'Resize to VM' action
We need to resize the window and not try to play crazy games with
the scroll window size. Wish I realized this years ago...
2016-05-20 11:44:18 -04:00
Cole Robinson
8c2adb83ae console: Error for more non-working graphical configs
- If connecting remotely but graphics has no listen address,
    like the spice GL case.
- Trying to connect to a TLS using VM over an ssh tunnel, it doesn't
    seem to work: https://bugzilla.redhat.com/show_bug.cgi?id=1320331
2016-05-18 16:57:38 -04:00
Cole Robinson
0f88ebbc0b console: Enforce text wrapping on 'unavailable' page 2016-05-18 16:32:07 -04:00
Cole Robinson
01d4203933 viewers: spice: fix password auth 2016-05-18 16:14:51 -04:00
Cole Robinson
ed666b21db sshtunnels: Drop 'ext' URI handling
Never really seen it used in practice, so drop this support. Would
probably take more work to make it actually work anyways
2016-05-18 16:06:04 -04:00
Cole Robinson
7b0f916886 baseclass: Undo workaround for old pygobject
Basically reverting this commit:

    commit 1c8bf88db7
    Author: Cole Robinson <crobinso@redhat.com>
    Date:   Tue Jun 18 08:46:24 2013 -0400

    baseclass: Add unregister wrappers for idle and timeout

    If an idle handler raises an exception, it isn't unregistered and loops
    forever. This is a regression from previous pygobject and pygtk:

    https://bugzilla.gnome.org/show_bug.cgi?id=702552

    Work around this for now with our own wrappers.
2016-05-17 17:49:56 -04:00
Cole Robinson
3aa941571a uiutil: Drop check for old pygobject row handling
Once upon a time it couldn't handle setting a row value to None,
but we've bumped the dep now
2016-05-17 17:49:56 -04:00
Cole Robinson
cb4909dffb console: Fix fullscreen keycombo menu placement
Some pygobject update must have fixed the callback signature,
so handle both versions
2016-05-17 17:49:55 -04:00
Cole Robinson
dc05600324 console: Convert from autodrawer to native Gtk widgets
Gtk 3.10 has a GtkOverlay and GtkRevealer widget which we can
use to more sustainably implement the autodrawer functionality.
2016-05-17 17:49:55 -04:00
Cole Robinson
3221b56ac3 viewers: Show spice error message in the UI on disconnect 2016-05-16 16:28:55 -04:00
Cole Robinson
0bd73da4bb sshtunnels: Remove duplicate error strings
spice can open multiple tunnels, and in certain cases we may get
multiple duplicate errors from each tunnel. Try to strip them out
2016-05-16 16:22:35 -04:00
Cole Robinson
adef60211f viewers: Pass SSH error output via gobject signal
Rather than have the console fetch it. Just streamlines things a bit
2016-05-16 16:16:13 -04:00
Cole Robinson
bc03ca5caa console: Tweak console window message when VM is inactive 2016-05-16 16:06:04 -04:00
Cole Robinson
8719acbbd3 viewers: Log spice message on error state 2016-05-16 15:47:37 -04:00
Cole Robinson
6a3b2a68c3 viewers: skip OpenGraphics for local TLS connection
It makes spice loop endlessly requesting an fd:
https://bugzilla.redhat.com/show_bug.cgi?id=1334071
2016-05-16 15:39:46 -04:00
Cole Robinson
6d69b1b98e viewers: Fix VNC auth-rejected error message 2016-05-16 15:31:05 -04:00
Cole Robinson
28540b3854 sshtunnels: Clarify tunnel vs direct connect host/port 2016-05-16 14:55:45 -04:00
Pavel Hrdina
f628c3e266 create: skip continue-install restart if user destroys VM
Commit 159e4af1 fixed a case where VM was started if user destroyed VM
while installing it.  This moves the code before we check whether we
need to restart the VM in order to continue in installation (windows
requires that).

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-05-13 17:38:26 +02:00
Cole Robinson
8b6c404305 serialcon: Add logging about what VTE version we are using 2016-05-07 20:44:22 -04:00
Cole Robinson
9902a7c77f viewers: spice: clarify debug message
This isn't always a 'tunnel' anymore
2016-05-07 20:31:23 -04:00
Cole Robinson
e30671b53d viewers: Only use openGraphics if supported 2016-05-07 19:12:33 -04:00
Cole Robinson
7cc6141618 viewer: move vm from ConnectionInfo to Viewer
I don't really like the VM in Viewer either, since it will encourage
layering violations, but it's a better fit than in ConnectionInfo
2016-05-07 18:09:24 -04:00
Cole Robinson
bd725d6cfe viewers: Centralize viewer FD opening
Put all the logic into _get_fd_for_open. May help centralize future
improvements, like catching lack of openGraphicsFD support
2016-05-07 17:53:10 -04:00
Cole Robinson
7e34b022af sshtunnels: Remove column indent alignment 2016-05-07 17:44:34 -04:00
Cole Robinson
0a1d22f395 console: Remove console_active check
This is largely left over from the old days when a xen VM could
start up but still take a bit of time for the allocated VNC port
to be reflected in the XML.

This may still be an issue with old old xen, but I suspect it's
not relevant for anything modern, and it causes some issues with
listen=none behavior that spice supports. Just drop it and see if
anyone complains
2016-05-02 17:19:27 -04:00
Chen Hanxiao
c4f62ff028 chardev: use pretty type of virtio
We shoud use VirtIO instead of virtio.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2016-05-02 17:11:41 -04:00
Cole Robinson
f4dfb6de9d Fix recent pylint/pep8 output 2016-04-18 16:42:12 -04:00
Mikhail Feoktistov
32cccaa170 virt-manager: Fix VNC connection on hypervisor without GraphicsFD
Function virDomainOpenGraphicsFD() from libvirt can return -1
But in this case libvirt-python will raise an exception.
We should handle this case and return -1 as invalid FD.
In commit 5c451b64 Viewer._open() there is a code to open
graphics console in case of invalid GraphicsFD.

(crobinso: also log the error message)
2016-04-07 16:31:38 -04:00
Guido Günther
a1383faff3 Make SpiceClientGtk optional
Not all architectures supported by Debian have it. This will allow to
make VNC work nevertheless.
2016-04-07 16:12:06 -04:00
Pavel Hrdina
4c3e7969c6 virt-install: concatenate all extra-args argument
So far we used only the last --extra-args argument from virt-install
command line, but it makes more sense to use all occurrences of
--extra-args and pass them to kernel.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-03-18 03:28:17 +01:00
Marc-André Lureau
5c451b6401 virt-manager: connect with openGraphicsFD
This allows to connect to VM without any display listening socket, the
fd passing is done through libvirt connection.

Furthermore, since it uses unix socket, spice can use virgl locally
with texture sharing. This effectively enables spice-gtk to display
local virgl rendering.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2016-03-09 20:25:37 -05:00
Vladimir Panteleev
dcf57af699 details: Ask to apply changes before powering on VMs 2016-02-21 21:08:02 +00:00
Cole Robinson
94e24ab797 viewers: open_host debugging tweaks 2016-02-15 12:54:46 -05:00
Pavel Hrdina
c39592ae7b localization: mark several strings as translatable
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-02-06 16:25:08 +01:00
Cole Robinson
f454798b33 details: Fix screenshot on F24 rawhide (bz 1297988) 2016-01-15 15:07:58 -05:00
Cole Robinson
a0a34e4fed asyncjob: Fix pylint 2016-01-12 12:49:30 -05:00
Cole Robinson
400b668da3 asyncjob: Always hide the X button 2016-01-11 14:48:49 -05:00
Cole Robinson
9747cd5473 asyncjob: Only show X button if dialog is cancellable (bz 1295418) 2016-01-10 18:04:36 -05:00
Pavel Hrdina
89c3638b63 connection: fix detection that libvirtd is stopped
In case that libvirtd is stopped, we could receive another type of error
from libvirt "libvirtError: internal error: client socket is closed".
This one is usually reported from local connection.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-01-08 10:21:42 +01:00
Cole Robinson
0d223e7008 serialcon: Drop the Vte version check
We can work with both the 2.90 and 2.91 APIs no problem, so drop the version
check. The pylint error seems to have disappeared anyways :/
2015-12-24 12:26:08 -05:00
Pavel Fedin
ecf4b3ad40 Prohibit adding PCI host devices to container
libvirt does not allow this and attempt to do so causes error during domain
startup. Prevent this in the beginning instead with correct explanation.

Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
2015-12-24 11:37:59 -05:00
Cole Robinson
f10bbfe5b3 storagelist: Fix error message for vol delete 2015-12-08 12:44:59 -05:00
Cole Robinson
2b7a119457 engine: Drop handling for old asyncjob nested main loops
Hasn't been needed for a long time
2015-12-06 15:41:49 -05:00
Cole Robinson
f7ae826f0a Fix some gi version errors from pylint 2015-12-06 15:41:49 -05:00
Cole Robinson
febe0abdd2 virt-manager: Drop manual dbusapi, use GtkApplication
So I was confused here and completely missed that GtkApplication is
meant to handle the common case of invoking actions in an existing
app instance. So drop the manual dbus server and use the simpler
Gtk support.

Fix a bunch of other errors in this area too
2015-12-06 15:41:49 -05:00
Cole Robinson
739e31e9b0 console: Fix traceback when switching to fullscreen
Traceback (most recent call last):
  File "/home/crobinso/src/virt-manager/virtManager/details.py", line 1257, in switch_page
    self.console.details_refresh_can_fullscreen()
  File "/home/crobinso/src/virt-manager/virtManager/console.py", line 965, in details_refresh_can_fullscreen
    return self._refresh_can_fullscreen()
  File "/home/crobinso/src/virt-manager/virtManager/console.py", line 464, in _refresh_can_fullscreen
    self.widget("control-fullscreen").set_sensitive(allow_fullscreen)
TypeError: Argument 1 does not allow None as a value
2015-11-24 18:23:36 -05:00
Cole Robinson
a9bc56add3 virt-manager: revive cli dbus API (bz 1162815)
This allows virt-manager command line that launch windows to work for an
existing virt-manager instance. This is handy for scripting, and giving
other apps a reasonable way to launch a virt-manager VM window for
example.
2015-11-24 16:30:18 -05:00
Cole Robinson
356f30d7ba create: Hide pxe warning if there's no issue 2015-11-21 20:39:55 -05:00
Cole Robinson
2178cc8c93 create: Drop explicit kickstart UI
Few users actually use this, and they can easily do it with the kernel
options field.
2015-11-21 20:21:09 -05:00
Cole Robinson
e18d2caa45 create: Don't go back to NewVM on error, if customize dialog launched
The code really isn't set up to handle exiting the customize dialog,
so just make the UI enforce it.
2015-11-21 19:55:48 -05:00
Cole Robinson
e68efe8103 domain: Use setMemoryStatsPeriod for QEMU
Since that's what is required to get cooperative memory stats from
the guest balloon driver.
2015-11-18 21:20:36 -05:00
Cole Robinson
689b0db2c7 fsdetails: Don't sort type list, use the specified order
For LXC we want 'Mount' at the top, not the alphabetical 'Block'
2015-11-18 21:15:53 -05:00
Cole Robinson
c3b5fb407a details: Fix editing filesystem devices 2015-11-18 21:12:35 -05:00
Cole Robinson
71a52300ae systray: Log if we will use AppIndicator 2015-11-18 18:54:17 -05:00
Cole Robinson
cbef4ad84b systray: Fix appindicator icon name (bz 1257949) 2015-11-18 18:48:30 -05:00
Cole Robinson
603fc361bc connect: Fix generated URI for IPv6 addresses 2015-11-18 16:56:41 -05:00
Cole Robinson
d32953d8c6 details: Remove UI for vcpu pinning
This UI exposed the old NUMA allocation policy detailed in the last commit.
It's very much sub-optimal, and should be removed.

Manual cpuset configuration is also quite uncommon and not really something
worth exposing in the UI. It can easily be done from the command line
with virt-xml.

If people complain, I'd consider adding a checkbox for vcpu placement=auto,
or an option to do that by default for new VMs.
2015-11-18 15:05:21 -05:00
Chen Hanxiao
908a00cc73 details: show Channel label by device type
Currently we show channel label by its name.
If we use name com.redhat.spice.0 but set it
as unix socket, the label in details keep unchanged.

This patch will set label according to device type
if we failed matching target_name

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2015-11-12 22:53:17 +08:00
Pavel Hrdina
fedf2e7b66 ui: improve pause/resume tooltip
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1238618

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-11-12 13:13:19 +01:00
Cole Robinson
3e049583cc details: Drop ignorePause variable; just block the signals 2015-11-10 18:30:31 -05:00
Cole Robinson
0bf6124a28 storage: Fix updating UI when volume deleted (bz 1279940)
We in fact weren't updating the cached XML when pool.refresh() was called.
2015-11-10 17:40:04 -05:00
Cole Robinson
ba8080db3f storagelist: Reset list position after deleting volume (bz 1279861) 2015-11-10 17:27:49 -05:00
Cole Robinson
d5e5068699 engine: Update details window mapping when VM is renamed
Fixes this issue:

- Rename VM from 'foo' to 'foo1'
- Create new VM named 'foo'
- It raises 'foo1' window
2015-11-03 16:01:04 -05:00
Cole Robinson
fe722b99cb setup: Make gsettings always work regardless of install dir (bz #1267377)
Most of this is lifted from 'meld'. The bits are

- compile gsettings schemas at setup.py install time
- add options to disable that, and use them in the RPM
- always pass GSETTINGS_SCHEMA_DIR so gsettings loading always works
  regardless of the install dir

https://bugzilla.redhat.com/show_bug.cgi?id=1267377
2015-11-02 21:02:42 -05:00
Cole Robinson
c6da8fedb8 config: s/running_config/RUNNING_CONFIG/g 2015-11-02 16:09:47 -05:00
Cole Robinson
50b1b18ec4 create: Show a warning if no network is selected (bz 1267377) 2015-11-02 14:48:03 -05:00
Cole Robinson
90816a6263 create: Simplify network warning setup 2015-11-02 14:47:59 -05:00
Cole Robinson
a91419d5c6 netlist: Don't trigger change events when repopulating list
Like we do in other places
2015-11-02 14:41:18 -05:00
Cole Robinson
0b6233b0f8 create: Small re-org of conn init
- Share error reporting with the two callers
- Fix an issue where the arch error dialog is shown when there's no connections
2015-11-02 14:08:09 -05:00
Colin Walters
3eaa59dc95 addstorage: Fix a typo in an error message
Just noticed it while using the app.
2015-10-05 14:47:50 -04:00
Cole Robinson
b45a0ce286 create: Show TCG vs KVM for aarch64 too
Since it can be used for arm32 installs as well.

Requested here; https://bugzilla.redhat.com/show_bug.cgi?id=1214592#c4
2015-09-28 20:00:01 -04:00
Cole Robinson
d57d4d0e76 netlist: Allow specifying a manual bridge name for qemu:///session (bz 1212443)
Since qemu has the setuid qemu-bridge-helper, give a way in the UI
to specify a manual bridge name for qemu:///session. Might not work
all the time but at least the users can try

https://bugzilla.redhat.com/show_bug.cgi?id=1212443
2015-09-24 16:32:04 -04:00
Cole Robinson
0f940a4432 details: Fix topology init from overriding curvcpus value
Reported here: https://bugzilla.redhat.com/show_bug.cgi?id=1095323#c5
2015-09-24 09:31:04 -04:00
Cole Robinson
8b9b05f563 details: Fix busted UI after translation changes 2015-09-23 17:31:26 -04:00