David H. Gutteridge
4a58a689db
virt-xml: Warn when --update is inapplicable
2018-04-03 12:34:55 -04:00
Cole Robinson
45c7a0657f
urlfetcher: Simplify urllib import
2018-04-03 11:38:37 -04:00
Cole Robinson
12996dd458
domcapabilities: Document class layout a bit
...
It's a bit weird due to the repetitive nature of domainCapabilities
XML layout
2018-04-03 11:07:18 -04:00
Cole Robinson
07489a900e
tests: Remove __main__ handling, not needed
2018-04-03 10:59:00 -04:00
Charles Arnold
fd6a815440
virtinst: compare host and domain cpu models
...
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)
2018-04-03 10:57:49 -04:00
Charles Arnold
d15b78ab0d
virtinst: read CPU model from domain capabilities
...
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)
2018-04-03 10:57:15 -04:00
Cole Robinson
76c40d6f97
urldetect: Track SUSE regexs in their Distro classes
2018-04-02 18:46:24 -04:00
Cole Robinson
467425fad1
urldetect: Move SUSE content file handling into its own class
...
Try to untangle the interdependencies and not recalculate everything
for every suse distro
2018-04-02 18:33:07 -04:00
Cole Robinson
fb1b26c081
urldetect: Drop RedHatDistro baseclass
...
Just fold the minimal logic into GenericTreeinfo, since only
RH distros use treeinfo so it's basically the same thing
2018-04-02 17:18:17 -04:00
Cole Robinson
eafdaf8b48
tests: test_urls: Add urldetect kernel arg validation
2018-04-02 17:15:05 -04:00
Cole Robinson
fb9b82e02d
urldetect: Clean up Fedora version checking a bit
2018-04-02 16:47:21 -04:00
Cole Robinson
1269b549c4
tests: test_urls: Enable f28 development test
2018-03-29 19:45:33 -04:00
Cole Robinson
a712549b2b
tests: test_urls: Use https for debian-daily
...
It converts to http to https but that takes time, so fix it
2018-03-29 19:45:33 -04:00
Cole Robinson
ad13c57dc5
urlfetch: Formalize the failed hostname check
...
This heuristic is only valid for http connections, everything
else will fail way earlier in the process
2018-03-29 19:45:33 -04:00
Cole Robinson
70820790ec
urlfetcher: Use persistent HTTP session
...
This shaves 20 seconds off the URL test suite, so probably helps
regular users too :)
2018-03-29 19:45:33 -04:00
Cole Robinson
5055d7bd19
urlfetcher: Clean up RHEL version parsing/handling
...
Drop SLDistro entirely because it adds nothing, just make it an
alias of Centos. Drop some old RHEL version logic. Tweak test cases
2018-03-29 19:45:33 -04:00
Cole Robinson
9dccd5d52d
urlfetch: Add caching layer
...
Add an external caching layer that handles tracking all data we
need as part of distro URL detection that is also needed during
distro __init__. This way we can make is_valid() static and quick,
and move all the variant hackery cleary into __init__ routines.
This makes the code logic much easier to follow
2018-03-29 19:45:33 -04:00
Cole Robinson
b9e72b8609
urldetect: Move treeinfo media checking into Treeinfo class
...
Rather than in the base Distro class. Simplifies things a bit
2018-03-29 16:23:57 -04:00
Cole Robinson
7dacc8502e
urldetect: Move distro checking out of isValidStore
...
We have a big mix of Distro state checking across __init__,
extrnal treeinfo/content scraping, and isValidStore(). This removes
the latter category
2018-03-29 16:23:57 -04:00
Cole Robinson
54066e1315
urldetect: Drop ubuntu _is_tree_iso
...
It's not wired up to anything which looks like it got dropped in
an older refactoring. I can't find from the mailing list what
media case this was required for, and my local test suite doesn't
need it, so it might not even be required anymore.
2018-03-29 16:23:57 -04:00
Cole Robinson
1f8b712508
urldetect: Remove the _xen_kernel_paths distinction
...
Just have one kernel path list, and if type=="xen" and we think
xen might have its own kernel path, prepend that to the list of
pairs to check.
Nowadays xen kernel == hvm kernel for new distros, so we shouldn't
force having a specific xen whitelist
2018-03-29 16:23:57 -04:00
Cole Robinson
fddb1de0f4
urldetect: s/name/PRETTY_NAME/g
...
And use class name in logging instead of the pretty name
2018-03-29 16:23:57 -04:00
Cole Robinson
5aedc0aff7
urldetect: Drop GenericDistro, non-treeinfo redhat bits
...
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
2018-03-29 16:23:57 -04:00
Cole Robinson
a8522032eb
virtinst: Split out urldetect.py from urlfetcher.py
...
urldetect.py has all the distro metadata and parsing logic,
urlfetcher.py has the http/ftp/iso/etc. fetching logic
2018-03-28 18:46:07 -04:00
Cole Robinson
6e2e18ccf8
urlfetcher: Split up SUSE content parsing a bit
...
Add comments for what each parsed line actually looks like
2018-03-28 17:58:11 -04:00
Cole Robinson
35df66c1ed
tests: test_urls: Make fedora distro checking a bit smarter
...
Rather than constantly require updating distro values for latest
Fedora when osinfo-db catches up, build some smarts into the
test suite
2018-03-28 14:56:52 -04:00
Cole Robinson
74f2fb73fd
tests: test_urls: Rename distroobj->testdata
...
Makes it much more clear what it is
2018-03-28 14:40:41 -04:00
Cole Robinson
01b665a6c3
urlfetcher: Throw error if iso _grabber file doesn't exist
...
isoinfo won't error here at least for me on Fedora 28, so
use hasFile to confirm
2018-03-28 14:02:23 -04:00
Cole Robinson
46ec093a28
virt-xml: Make it more clear when changes take effect
...
shutdown could be interpreted as a soft reboot, which won't
apply the changes
2018-03-25 19:22:28 -04:00
Cole Robinson
bd891eb380
virtcli: Add python3 version check
...
Assume 3.4 is needed, we may support earlier but I doubt anyone
is going to get all the deps in place on a distro that old
2018-03-21 18:00:38 -04:00
Cole Robinson
d692b6d51e
spec: Document the explicit dconf dep
2018-03-21 17:10:30 -04:00
Cole Robinson
60888fb7f5
spec: Drop dbus-x11 dep
...
This came from: https://bugzilla.redhat.com/show_bug.cgi?id=1039803
Seems dconf and gconf before it would use dbus-libs which would
in turn try to use dbus-launch from dbus-x11. They didn't have
a dep on dbus-x11 for *reasons*
Nowadays dconf and virt-manager both use gdbus which is a native
dbus implementation and does not use dbus-launch or have any hard
dependency on x11 AFAICT, so this dep is not required.
2018-03-21 17:02:06 -04:00
Cole Robinson
8bca2526ab
spec: Drop gnome-icon-theme dep
...
We don't build for rhel7 anymore, and modern gnome stack has
proper deps on adwaita-icon-theme nowadays
2018-03-21 16:49:00 -04:00
Cole Robinson
b238718347
tests: uitests: Omit /usr for coverage
...
like we do for regular test suite coverage
2018-03-21 16:25:07 -04:00
Cole Robinson
eee1caa946
domain: Drop most device list wrappers
...
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
2018-03-21 16:10:45 -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
5b111b3d9f
guest: Move get_all_devices to devices.get_all
2018-03-21 12:59:46 -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
3e176f2aa4
xmlbuilder: Remove relative_xpath substitution support
...
This only has one user in interface.py. That case is indeed weird
but we can implement it there, rather than in generic code
2018-03-21 11:17:36 -04:00
Cole Robinson
538ea96116
guest: devices: change XML ordering to match libvirt
2018-03-21 11:17:36 -04:00
Cole Robinson
b7f6e4990e
xmlbuilder: Use OrderedDict for propstore
...
Let's us drop proporder
2018-03-21 11:17:36 -04:00
Cole Robinson
8d0b1f80f1
cli: Have parser classes reference property names, not xmlbuilders
...
propertys already give us ways to access the backing class, and
switching to this method lets us drop some infrastructure in
xmlbuilder
2018-03-21 11:17:36 -04:00
Cole Robinson
256f0df8c2
xmlbuilder: Drop s/child_classes/child_class/
...
The only user was Guest._devices hackery, which has been dropped,
so clean up all this stuff
2018-03-21 11:17:36 -04:00
Cole Robinson
3b88bfb1ee
cli: Drop clear_attr property
...
It slightly complicates the generic machinery, and the one usage we
can handle directly
2018-03-21 11:17:36 -04:00
Cole Robinson
f69b823fad
devices: Switch to normal _XML_PROP_ORDER
...
Drop the register_device stuff, rename virtual_device_type
2018-03-21 11:17:36 -04:00
Cole Robinson
7b61c45d3b
guest: Move all_devices to guest.devices.X
...
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
2018-03-21 11:17:36 -04:00
Cole Robinson
fe9ed2340c
virtinst: move <domain> XML files to virtinst/domain
...
And give the classes consistent naming
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
3909c10441
virtinst: Move all devices to virtinst/devices/
2018-03-21 07:29:40 -04:00
Cole Robinson
1c911ce567
virtinst: Give device classes consistent DeviceX naming
...
Previous state was inconsistenty and needlessly wordy. Fix up
a few other class namings that have redundant Virtual in the name
2018-03-21 07:29:40 -04:00