Commit Graph

48 Commits

Author SHA1 Message Date
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
Daniel P. Berrangé
48e32b429d Fix copyright header to specify GPLv2 or later, not GPLv2 only.
The copyright headers in every file were chjanged in this previous commit

  commit b6dcee8eb7
  Author: Cole Robinson <crobinso@redhat.com>
  Date:   Tue Mar 20 15:00:02 2018 -0400

    Use consistent and minimal license header for every file

Where before this they said "

  "either version 2 of the License, or (at your option) any later version."

Now they just say

  "GNU GPLv2"

This fixes it to say "GNU GPLv2 or later" again.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-04 16:51:37 -04:00
Cole Robinson
eee1caa946 domain: Drop most device list wrappers
There's lots of hacks stuffed into the domain device lists. Formalize
some of it, move some of the specific stuff to details.py, and drop
a lot of the needless API wrappers
2018-03-21 16:10:45 -04:00
Cole Robinson
b6dcee8eb7 Use consistent and minimal license header for every file 2018-03-21 07:29:40 -04:00
Cole Robinson
1c911ce567 virtinst: Give device classes consistent DeviceX naming
Previous state was inconsistenty and needlessly wordy. Fix up
a few other class namings that have redundant Virtual in the name
2018-03-21 07:29:40 -04:00
Cole Robinson
3c1e0a8a12 virtManager/*: Give pylint hints about singleton classes
It can't seem to figure out that what 'cls' is in this context,
so make it explicit.
2018-03-17 18:46:39 -04:00
Cole Robinson
cad809fe80 Make all dialogs clean up when vm/conn disappears
Moves all the window cleanup handling to each class and audit for
all --test-leak-debug errors and fix
2018-03-15 21:24:48 -04:00
Cole Robinson
65b512ae6f delete: Convert to singleton 2018-03-15 21:24:48 -04:00
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
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
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
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
Cole Robinson
c0a3234633 baseclass: share wizard cursor setting code 2017-04-27 15:00:17 -04: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
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
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
Cole Robinson
57fa64e542 details: Use devicedisk path lookup for source_pool 2015-09-05 17:59:47 -04:00
Cole Robinson
b02cb7ffa0 delete: Improve dialog sizing and scrolling
Drop horizontal scrolling, since with gtk3 hidden scrollbars it might
mean users don't realize there's info that is scrolled off.

Adjust the default sizing to match that pattern
2015-05-20 17:50:11 -04:00
Cole Robinson
a65c1f62ec conn: Audit get_$obj callers, drop KeyError handling
These functions don't throw KeyErrors anymore, so adjust callers that
were handling it
2015-05-07 12:26:10 -04:00
Giuseppe Scrivano
ac2be79658 storage: do not throw exception if the volume or the pool don't exist
commit 5357b91402 changed the semantic of
conn.get_(vm|pool|interface|nodedev|net), to return None instead of
raising KeyError. Leave the exception handling code in case the
semantic is going to be reverted.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-07 17:42:58 +02:00
Cole Robinson
a75aa47daf devicedisk: Use consistent capitalization for property names 2014-12-04 16:30:18 -05:00
Giuseppe Scrivano
8f1aa5a4f0 virt-manager, delete: fix path for disk type='volume'
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1146869

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-10-14 12:23:08 +02:00
Cole Robinson
ebeea7af9f delete: Remove nvram support
As of now, the only uses of nvram likely in the domain XML are with
libvirt configurations that also support the UNDEFINE_NVRAM flag, so
listing it here is kind of redundant. And in the common config of
non-root user connected to qemu:///system with template based nvram
in /var/lib, we won't be able to remove it anyways.
2014-09-19 20:04:39 -04:00
Giuseppe Scrivano
e5d2059853 virt-manager: delete nvram file on VM deletion
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-09-16 09:49:00 +02:00
Cole Robinson
226c4562d5 virtManager: Switch to relative imports 2014-09-12 16:28:38 -04:00
Cole Robinson
a398d245cb Clean up pylint integration
- Drop no longer needed disable= bits
- Use string names for all skipped pylint messages
2014-04-02 19:00:24 -04:00
Chen Hanxiao
25a50d7b27 delete: fix a typo
s/sharable/shareable

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-02-26 09:36:16 +08:00
Chen Hanxiao
fa622273a0 delete: fix an improper comment
commit b2a7c396 introduce confirmation before deleting,
we should keep the comment consistent with it.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-02-17 21:11:49 +08:00
Cole Robinson
889ec18031 uiutil: Use list selection helpers everywhere 2014-01-27 10:46:14 -05:00
Cole Robinson
708a2737cf Split uihelpers into sharedui and uiutil
Reserve uiutil for the little gtk helper functions, rest goes into shared
UI (which all should probably be factored into their own files but thats
a task for another day)
2014-01-26 18:15:50 -05:00
Cole Robinson
58d5e0b799 uihelpers: Move a few more functions closer to their callers 2014-01-26 17:51:15 -05:00
Cole Robinson
330bcd9c8b delete: Track kernel/initrd/dtb as well 2014-01-14 17:26:29 -05:00
Giuseppe Scrivano
0df75c7603 headers: update "Red Hat, Inc." copyright for the year 2013
Ensure that any file touched by a @redhat.com author in 2013 has an
updated copyright header.

The files were updated using the build-aux/update-copyright gnulib
script and manually added where the copyright line wasn't present.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-28 17:22:26 +01:00
Cole Robinson
9e73d6e4f0 delete: Make it look like other UI wizards
And fix a couple UI issues:
- Hide storage list when not deleting
- Have confirmation dialog explicitly list paths we will delete (bz 967927)
2013-09-27 11:10:54 -04:00
Cole Robinson
d338bce329 Rename ui files to match source file names 2013-09-22 16:10:16 -04:00
Cole Robinson
1683d56b8d ui: Set non-stock button images in glade, not explicitly in code 2013-09-22 12:33:02 -04:00
Cole Robinson
aff0ddb259 Use XMLBuilder for Storage object handling
Simplify the API a bunch while we are at it, add tests, etc.
2013-09-20 10:00:08 -04:00
Cole Robinson
6869760732 asyncjob: Fix issues with multiple dialogs (bz 1003101)
Basically, drop usage of nested main loops. As has been documented in
other commit messages, we use nested main loops in ways they aren't
supposed to be used. They gave us async behavior that would block
callers, but had weird behavior in some edge cases.

Switch to having async dialogs be 100% async, requiring the user to
pass in a completion callback which is triggered after the async
action is complete.
2013-09-06 21:30:19 -04:00
Cole Robinson
7c55cfeb39 virtManager: Drop util, combine it with virtinst.util and uihelpers 2013-08-11 12:39:28 -04:00
Cole Robinson
5e9e444dec connection: Do non-VM polling on demand
The goal here is to reduce the amount of tick() polling that we do by default.
For things like pools, networks, and interfaces, the constant polling is
not very helpful and causes CPU churn and slowness for remote connections.

Switch to a more on demand style. Pages that want new information for
these objects now request a priority tick that only refreshes the info
we want.

This isn't perfect, but neither was the previous solution in the face of
things like XML updates behind our back. The real solution here is libvirt
event support across the board.
2013-07-07 12:17:54 -04:00
Cole Robinson
76887c9a32 engine: Switch tick threading model to use queues
And allow other parts of the API to request a priority tick that is
dispatched from the main tick thread.
2013-07-06 21:24:38 -04:00
Cole Robinson
be2d9ddcb4 Add base conn object and bump minimum libvirt version to 0.6.0
This base connection object will be used to simplify the API in various
places, reduce libvirt API calls, and better share code between virtinst
and virt-manager. For now it just centralizes connection opening.

This also exposed various places where our handling for older libvirt
was busted, so raise our minimum host version to 0.6.0, the first
version that supports threaded client requests.
2013-07-05 16:42:19 -04:00
Leonardo Garcia
660178abe1 Permit to delete a running VM.
The VM will be forced off before being deleted.

(crobinso: fix a minor pylint violation)
2013-06-18 08:49:18 -04:00
Cole Robinson
30d509feec delete: Tweak 'are you sure' message for storage deletion 2013-06-17 13:41:32 -04:00
Cole Robinson
07e0c92b4b Remove a bunch of outdates FIXME/XXX comments 2013-04-17 09:32:00 -04:00
Cole Robinson
0d243983d0 Revive pep8 and clean up the code
autopep8 is pretty cool :)
2013-04-13 15:22:43 -04:00
Cole Robinson
9515a8575d Disable pylint warnings about gi.repository
Since pylint still can't handle the dynamic nature of gobject
introspection.
2013-04-12 08:27:45 -04:00
Cole Robinson
9d05583c26 Remove autotools, replace with distutils-extra
Despite being a known quantity, autotools is so overkill for our needs,
so let's drop it and replace it with a much simpler and easy to customize
system.
2013-04-03 18:20:51 -04:00