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
Cole Robinson
3d34f6a231
storage: Fix validating empty hosts value (bz #1557942 )
...
https://bugzilla.redhat.com/show_bug.cgi?id=1557942
2018-03-19 10:29:00 -04:00
Radostin Stoyanov
1ae5c4ff75
pylint: Resolve logging-not-lazy
...
A new Python checker was added to warn about using a + operator inside
call of logging methods when one of the operands is a literal string.
https://pylint.readthedocs.io/en/latest/whatsnew/1.8.html
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-03-03 16:04:12 -05:00
Cole Robinson
3079426c82
virtinst: Drop doc= for properties
...
This data never gets to the user and largely is just duplicating
libvirt docs. It's redundant
2018-02-22 20:49:07 -05:00
Cole Robinson
6cad350649
storage: Use a threading event to signal progress thread
...
Much more reactive and saves us time in the test suite
2018-02-22 19:12:23 -05:00
Cole Robinson
d108bbe143
Convert docstrings to standard reStructuredText param format
2018-02-14 11:08:09 -05:00
Cole Robinson
dae8642bb1
xmlbuilder: centralize adding child new child prop instances
...
Currently the domain CPU class has a child property like:
siblings = XMLChildProperty(_CPUCellSibling)
If a user wants to add a new sibling, we add a convenience function:
def add_sibling(self):
obj = _CPUCellSibling(self.conn)
self.add_child(obj)
return obj
Rather than require every child property to define a similar matching
helper function, this adds infrastructure in xmlbuilder to do this
generically for every child property. Now callers can do
obj = guest.cpu.siblings.add_new()
2018-02-08 14:03:47 -05:00
Radostin Stoyanov
978fb25ac7
Wrap keys(), values() in a list
...
In Python 3 dict.values() [1] , dict.keys() [2] and dict.items() [3]
return a view [4] of the dictionary’s values, keys and items.
In Python 2 these functions return a list. [5] [6] [7]
To resolve this we can convert the result of these function to a list.
[1] https://docs.python.org/3/library/stdtypes.html#dict.values
[2] https://docs.python.org/3/library/stdtypes.html#dict.keys
[3] https://docs.python.org/3/library/stdtypes.html#dict.items
[4] https://docs.python.org/3/library/stdtypes.html#dict-views
[5] https://docs.python.org/2/library/stdtypes.html#dict.items
[6] https://docs.python.org/2/library/stdtypes.html#dict.keys
[7] https://docs.python.org/2/library/stdtypes.html#dict.values
2018-02-06 18:49:17 -05:00
Rauno Väli
582c1d3ded
devicedisk: copy all rbd pool host and auth for volume
...
(crobinso: add test suite coverage, fix some pylint)
2018-01-30 11:30:22 -05:00
Radostin Stoyanov
6712261510
Python 2/3 division compatability
...
In Python 2 the classic devision of integers returns an integer
but in Python 3 it might return float.
Example:
- Python 2: - Python 3:
>>> 9 / 4 >>> 9 / 4
2 2.25
>>> 9 // 4 >>> 9 // 4
2 2
>>> 9 / 4.0 >>> 9 / 4.0
2.25 2.25
>>> 9 // 4.0 >>> 9 // 4.0
2.0 2.0
For more info see: https://www.python.org/dev/peps/pep-0238/
2018-01-27 15:30:17 -05:00
Cole Robinson
fe59c33772
virtinst: storage: Don't generate UUID by default
...
Just let libvirt do it for us, it doesn't really add anything
2017-12-14 12:45:01 -05:00
Cole Robinson
8b4befae60
virtinst: Drop UUID validation
...
It's redundant as libvirt will give us these checks already, and we
aren't even testing it
2017-12-14 12:45:01 -05: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
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
c4826444e9
storage: Fix 'srcname' referenced before assignment (bz #1474766 )
...
https://bugzilla.redhat.com/show_bug.cgi?id=1474766
2017-08-03 12:38:37 -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
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
5b51c98ae5
storage: Check for pool name collisions against the pool cache
...
Rather than using storagePoolLookupByName. This will save some API
calls, but the main benefit is that it can help shake out cache
issues.
2017-07-20 17:28:38 -04:00
Cole Robinson
4e7a6ad728
tests: pylint: Silence/fix a bunch of new warnings
2017-06-16 12:54:56 -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
a90d675394
Switch deprecating log.warn to log.warning
...
Same semantics, but the alias is deprecated
2017-05-05 14:53:28 -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
9c8ffe51da
storage: Move alloc/cap validation to validate()
...
Doing this at property set time is overly noisy. Follow the same
pattern of VirtualDisk and only do this in the validate() function.
https://bugzilla.redhat.com/show_bug.cgi?id=1433239
2017-03-17 12:14:05 -04:00
Pavel Hrdina
82eaf4742e
virtinst.storage: improve detection of disk type
...
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-03-06 14:31:42 -05:00
Cole Robinson
eb2a56f700
util: Move xml_indent to XMLBuilder
2016-08-24 15:56:13 -04:00
Tristan Helmich
27703ca379
storage: Enable creation of zfs storave volumes
2016-08-09 11:48:34 -04:00
Pavel Hrdina
9cdf78e94c
translation: fix usage of translate function
...
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-07-26 09:34:20 +02:00
Cole Robinson
5398282e12
storage: Detect backing_store format automatically
...
By attempting to manage/import the passed path. This makes it
work via both virt-install and virt-manager
https://bugzilla.redhat.com/show_bug.cgi?id=1235406
2016-06-16 20:36:30 -04:00
Cole Robinson
8d4e58c501
cli: Add --disk backing_format= option
2016-06-16 20:09:37 -04:00
Cole Robinson
f4dfb6de9d
Fix recent pylint/pep8 output
2016-04-18 16:42:12 -04:00
Cole Robinson
95fd32dffd
storage: Avoid some test suite noise on thread cleanup
2015-12-24 11:30:15 -05:00
Pavel Hrdina
0ccbcd8883
storage: remove attempt counter from disk allocation thread
...
Remove the lookup counter from _progress_thread, it's not necessary, the
loop is terminated by _install_finished boolean.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1270277
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-11-19 15:09:59 +01:00
Charles Arnold
f30975c3f8
storage: remove cow as supported format
...
Support for this format was removed about a year ago from
qemu with this commit,
commit 550830f9351291c585c963204ad9127998b1c1ce
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: Tue Sep 16 15:24:24 2014 +0100
block: delete cow block driver
Signed-off-by: Charles Arnold <carnold@suse.com>
2015-09-29 16:33:16 -04:00
Cole Robinson
697164f2e5
virtinst: Centralize urlgrabber meter lookup
...
We will eventually want to drop this dep since it's basically dead
upstream, this is a small step in that direction
2015-09-06 15:09:44 -04:00
Cole Robinson
acfb988945
xmlbuilder: Make _add_child and _remove_child public
...
We have a lot of functions that are just wrappers around these, so
make it public for future use.
2015-09-04 15:47:43 -04:00
Charles Arnold
eb92178e0c
storage: fix default storage pool lookup
...
virt-convert fails when the storage pool is already present but
is not called 'default'.
If the 'default' pool has been removed but another pool uses the
default location of /var/lib/libvirt/images virt-convert will fail
to find the pool and attempt to create another one with the same
path. This causes the conversion to fail.
Signed-off-by: Charles Arnold <carnold@suse.com>
(crobinso: Remove now-redundant 'pass')
2015-08-31 18:25:37 -04:00
Cole Robinson
e22aeac5ae
storage: session path should be ~/.local/share/libvirt/images
...
Not .local/libvirt/images :/ App dirs aren't supposed to be in ~/.local
2015-08-10 12:35:13 -04:00
Pavel Hrdina
0fbe8e7a1f
translation: fix wrong usage of _() function
...
All the strings have to be at first translated and then we can fill the
formated and translated string.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-06-05 16:33:51 -04:00
Cole Robinson
2d54949719
virtinst: Drop a bunch of uses of xmlbuilder make_xpath_cb
...
I'd like to drop that functionality from xmlbuilder, and just open
code it at the callers... this is most of the way there
2015-05-06 16:26:51 -04:00
Cole Robinson
252c216fb9
createpool: Don't unconditionally use /var/lib/libvirt
...
Doesn't make sense for session URIs
2015-05-02 19:54:14 -04:00
Cole Robinson
45e6cd4cac
Remove redundant 'default dir' functions
2015-05-02 19:48:04 -04:00
Cole Robinson
015da05973
storage: Use .local/libvirt/images for session URIs
...
.config isn't really appropriate
2015-05-02 19:09:14 -04:00
Cole Robinson
8369c65966
storage: Use ~/.config/libvirt/images for qemu:///session
...
It doesn't create the annoying ~/VirtualMachines directory, and already
has proper labelling.
2015-04-24 21:01:55 -04:00
Giuseppe Scrivano
616df760be
storage: copy allocation and capacity also on cross-pool clones
...
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1210265
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-04-10 16:40:49 +02:00
Cole Robinson
45ae269950
storage: Use XMLBuilder for pool enumerate parsing
...
And kill the parse_node_helper function, since that paradigm is dead.
2015-04-03 16:45:43 -04:00
Giuseppe Scrivano
bbb96bcaa8
clone: keep the same image format on a cross-pool clone
...
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-04-01 11:56:34 +02:00
Cole Robinson
6e2e43b178
storage: Fix some pylint on libvirt without REFLINK flag
2015-02-22 10:25:47 -05:00
Cole Robinson
271e248a41
storage: Fix test failures with reflink check
2015-02-22 10:13:27 -05:00
Chen Hanxiao
4622a0a8f8
virt-clone: introduce --reflink for btrfs COW copy
...
libvirt commit 466b29c8c3593b2dac92acad5dd8ec923c428259
introduce btrfsCloneFile() for COW copy.
This patch add support for --reflink option for virt-clone.
When specified --reflink, if src and dst images all on a btrfs
fs, we could take advantage of COW copy.
If not, error out.
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-02-07 10:18:05 +08:00
Cole Robinson
9ae3dbe05b
virt-install: Fix --disk pool=NETPOOL,size=... creation
2014-12-10 13:22:42 -05:00
Cole Robinson
626295a036
storage: Remove unused function
2014-12-09 17:42:01 -05:00
Cole Robinson
e61311fc8a
storage: More support for network pools
...
Including parsing multiple hosts, filling reasonably defaults, making
sure the createpool wizard does the correct thing, etc.
2014-12-09 16:12: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
ba05e1cd43
diskbackend: Drop all pool source matching
...
It's only used to try and determine if a path actually exists, however
in the pool source case there isn't much we can actually do with that
info.
2014-12-04 20:10:37 -05:00
Cole Robinson
eb7612356e
virtinst: Switch to relative imports, fix cyclic import warnings
2014-09-12 16:28:38 -04:00
Cole Robinson
3064f4058d
diskbackend: Simplify pool source lookup
...
Have it share logic with a similar routine
2014-09-12 16:28:38 -04:00
Chen Hanxiao
5f3ede96de
storage: fix a typo
...
s/paramaters/parameters
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-07-28 16:55:28 +08:00
Chen Hanxiao
ddd88dac25
storage: fix another comment typo
...
s/explictly/explicitly
Thanks for Giuseppe's reminding.
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-06-30 16:20:38 +08:00
Cole Robinson
ceab99cf7b
virtconv: Don't create default pool when in dry mode
...
We will still need to create pools to probe source storage if doing
--print-xml.
2014-05-31 16:30:00 -04:00
Giuseppe Scrivano
7a1ffff927
storage: add support for gluster fs pools.
...
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-02-12 15:46:25 +01:00
Giuseppe Scrivano
a2706e9258
storage: add new attribute "source_dir"
...
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-02-12 15:46:25 +01:00
Giuseppe Scrivano
dd0af85d5a
storage: make "target_path" optional
...
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-02-12 15:46:25 +01:00
Cole Robinson
c5f6c6852a
VirtualDisk: Always use storage APIs for provisioning
...
This means if we are passed an unmanaged path, we try to create a
storage pool for the parent directory.
We skip directories like /dev where doing this might be problematic.
This makes things much friendlier to use for remote connections, and
means we can always rely on having libvirt's storage APIs to use
for format probing.
2014-02-08 19:24:14 -05:00
Cole Robinson
67743cbe31
storage: Only try lazy_refcounts with format=qcow2
2014-02-08 19:24:13 -05:00
Cole Robinson
0b4a72fd77
virt-convert: Reimplement it
...
We totally break CLI compat here, but the previous tool wasn't sustainable.
Instead, repurpose the tool as strictly converting external formats
like ovf/vmx to native libvirt XML, and launch the guest.
So we drop vmx/virt-image output, and virt-image input, and a slew of
command line options. I don't think anyone was depending on this in a
scripted fashion, so in practice I don't think anyone will care.
Add much more comprehensive unit tests while we are at it.
2014-02-07 21:16:09 -05:00
Cole Robinson
6f93d3decf
Use .qcow2 extension when creating qcow2 files
...
Seems the be the practice these days
2014-02-04 17:30:24 -05:00
Cole Robinson
cac593da8f
storage: Use qcow2 lazy_refcounts if supported
2014-02-03 15:55:20 -05:00
Cole Robinson
ffa9bb77b3
Fix some pylint
2014-01-25 15:52:34 -05:00
Cédric Bosdonnat
beab40e3b1
Share the list of all disk image formats
...
(crobinso: Fix some trailing whitespace)
2014-01-25 11:59:32 -05:00
Cole Robinson
7f66926721
Fix first time remote URL installs from virt-manager (bz 1049852)
...
On first run, the remote URL install handling creates a storage pool
for /var/lib/libvirt/boot on the remote host. After this, it clears
the VirtualConnection's object cache, so the next time all pools are
fetched, it returns an accurate list.
However that clear_cache call wasn't propagated up to virt-manager's
cache. Add a new cb to fix it.
2014-01-18 14:57:39 -05:00
Cole Robinson
70f1f8df1e
storage: Parse volume key
2013-12-05 09:17:12 -05:00
Giuseppe Scrivano
2a040ccd17
mass update: remove double spaces from comments
...
Updated by this script:
find -name '*.py' -exec sed -i "s|^\(#.*[^.?\!]\) \(.*[^#]\)$|\1 \2|g" \{\} \;
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-28 17:22:31 +01:00
Cole Robinson
56b9f6187b
Streamline support checks
...
Just use one function check_support
2013-10-06 10:08:04 -04:00
Cole Robinson
98187eb4b7
util: Fix generate_name start_num logic
...
We would start at start_num+1 which was confusing, fix it to do
the right thing.
2013-10-05 10:22:27 -04:00
Cole Robinson
37350859ce
storage: Use qcow2 metadata preallocation if supported
2013-10-01 14:29:58 -04:00
Cole Robinson
34c502560f
storage: Drop unused static function
...
This allows us to simplify the parameters for find_free_name
2013-09-30 16:22:12 -04:00
Cole Robinson
74e8fff069
clone: Fix a few misc issues
2013-09-29 11:31:03 -04:00
Cole Robinson
a9a085340b
support: Rename SUPPORT_STORAGE to SUPPORT_POOL
...
It's more accurate. And fix up comments about back compat which no
longer apply.
2013-09-29 09:21:42 -04:00
Cole Robinson
7a5dc7c544
devicedisk: path_in_use_by: Check backing stores as well
...
Plumb through a fetch_all_vols helper for this, and do all the
caching bits.
2013-09-28 21:07:18 -04:00
Cole Robinson
bc34df1dc7
storage: Parse volume backingstore
2013-09-28 19:21:58 -04:00
Cole Robinson
166414dd57
storage: Add VDI to format list
2013-09-27 13:22:40 -04:00
Cole Robinson
9ec845af03
xmlbuilder: Unify make_xpath callbacks
2013-09-24 09:25:05 -04:00
Cole Robinson
a6d92c7001
Drop a lot of usage of utility XML functions
2013-09-22 17:34:53 -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
952708f509
virtinst: Rename most files to be more sensible
...
- Lower case everything
- Virtual... -> device...
- A few other similar bits
2013-08-09 08:54:39 -04:00