6163 Commits

Author SHA1 Message Date
Cole Robinson
e79143f3a6 setup.cfg: Drop unicode, it upsets CI 2019-01-30 18:01:20 -05:00
Cole Robinson
a9f818b44b pycodestyle: Only use format=pylint from setup.py
Don't force it on users who are running the tool manually
2019-01-30 17:25:14 -05:00
Cole Robinson
8502b84dbd Move tests.pycodestyle.cfg to setup.cfg
This makes manual pycodestyle calls pick up our project config
2019-01-30 17:25:14 -05:00
Cole Robinson
90603cdc6e Move tests/pylint.cfg to pylintrc
This makes manual pylint calls pick up our project config
2019-01-30 17:25:14 -05:00
Ken Dreyer
fe2564530a doc: update Fedora versions
Fedora 20 and 25 are end-of-life. Update to a modern Fedora version.
2019-01-29 10:37:59 -05:00
Pavel Hrdina
943b2a400e details: allow to remove video device if it's not the last one
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1659354

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-01-28 17:55:38 +01:00
Cole Robinson
9b2e6886d0 disk: Fix virt-xml --add-device --disk size=X 2019-01-22 10:32:23 -05:00
Christian Borntraeger
c82042245b virt-install: fix SLES11 installation on s390x
self._os_variant returns sles11sp4 sles11sp3 and so on.
Lets match those as well to pickup the right kernels.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-21 15:41:24 -05:00
Kenyon Ralph
957815397d virt-install.pod: make example command match commentary
The example commentary says Fedora 20, so make the command line match that.
2019-01-21 16:01:02 +01:00
Lin Ma
eadb5b6193 vsockdetails: Show CID for active VM if the attribute auto is set to yes
Signed-off-by: Lin Ma <lma@suse.com>
2019-01-21 13:49:56 +01:00
Slavomir Kaslev
63db4de0b5 Remove Author lines from files
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
2019-01-15 13:55:53 -05:00
Pavel Hrdina
ad77f4fe83 createnet: fix typo introduced by commit dae8642bb
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-01-15 15:55:44 +01:00
Pavel Hrdina
14033113a4 cli: fix typos in virt-install --help output
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1533015

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-01-15 14:47:01 +01:00
Lin Ma
bbe4866127 cli: Add function cli_flag_name and use it
It can convert the underscore to minus for cli_arg_name in help
output or error message.

