Commit Graph

136 Commits

Author SHA1 Message Date
Cole Robinson f06325904b cloner: Share more clone disk building logic
We use this in virt-manager for nvram move on VM rename, so
let's simplify things for all callers

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Pino Toscano 71f034d6b6 i18n: fix string puzzles in error messages
Do not split the error messages and the error details, but rather use a
single string with proper placeholders. This avoids string puzzles.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Cole Robinson fec9f0b136 po: Fix message format warnings printed from xgettext
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-11 19:18:38 -04:00
Cole Robinson e79b550419 Fix pylint with latest pylint version
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-30 16:04:12 -04:00
Cole Robinson bea5e56c26 virtinst: connection: Add is_privileged
Replace the is_session and is_system distinction with variants
of is_privileged. This matches what libvirt uses internally, and
will help with supporting qemu:///embed at some point

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-02-03 07:05:11 -05:00
Cole Robinson cd72213b85 storage: Exclude a line from code coverage
To get back to 100% coverage
2019-07-31 17:53:51 -04:00
Cole Robinson ef46af706a storage: Don't leave thread stranded on error
Move thread callback outside the StorageVolume class, so we are
forced to explicitly pass in every bit it may act on. Ensure we
always cancel and clean up the thread
2019-07-17 12:57:38 -04:00
Cole Robinson aaa065d38e createpool: Add more coverage testing 2019-07-03 19:37:01 -04:00
Cole Robinson 616a7f2dd5 createpool: Simplify LVM volume group UI
Only show the volgroup name, and nothing else, which is all mostly
extraneous

https://bugzilla.redhat.com/show_bug.cgi?id=1316977
2019-07-03 19:37:01 -04:00
Cole Robinson 105553563a storage: Simplify source pool enumeration
Don't return an XML object stub, just return the relevant data.
Make it explicit that we currently are only supporting lvm
enumeration
2019-07-03 19:37:01 -04:00
Cole Robinson fd8847c24e storage: test default_target_path 2019-07-03 19:37:01 -04:00
Cole Robinson 199e9593bf storage: test default_source_name 2019-07-03 19:37:01 -04:00
Cole Robinson f21d7e4c27 storage: Add explicit StoragePool.lookup_default_pool
Rather than adding an option to build_default_pool which is only
used in one location
2019-07-03 19:37:01 -04:00
Cole Robinson 67bb8fabdb storage: Drop redundant validation
libvirt catches most of this, and it's not all that useful to
duplicate it ourselves
2019-07-03 19:37:01 -04:00
Cole Robinson 9d7b20d3de storage: Add lots of coverage testing and exemptions 2019-07-03 19:37:01 -04:00
Cole Robinson f64655a843 storage: Replace pool supports_property with supports_X
Makes usage more explicit, and easier to track for coverage testing
2019-07-03 19:37:01 -04:00
Cole Robinson b8074b4505 storage: Replace volume supports_property with supports_format
Helps to make usage more explicit
2019-07-03 19:37:01 -04:00
Cole Robinson 657b2bcb26 storage: move supports_volume_creation to virtManager
It's the only user
2019-07-03 19:37:01 -04:00
Cole Robinson 4a0b7f61c8 storage: move pool pretty printing to virtManager
It's the only user
2019-07-03 19:37:01 -04:00
Cole Robinson f107e39989 Switch to more traditional logging structure
Init a shared log instance in virtinst/logger.py, and use that
throughout the code base, so we aren't calling directly into
'logging'. This helps protect our logging output from being
cluttered with other library output, as happens with some
'requests' usage
2019-06-17 00:12:31 -04:00
Cole Robinson 387614c641 generatename: Move libvirt collision handling to callers
Make every caller pass an explicit cb that handles libvirt
collision processing. Makes it easier to see exactly what is going
on at the call impls
2019-06-11 17:54:45 -04:00
Cole Robinson 4cdf2e4a78 generatename: Remove collidelist
Fold it in to the callback of the single remaining user
2019-06-11 17:54:45 -04:00
Cole Robinson 47a6f3a6d5 storage: Handle guest collision checking
This pattern is already used in two places. Formalize and centralize
it
2019-06-11 17:54:45 -04:00
Cole Robinson 6e6a0b8a6a connection: Use shared default pool lookup logic
It wasn't abiding a different pool name pointing to our default
path
2019-06-11 17:54:45 -04:00
Cole Robinson 088657a2b8 storage: Kill get_default_dir
The last location is in virt-convert, which has weird local directory
creation semantics. Just have it use storage APIs like we do
everywhere else
2019-06-11 17:54:45 -04:00
Cole Robinson e27202d178 createpool: Use StoragePool.default_target_path
Indirectly, rather than the less useful get_default_dir
2019-06-11 17:54:45 -04:00
Cole Robinson 8bfa04c230 storage: Split apart build_default_pool, and document it 2019-06-11 17:54:45 -04:00
Cole Robinson 6677f677da util: move generate_name to generatename.py 2019-06-07 18:16:53 -04:00
Cole Robinson 5ed8f2aa5f util: move validate_name to XMLBuilder.validate_generic_name 2019-06-07 18:04:12 -04:00
Cole Robinson c603ea4084 util: Move *_meter to progress.py 2019-06-07 17:32:51 -04:00
Cole Robinson ca10e4094b util: move is_error_nosupport to SupportCache 2019-06-07 16:49:19 -04:00
Cole Robinson f85e6def55 support: Convert callers to the new format 2019-06-07 16:26:03 -04:00
Cole Robinson f47f6f3c7c util: Replace xml_indent with textwrap.indent 2019-06-06 18:11:01 -04:00
Cole Robinson 1cc2a0ae8b storage: Add ensure_pool_is_running
We pretty much require a referenced storage pool to be running if
it's intended to be used as a virt-install or virt-manager requested
disk. So add a helper to start a pool if needed and optionally refresh
it
2019-04-14 20:22:02 -04:00
Cole Robinson cfd543adb9 storage: more logging when we look up default pool 2019-03-26 11:16:14 -04:00
Cole Robinson 4f66c423f7 cloner: Handle --nonsparse for qcow2 images (bz 1675743)
https://bugzilla.redhat.com/show_bug.cgi?id=1675743
2019-03-04 14:04:34 -05:00
Pavel Hrdina 26a433fc42 virtManager: clone: check which storage pools supports volume cloning
When cloning a guest in virt-manager the GUI shows a list of disks and
select default cloning policy for every disk.  For storage pools where
we know that cloning is not possible we should not select that option
as default one.

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

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-03-04 13:23:45 +01:00
Cole Robinson 2f89ecf4a9 Remove Author lines from file headers
Similar to what was done in libvirt. See these commits:

