Commit Graph

6121 Commits

Author SHA1 Message Date
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
Cole Robinson
eb85f8a887 cli: Centralize argcomplete completer hackery
This way it will be harder to miss a class when we add more commandlines
in the future
2018-12-18 15:39:08 -05:00
Cole Robinson
b68656329d tests: Add argcomplete testing 2018-12-18 15:39:08 -05:00
Cole Robinson
705107bbb0 spec: install bashcompletion files 2018-12-18 14:23:01 -05:00
Cole Robinson
73f07c54ee setup: Generate bashcompletion files in builddir 2018-12-18 14:23:01 -05:00
Lin Ma
a2850f345b setup.py: Install the bash completion files
Signed-off-by: Lin Ma <lma@suse.com>
2018-12-18 11:20:35 -05:00
Lin Ma
ce0cad96ac Bash completion template
The most of content of this file comes from the output of the command '
register-python-argcomplete $MY-SCRIPT', plus some changes.
For the details about argcomplete, Please refer to
https://pypi.org/project/argcomplete/ or
https://github.com/kislyuk/argcomplete

With this patchset, Users can use completion in bash.
ex:

$ virt-xml --<TAB><TAB>
$ virt-install --disk <TAB><TAB>
$ virt-install --panic model=isa,<TAB><TAB>
$ virt-install --controller model=virtio-scsi,ty<TAB><TAB>

Signed-off-by: Lin Ma <lma@suse.com>
2018-12-18 11:20:35 -05:00
Lin Ma
2d38e22943 cli: Add auto complete support about sub options
With this patchset, the sub options completion is available. ex:

$ virt-install --disk <TAB><TAB>
...
bus=    cache=      format=     path=   serial=     size=
...

$ virt-install --disk path=test.qcow2,cache=none,<TAB><TAB>
...
bus=    format=     serial=     size=
...

$ virt-install --disk bu<TAB><TAB>
Then the sub option 'bus' will be auto completed with a '='
$ virt-install --disk bus=

Signed-off-by: Lin Ma <lma@suse.com>
2018-12-18 11:20:35 -05:00
Lin Ma
e7e6f873cc virt-convert: Add auto complete support for the general options
Signed-off-by: Lin Ma <lma@suse.com>
2018-12-18 11:20:35 -05:00
Lin Ma
4b09a26578 virt-xml: Add auto complete support for the general options
Signed-off-by: Lin Ma <lma@suse.com>
2018-12-18 11:20:35 -05:00
Lin Ma
38f375cf27 virt-clone: Add auto complete support for the general options
Signed-off-by: Lin Ma <lma@suse.com>
2018-12-18 11:20:35 -05:00
Lin Ma
f6076a0eb0 virt-install: Add auto complete support for the general options
With this patchset, the general options completion is available. ex:

$ virt-install -<TAB><TAB>
...
--arch      --check     --cpu       --dry-run   -h
--autostart --clock     --cputune   --events    --help
...

$ virt-install --a<TAB><TAB>
--arch       --autostart

Signed-off-by: Lin Ma <lma@suse.com>
2018-12-18 11:20:35 -05:00
Lin Ma
d68f0f8867 cli: Add the generic completer function and validator function
The patch adds the generic completer and validator, Further patches use
them as completer/validator. The completer won't add already specified
options to the list.

