Commit Graph

28 Commits

Author SHA1 Message Date
Pavel Hrdina 986097d5f8 cloner: don't fail to clone VM if nvram file doesn't exist
If a VM is defined and never started the nvram file might not exist and
in that case it's created by libvirt automatically on the first start.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-03-28 16:07:13 +01: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
Pavel Hrdina 931936a328 virtinst: Remove only auto-generated channel source path
In attempt to fix https://bugzilla.redhat.com/show_bug.cgi?id=1270696
this code was introduced but it removes the path for all channel
devices.  We need to limit it only to the devices that have
auto-generated source path.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-06-28 16:45:14 +02:00
Cole Robinson e0e6ac6956 tests: Remove useless read_file helper 2018-06-12 14:07:50 -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 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 6954c6774a tests: Fix running testsuite on older libvirt
If we try to run the testsuite on anything older than libvirt 3.1,
it immediately throws an exception before processing any tests,
due to choking on parsing drm bits from testdriver.xml. This global
failure is only due to sloppy coding though.

Turn all test cases that use testdriver.xml into skips in this case,
so we can at least get some test coverage otherwise.
2018-02-22 16:01:24 -05:00
Cole Robinson 8ee2f62efe tests: Simplify clonetest.py 2018-02-22 15:18:41 -05:00
Pavel Hrdina 8e0303059e cloner: get original XML with security informations
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1455491

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-18 09:04:35 +02: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 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 e241f4c957 tests: Open a new connection for each test
To ensure we are testing each time from a clean state. Isn't causing
obvious issues in practice at the moment but it may with future
changes
2017-07-20 17:27:22 -04:00
Cole Robinson d3074141c8 cloner: Remove redundant setup() method
The functional callers use the individual setup methods, let's drop the
helper function and adjust the test suite
2017-07-20 17:27:22 -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
Pavel Hrdina 5e2b63c1ff virt-clone: add support to clone nvram VARS
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1243335

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-03-07 13:06:20 +01:00
Giuseppe Scrivano f5a13510eb clone: do not use a '/' separator when using a disk file under /
It avoids file names like //foo.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-06-06 00:00:40 +02:00
Giuseppe Scrivano 3ff34c79e2 tests: check that clone keeps the same image format for disks
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-04-02 10:04:58 +02:00
Cole Robinson cf0206a58c devicedisk: Break apart set_create_storage
And break about the vol_install vs local clone storage creators. And
just generally delete a lot of code. The commit aint pretty but it works
and deletes a ton of hacks
2014-12-05 23:28:53 -05: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
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
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
Giuseppe Scrivano 4f63458050 tests: move the storage pool under /dev.
The commit efab27afbf02743a3a2582e9a111eb1b7d985b26 in libvirt uses
/dev/%s for logical pools, change the tests to accommodate it.

(crobinso: additional fix to work with older libvirt)
2013-07-29 10:01:18 -04:00
Cole Robinson 4ce1774d53 VirtualDisk: Rework provisioning and validation behavior
We separate all the provisioning bits to diskbackend.py. VirtualDisk
users now need to explicitly opt in to storage creation by using
set_create_storage().

validation is no longer done automatically, users must call the
validation() command.

__init__ drops all extra parameters.

This will eventually get us to a point where we can unify the manual
XML building and XML parsing machinery, and get consistent validation
behavior between devices.
2013-07-13 16:37:33 -04:00
Cole Robinson 802ed1cba6 clone: Bunch of API cleanup
Simplify imports, drop back compat stuff, drop needless property handling.
2013-07-02 18:54:03 -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 c5e45ae448 Remove all relative imports
We also drop VirtualDevice from the 'public' virtinst API, since there
are better ways to get its info.
2013-04-12 08:27:44 -04:00
Cole Robinson 88603e4fad Merge code from python-virtinst.git
As outlined here:

https://www.redhat.com/archives/virt-tools-list/2012-February/msg00040.html

For now this is just a direct import of the code from virtinst commit
dca5a4d6245f21d554f8853197a6a234bfc8e52c. History is not merged, so
please refer to original git for detailed commit histor:

http://git.fedorahosted.org/cgit/python-virtinst.git/
2013-04-03 18:22:05 -04:00