Signed-off-by: Lin Ma <lma@suse.com>
2019-01-14 10:40:54 -05:00
Cole Robinson
7228867480 diskbackend: Fix backtrace cloning with block storage (bz #1661986)
https://bugzilla.redhat.com/show_bug.cgi?id=1661986
2019-01-10 12:58:43 -05:00
Marc Hartmayer
a7ee1b3801 cli: Fix __init_class__
For Python versions < 3.6 it's not possible for the metaclass to call
a method in the defined class that uses super() before it is done with
its __new__ and __init__. Therefore let's workaround this by using
hard coded class names instead of super() in __init_class__. See
https://stackoverflow.com/a/28605694 for more details.

In addition, add missing __init_class__ call to the __init_class__
implementation of _ParserChar.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
2019-01-09 10:04:14 -05:00
Cole Robinson
069653b744 osdict: Drop -unknown mapping for ISO media detection
This was originally added for fedora to give better names in the UI,
but that's a loose reasoning IMO. The pattern was extended to
other -unknown distros but instead of maintaining that going
forward I'd rather just remove the magic for it.
2019-01-08 16:02:34 -05:00
Cole Robinson
c38be50dcb urldetect: Use fedora-unknown more
Instead of the magic to look up latest OS... fedora-unknown is meant
for that usecase.
2019-01-08 16:02:34 -05:00
Cole Robinson
5d287bc2ae test_urls: Disable Fedora dev test, currently invalid 2019-01-08 13:53:35 -05:00
Cole Robinson
6c28f53590 cli; Share --os-variant option registering
And improve the help message for both users
2019-01-08 12:44:53 -05:00
Cole Robinson
2a88d3a1af tests: clitest: Slim down virt-xml --os-variant tests
There's some redundancy here, and let's not depend on test-many-devices
which causes a lot of test suite churn
2019-01-08 12:24:50 -05:00
Cole Robinson
91dd6739c6 uitests: Cover vsock UI 2019-01-08 12:08:56 -05:00
Cole Robinson
0d3babe42b cli: Improve 'Unknown options' error
By mentioning the offending command line option, ex:

$ ./virt-install --boot disk
ERROR    Unknown --boot options: ['disk']
2019-01-08 11:50:36 -05: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
d5d4a87723 about: copyright year is 2019 2019-01-08 11:33:58 -05:00
Povilas Kanapickas
23c489e220 console: Extract fullscreen exit code to separate class
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2019-01-07 18:12:29 -05:00
Marc Hartmayer
50633d3329 domain: add docstring for _convert_old_boot_order
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 15:46:01 -05:00
Marc Hartmayer
bf62001cfd domain: use else/elif since the conditions are mutually exclusive
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 15:46:01 -05:00
Marc Hartmayer
a5f5072b01 domain: remove indirection
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 15:46:01 -05:00
Marc Hartmayer
29bfe2c682 domain: convert _change_boot_order to a instance method
This avoids the access of non-local variables of the closure.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 15:46:01 -05:00
Marc Hartmayer
c9d63546a3 netlist: use NamedTuple for storing a network device
This has the advantage that we can access the attributes by name and
it's immutable by design.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 15:46:01 -05:00
Marc Hartmayer
0df18e29aa cli: refactor noset_cb
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 15:46:01 -05:00
Marc Hartmayer
976a03c264 cli: don't use monkey patching
Instead we provide a meta class that can be used to customize the
subclass creation. It's similar to '__init_subclass__' (see
https://www.python.org/dev/peps/pep-0487/).

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 15:46:01 -05:00
Marc Hartmayer
4d33cb747d cli: use Python3 conventions: super()
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 15:04:24 -05:00
Marc Hartmayer
f555d3a2be cli: rename ParseMemdev to ParserMemdev
...since it meets the common naming scheme for VirtCLIParsers.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 15:04:15 -05:00
Marc Hartmayer
a8b1b5df0e cli: add register classmethod to each parser
Add a classmethod for registering the parser to each
VirtCLIParser. This allows us to register only those parsers that were
actually needed. Before this patch, each parser was registered when
the module 'virtinst.cli' was loaded. Now the parser will only be
registered if the corresponding CLI option is added,
e.g. 'add_gfx_option(...)' or the register method is called
explicitly.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 15:01:54 -05:00
Marc Hartmayer
6e8a9cd963 cli: register a parser class only once
Make sure that a parser class can only be registered once.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 14:52:15 -05:00
Marc Hartmayer
6476a6a489 test_urls: simplify the sorting
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 14:46:00 -05:00
Marc Hartmayer
b574beb668 xmlapi: refactor node_is_text function
...since it's used at least at three places.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 14:45:53 -05:00
Fabiano Fidêncio
050acb68f1 virt-install: Default to libosnfo recommended disk size
If no disk options are passed, let's fallback to the libosinfo
recommended disk size for the OS variant.

The guest.set_capabilities_default(), build_installer() and the set of
the distro variant have been moved earlier in the code in order to fetch
the correct information from libosinfo and then set the recommended disk
size without changing much of build_guest_instance() logic.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-01-07 12:24:06 +01:00
Fabiano Fidêncio
5eb47bc00f guest: Default to libosinfo recommended resources
Let's create a new method that defaults to libosinfo's recommended
resources (when they're available) for memory and vcpus.

It'll help us to avoid erroring out whenever virt-install is called
without specifying the memory amount, as the recommended amount of
memory would come from libosinfo.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-01-07 12:24:06 +01:00
Cole Robinson
4336bdb92d cli: Fix --check completion
Make the completer functions fold in ParseCLICheck as well
2019-01-06 19:03:35 -05:00
Lin Ma
a31bf70620 .gitignore: Remove the outdated path info of bashcompletion files
Commit 73f07c5 generates the bashcompletion files in build folder, The
'/data/bash-completion' no longer exists, So remove it in .gitignore.

Signed-off-by: Lin Ma <lma@suse.com>
2019-01-06 18:40:50 -05:00
Cole Robinson
e66823a173 testdriver: Add vsock example 2019-01-06 18:27:17 -05:00
Slavomir Kaslev
021d2938af virt-manager: Add support for vsock devices to Add Hardware UI
This patch adds support for adding vsock devices to a VM.

Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
2019-01-06 18:27:17 -05:00
Slavomir Kaslev
a9092b6abe virt-manager: Add support for vsock device to Hardware Details UI
Add support for vsock devices to Hardware Details UI so that vsock devices can
be configured or removed.

Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
2019-01-06 18:27:17 -05:00
Slavomir Kaslev
2afa06c128 virt-manager: Add vsock sockets details UI
Add vsock details UI which will be shared between Hardware Details and Add
Hardware UIs.

Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
2019-01-06 18:27:17 -05:00
Slavomir Kaslev
be1b5e6ebb virtinst: Add vsock device type
VSOCK sockets allow communication between virtual machines and the host they are
running on.

This patch adds vsock device support along with clitest for the new properties.

Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
2019-01-06 18:04:26 -05:00
Cole Robinson
e103c5fa81 tests: Skip completion tests if argcomplete isn't installed 2018-12-19 11:53:14 -05:00
Cole Robinson
91c274efbb cli: Make argcomplete optional
It's only invoked when bash completion is attempted. Will make it
a bit nicer for devs to just pull down and run the code
2018-12-18 15:39:08 -05:00