Signed-off-by: Lin Ma <lma@suse.com>
2018-12-18 11:20:35 -05:00
Cole Robinson
a8d4c7cb79 cli: Fix --security baselabel=X 2018-12-17 09:06:03 -05:00
Cole Robinson
b91393e6c3 cli: s390x+graphics specified, use video=virtio (bz #1654994)
s390x doesn't support any of the PCI graphics cards

https://bugzilla.redhat.com/show_bug.cgi?id=1654994
2018-12-13 16:39:43 -05:00
Slavomir Kaslev
0889c7c7e4 virt-manager: Fix misspelling caught by codespell
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
2018-12-10 10:43:55 +08:00
Fabiano Fidêncio
ee0ac5f2c7 osdict: adapt latest_os_version() to ignore "-unknown" distros
As some enterprise distros adopted the "unknown" approach in osinfo-db,
and those usually support different versions at the same time, there may
be different "unknown" entries (like rhel-unknown, rhel-8-unknown,
rhel-7-unknown, and so on) for the very same distro.

This situation can easily happen when some ISO matches, for exmaple,
"rhel-unknown" and then the latest one selected would be
"rhel-8-unknown".

In order to avoid this situation from happening, let's just ignore the
"unknown" entries when calling latest_regex().

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2018-12-05 15:04:59 +01:00
Fabiano Fidêncio
fbcea0b63c osdict: adapt latest_regex() to openSUSE's versioning
Due to OpenSUSE's decision of versioning their OS as 11.x, 12.x, 42.x,
15.x, we have to add a specific check in latest_regex() in order to make
sure we skip the 42.x series in the sorted list of OSes when returning
the OS name to the user.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2018-12-05 15:04:59 +01:00
Fabiano Fidêncio
7612c5bdcd osdict: expand the "unknown" check for any distro
Currently osinfo-db has "unknown" entries for fedora, opensuse and
asianux. Considering this list may grow even more at some point, let's
just make the check more generic and use it for all of them instead of
keeping it for fedora only.

Changes have also been done in urldetect and tests_url, as those also
used latest_fedora_version().

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2018-12-05 15:04:59 +01:00
Miro Hrončok
5f5b49f289 https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_2 2018-11-15 13:28:45 -05:00
kalebskeithley
c30b3bc611 Update create.py
100 is a bit too short for managing/creating vms over the corporate VPN. About half the time it times out and I have to exit the virtmgr app and restart it to see the new vm.
2018-11-15 12:05:36 -05:00
Lukáš Doktor
30b7c33c6d virt-install: Fix guest-os deprecation msg
Arguments to logging needs to be individual args, otherwise it
fails with "not enough arguments for format string"                             

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
2018-11-14 18:25:06 +01:00
Andrea Bolognani
d2d103a334 virt-xml: Start using --os-variant
The option only works with --add-device for the time being,
so we prevent its use in all other cases.

It would be nice to have it work with --build-xml too, but
in that case the user would have to provide some extra
information that in the case of --add-device we can figure
out from the existing guest, and it's not entirely clear
whether that would even be that useful, so for now we're
not considering that case at all.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-11-13 12:15:50 +01:00
Andrea Bolognani
b882dbde9c tests: Add some tests for virt-xml with KVM
We're mostly interested in how the default bus/model for
devices are influenced by knowledge about the guest OS, but
since the whole thing requires to be connected to the QEMU
driver we might as well create a new category and leave room
for more QEMU-specific tests being added down the line.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-11-13 12:11:09 +01:00
Andrea Bolognani
ade53764fc virt-xml: Accept --os-variant option
We're not doing anything with it yet, but having the
parser accept it means we can write tests and see how
their output changes once we wire it up in earnest.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-11-13 12:08:46 +01:00
Andrea Bolognani
751fb88c58 virt-install: Add "Guest OS" options group
The --os-variant option doesn't quite fit perfectly into
its current "Installation method" group, plus we want to
add the same option to virt-xml which can't have that
group for obvious reasons.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-11-12 16:15:33 +01:00
Andrea Bolognani
a550a95727 virt-install: Fix description for --os-variant
Since we're messing with it either way, might as well use
modern OS names as examples.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-11-12 16:15:33 +01:00
Radostin Stoyanov
f53e5b024d progress: Remove commented out code
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-11-12 08:34:55 -05:00
Radostin Stoyanov
45d76ccadd progress: Resolve protected-access
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-11-12 08:34:55 -05:00
Radostin Stoyanov
0505f2be3d progress: Resolve E226
E226: missing whitespace around arithmetic operator

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-11-12 08:34:55 -05:00
Radostin Stoyanov
48255ea584 progress: Don't use black-listed name 'bar'
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-11-12 08:34:55 -05:00
Radostin Stoyanov
6a66d8cce0 progress: Resolve E502
E502: the backslash is redundant between brackets

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-11-12 08:34:55 -05:00
Radostin Stoyanov
5e6b73d439 progress: Resolve E501 and E305
E501: line too long (82 > 79 characters)
E305: expected 2 blank lines after end of function or class

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-11-12 08:34:55 -05:00
Radostin Stoyanov
e7a3a55f2d progress: Resolve E231
E231: missing whitespace after ‘,’, ‘;’, or ‘:’

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-11-12 08:34:55 -05:00
Radostin Stoyanov
a7254aa006 progress: Resolve E129
E129: visually indented line with same indent as next logical line

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-11-12 08:34:55 -05:00
Radostin Stoyanov
19b3d2ac66 progress: Resolve E714
E714: test for object identity should be ‘is not’

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-11-12 08:34:55 -05:00
Radostin Stoyanov
6d125cca72 progress: Resolve E265
E265: block comment should start with ‘# ‘

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-11-12 08:34:55 -05:00
Radostin Stoyanov
3468a2ec1f progress: Resolve E722
E722: do not use bare except, specify exception instead

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-11-12 08:34:55 -05:00
Radostin Stoyanov
c3453422f2 progress: Resolve E261
E261: at least two spaces before inline comment

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-11-12 08:34:55 -05:00
Radostin Stoyanov
cd1a46c2ae progress: Resolve E701
E701: multiple statements on one line (colon)

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-11-12 08:34:55 -05:00
Radostin Stoyanov
9a472f506d progress: Resolve E221
E221: multiple spaces before operator

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-11-12 08:34:55 -05:00
Radostin Stoyanov
ed98a29dda progress: Resolve E302
E302: expected 2 blank lines

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-11-12 08:34:55 -05:00
Radostin Stoyanov
b7c7c27f7c progress: Resolve W0201
W0201: Attribute %r defined outside __init__

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-11-12 08:34:55 -05:00