An emulated backend doesn't require any path, since libvirt will take
care of finding the emulator and managing the storage. However, the
version to emulate can be specified.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Add codec support to virt-install so that it can accommodate
multiple instances of codec configuration.
The commandline argument:
--sound codec0.type=micro,codec1.type=duplex,codec2.type=output
maps to the sound XML below:
<sound model="es1370">
<codec type="micro"/>
<codec type="duplex"/>
<codec type="output"/>
</sound>
Signed-off-by: Anya Harter <aharter@redhat.com>
Codespell is a tool for checking misspelled words in source code [1].
Integrating this tool will enable automated spell check of the code
base.
Usage example:
./setup.py codespell
[1] https://github.com/codespell-project/codespell
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
This type of validation should really be done at the libvirt level,
particularly for a non-mandatory feature like cpuset. Otherwise
it's just more code for us to test which will rarely be hit by users
The current OS distro selection UI is fairly cumbersome to use. First
you need to decide on a variant, then decide a distro and then look for
the version you want. The list is filtered by default so only a subset
of OS are displayed. So for less common distros you'll then need to
start again and tell it to show all OS to try to find the one you want.
The core problem is that we have an incredibly large list and want to
make it easy for the user to find a specific entry. The modern UI
paradigm for this problem is to provide interactive search with
live updated results. The current UI does provide an interactive search
facility on the OS version results, but you still have to first select a
variant to be able to use the search which is unhelpful.
This patch attempts to better apply the search UI design to the OS selection
problem. We get rid of the notion of variants, distros and version, and
provide a single text entry box in which the user can type a few letters
of the OS name. As they type, a popover displays the matching results
filtered on OS name. By default end of life OS will be hidden, so in
general there will only be a small handful of results left after just
typing a few characters. This makes it very quick to find and select the
desired OS, without needing to provide a mutli-step navigation hierarchy.
https://bugzilla.redhat.com/show_bug.cgi?id=1464306
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(crobinso: fix some pylint)
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>
Lookup the domain capabilities CPU model and compare with
the host capabilities CPU model and if they are not equal
set the guest's CPU model to None.
(crobinso: compare against 'custom' list not 'host-model', move
to separate function)
Add functionality to acquire the CPU model from the
libvirt domain capabilities. This is used to compare
with the host CPU model.
(crobinso: add test coverage, rework domcaps layout a bit)
non-treeinfo redhat only applies to pre RHEL5.4 and very old
Fedora. It's not worth it anymore to slow down all URL lookups
and maintain code complexity to handle such long out of date
distros.
GenericDistro doesn't actually apply to any public trees that I
can find, except for some with TreeInfo. So turn it into
GenericTreeinfoDistro. If random URL trees want to work with
virt-install, add a treeinfo file
There's lots of hacks stuffed into the domain device lists. Formalize
some of it, move some of the specific stuff to details.py, and drop
a lot of the needless API wrappers
The way we enumerate devices doesn't conform with the way all
other XMLBuilder instances expose child objects. Move more towards
that direction.
This requires some virt-xml and cli.py hacks but we will remove those
in future patches
Kind of a big mess but it was difficult to untangle piecemeal.
Basically this drops nearly all the centralized window tracking
in engine.py and moves it to each UI class. If manager.py wants
to open a details window it does it directly, and vmmDetails tracks
the window object list itself. This simplifies things and makes
the code easier to follow.
There's still some weirdness with vmmConnect and connection callbacks,
but future patches will break those apart.
Using these for long term TODO type items is not effective, however
it's nice to label things as FIXME during a coding session and have
pylint warn you about them before pushing.
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>
A new Python checker was added to warn about "inconsistent return
statements" [1]. A function or a method has inconsistent return
statements if it returns both explicit and implicit values.
[1] https://pylint.readthedocs.io/en/latest/whatsnew/1.8.html
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
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.
Right now, most test cases will create a libvirt test driver using
tests/testdriver.xml. This is problematic for 2 reasons:
1) testdriver.xml is 3500 lines of XML, and it's parsed hundreds of
times. Opening it is responsible for about 25% of test suite time
2) Older libvirt chokes on testdriver.xml, meaning the test suite will
be useless there. This is a recurring problem as new features are
added to testdriver.xml
Most test cases don't actually need all the test state in testdriver.xml
though. So this creates a smaller testsuite.xml which has a lower
libvirt requirement and is much quicker to parse. New XML bits should
continue to go into testdriver.xml so we can keep testsuite.xml as
the more stripped down option.
Moves the libxml2 bits to a separate xmlapi file and class, a bunch
of cleanups to xmlbuilder internals dealing with XML stuff.
The main point is to experiment with different XML library impls,
since libxml2 is unfun to deal with and we are having python3
issues like
https://bugzilla.gnome.org/show_bug.cgi?id=776815
Could mean a code error but more likely is just slightly racy
UI bits disappearing that we weren't looking for anyways, so hide
it behind a debug statement
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()
Add vcpupin support to virt-install so that it can create guest
domains with statically allocated vcpu pinning towards a given cpuset.
Syntax: to pin vcpu=0 to cpuset="1,3" and vcpu=1 to cpuset=2
--cputune vcpupin0.vcpu=0,vcpupin0.cpuset=1,3,vcpupin1.vcpu=1,vcpupin1.cpuset=2
generates below XML description for the guest domain.
<cputune>
<vcpupin vcpu="0" cpuset="1,3"/>
<vcpupin vcpu="1" cpuset="2"/>
</cputune>
Signed-off-by: Wim ten Have <wim.ten.have@oracle.com>
Signed-off-by: Menno Lageman <menno.lageman@oracle.com>