600462834f
c99e954973
2019-01-08 11:45:35 -05:00
Cole Robinson c0314cad2e storage: Remove needless manage_path wrapper 2018-10-11 19:23:18 -04:00
Cole Robinson 2b7043cd85 createpool: Fix showing formats
But shrink the format list to 'auto' only, but also add a text entry
so users can type their own
2018-09-06 13:28:21 -04:00
Cole Robinson c5033c02d5 fsdetails: Use combo entry for format list
And stop listing all the crazy qemu formats
2018-09-06 13:28:21 -04:00
Cole Robinson 852d7b564d virtinst: Remove name field validate_cb usage
Either openly do this at callers, or wrap it in a validate() call.
Doing this at set time has always had issues, like the self.replace hack
2018-09-04 14:55:04 -04:00
Cole Robinson 1e76496fa8 storage: remove default_cb usage 2018-09-04 14:55:04 -04:00
Cole Robinson fb1bb26373 support: Drop lots more checks
- Remove anything for less than qemu 0.12 or libvirt 0.10, basically
  rhel6 vintage stuff
- Open code some simple checks
- Remove some that are only used for unnecessary error reporting
2018-08-31 22:21:15 -04:00
Cole Robinson ea413be214 xmlbuilder: Rename get_xml_config -> get_xml
The config part is redundant. Should have done this a long time ago
2018-08-31 16:52:02 -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 4b26348290 xmlbuilder: Separate out the property cache
Add a few more mappings to simplify certain lookups, and add
some more validation to prevent programming errors
2018-03-21 14:32:47 -04:00
Cole Robinson 7fb1ddbc18 virtinst: s/_XML_ROOT_NAME/XML_NAME/g
No reason for it to be privatized, could be useful in some cases
2018-03-21 11:17:36 -04:00
Cole Robinson b6dcee8eb7 Use consistent and minimal license header for every file 2018-03-21 07:29:40 -04:00
Cole Robinson 93c22eff79 xmlbuilder: Move xml_indent to util 2018-03-20 10:35:22 -04:00