Commit Graph

84 Commits

Author SHA1 Message Date
Cole Robinson 7eaf036acf virtinst: Remove stable_defaults concept
This switch says: if we detect a rhel host, use special version
checks that match rhel backports. This pattern sucks. The way
forward is to have libvirt advertise the bits that are supported,
through domcapabilities. Then virt-manager/virtinst can react
as appropriate.
2018-10-06 19:45:51 -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 967ca4eeda virtinst: Drop direct 'support' usage
Except from connection. This requires some reorg in clitest and
some minor changes in a few other places
2018-08-31 18:31:17 -04:00
Cole Robinson 2eaff7fdcf support: Remove getversion/getlibversion checks
They are only used in one place, just handle it there
2018-08-31 18:31:17 -04:00
Cole Robinson 2b41e130d8 connection: rename fetch_all_guests->fetch_all_domains
The virtinst class is erroneously called Guest, but these
functions are dealing with libvirt <domain> XML, so rename them
2018-08-31 16:50:46 -04:00
Cole Robinson ffab20782f connection: Handle more openauth cred types
Like ECHOPROMPT which is needed for libssh hosts file management.
Sync the two implementations a bit
2018-05-03 06:16:28 -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 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 6ad6f44920 connection: Call virConnectClose and log the return value
This can help us find object leaks within the code. virConnectClose
is just a deference and will return 1 if other references are still
floating around.
2018-03-15 21:24:48 -04:00
Marc-André Lureau 39721cbe1b connection: support checking for a list of features
Make check_support() accept a list of features.

This will let tests have more complex conditions on the features they
require.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-02-22 16:23:40 -05:00
Cole Robinson 7cf0b310cc capabilities: Move machine canonicalizing to capsinfo
Rather than overright XML content on every parse
2018-02-14 11:08:09 -05:00
Cole Robinson ec0d3072c0 virtinst: connection: Fix error caching new pool
$ virt-install --connect test:///default --name foo --ram 64 --import --disk /tmp/idontexist.img
ERROR    Error: --disk /tmp/idontexist.img: 'vols'
2017-08-30 10:34:17 -04:00
Cole Robinson 1a09a05dc7 tests: Add a clone test for importing nvram directory
Need to use some callback magic to fake it like there's a file in
an existing directory
2017-07-20 17:51:06 -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 55aa23b400 connection: Return copys of cached object lists
Incase any users manipulate the lists, we don't want that to affect
our caching. Could prevent future mistakes
2017-07-20 17:28:38 -04:00
Cole Robinson 4e4a6c817f connection: Rework cache function layout slightly
Have the internal polling functions not touch the connection cache.
This let's us not worry about the connection cache in the test suite,
where clear_cache wasn't 100% correct.
2017-07-20 17:28:38 -04:00
Cole Robinson 98b5ea8b2c connection: Drop disabling of cache_object_fetch
All cases we care about either provide their own callbacks, or
explicitly want this caching, so enable it unconditionally
2017-07-19 12:57:36 -04: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
Cole Robinson fab55c128f Drop use of python2 long() syntax
Plus one more python3 syntax issue
2017-05-05 14:54:35 -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
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 435de2d40c pylint: Fix some issues with F25 version 2016-12-13 12:36:49 -05:00
Cole Robinson c5ce0ab512 connection: Fix transport detection for qemu://$HOST/system
In this case, when a host is specified but not a transport, libvirt
defaults to transport=tls
2016-06-21 11:31:26 -04:00
Pavel Hrdina 1a760e74d8 virtinst.connection: detect RHEL system also for session connection
We should detect RHEL qemu also for session connection, not only system
connection, the capabilities of both are the same.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-11-05 13:34:13 +01:00
Cole Robinson 1d7b74ba52 uri: Add a MagicURI class for handling magic virtinst URIs
And document it
2015-09-06 12:00:25 -04:00
Cole Robinson 82ea5bfc62 tests: Add qemu:///session unit tests 2015-08-10 12:46:47 -04:00
Cole Robinson 4781ad6cd6 connection: Simplify manager row 'pretty name' handling
Unify all the callers, and use some UI ellipsizing to handle
crazy long hostnames.

This drops the conn name collision prevention stuff which can be
useful when you have lots of similar connection names. But upcoming
patches will make it mostly redundant.
2015-04-11 12:57:32 -04:00
Cole Robinson fc171fc31d connection: Bunch of minor tweaks handling TCP URIs 2015-04-11 12:08:57 -04:00
Cole Robinson 838baf6946 connection: tick: Operate on combined object lists
Makes the flow a bit simpler, and allows us to break out polling without
having to pass around a ton of lists.
2015-04-10 15:00:34 -04:00
Cole Robinson a773a66a3f virtcli: Export config variables in a class object
Makes things easier to extend later
2015-04-06 15:54:35 -04:00
Cole Robinson cac4ac1401 capabilities: Switch to use XMLBuilder
Just a cleanup to finally unify all the XML objects around the same
API, and drop a bunch of old cruft.
2015-04-03 16:45:42 -04:00
Cole Robinson 7866e291f6 guest: Never use vmvga if host is RHEL (bz 1147662)
We basically need to do this independent of whether the build is configured
for RHEL defaults or not
2015-03-25 09:04:51 -04:00
Cole Robinson 08a72a4aec connection: Clean up stable_defaults, improve test coverage 2015-03-23 16:49:32 -04:00
Cole Robinson 590e4772eb connection: Fix error checking stable_defaults
This should fail when run against actual RHEL capabilities output
2015-03-23 16:39:49 -04:00
Giuseppe Scrivano 7b630c00a0 Move stable_defaults from vmmConnection to VirtualConnection
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-02-24 17:44:23 +01:00
Cole Robinson 4ee9fdf944 domcapabilities: Get arch from caps XML 2015-02-22 11:13:59 -05:00
Cole Robinson 4efc814d7f connection: Add domain caps handling for fake URIs
Allows us to pass in custom domcaps content for testing purposes
2015-02-22 10:25:47 -05:00
Cole Robinson 9f4d03d31a storage: Really don't use PREALLOC flag with test driver
Even if we are trying really hard to fake looking like qemu/kvm
2014-12-09 13:14:12 -05:00
Cole Robinson cff08223ba util: Move uri_split to its own URISplit class
Does what uri_split did, but wraps it all up in an object that makes
handling the data easier, and makes it easy to extend.
2014-12-09 08:43:19 -05:00
Cole Robinson c7d00baf66 virtinst: connection: Only poll volumes for running pools 2014-12-04 19:25:15 -05:00
Cole Robinson dd67c48233 connection: Handle nodedev polling too
And cleanup up a bunch of nodedev functions as a result
2014-09-20 12:04:49 -04:00
Cole Robinson eb7612356e virtinst: Switch to relative imports, fix cyclic import warnings 2014-09-12 16:28:38 -04:00
Giuseppe Scrivano 3606bb573d virtinst: add method to set connection keep-alive
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-07-02 15:31:40 +02: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
Cole Robinson 994b1fa4f4 connection: Add explicit API for getting virConnect object 2014-03-20 14:04:29 -04:00
Cole Robinson df7012a68b Handle libvirt generating invalid volume XML (bz 1072770) 2014-03-06 12:04:08 -05:00
Cole Robinson 5d5be6df28 Remove some pylint 2014-02-14 11:37:47 -05:00