Commit Graph

136 Commits

Author SHA1 Message Date
Cole Robinson
b83a1b0d0f domain: Use KEEP_TPM flag for domain rename
If the VM has implicit TPM state, use the VIR_DOMAIN_UNDEFINE_KEEP_TPM
flag to preserve that state when renaming the VM (if libvirt is new
enough).

The state is stored based on VM UUID and nothing else, and the UUID
is preserved during rename, so we don't need to do any of the same
trickery that's required for nvram duplication.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-09-19 05:48:01 +02:00
Pavel Hrdina
169db9dc5f virtinst.support: drop unused conn_hyperv_vapic function
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Cole Robinson
499badbdf4 object: nodedev: support isActive state
This was added to libvirt in the past few years, and we may want it
for mdev addhardware UI

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-17 14:37:06 -05:00
Cole Robinson
79da19ad07 Fix some pylint, exclude some new warnings
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-10-04 16:04:33 -04:00
Cole Robinson
8d5439567b uitests: finish statsmanager.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 17:50:57 -04:00
Cole Robinson
cfd6d6ead4 uitests: Finish vmmenu.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 16:24:39 -04:00
Cole Robinson
f15cdd732d graphics: Remove spice GL/rendernode version support warnings
The versions we are warning about are all over 4 years old, and
these warnings were initially just informative to help users know
when the config wasn't going to work. Drop most of it. Still warn
in the UI when a VM misconfig will prevent spice GL from working

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson
f22e060190 Always assume objects support .isActive()
All drivers that support the listAll APIs, which we depend on,
also are new enough to support isActive, so stop checking support

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:05 -04:00
Cole Robinson
aa89a48371 xmlutil: Centralize all 'programming error' exceptions
Raise them directly instead of adding the hard to read conditional
into the function

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 19:08:27 -04:00
Cole Robinson
d410773af8 virtManager: Remove virInterface polling
There are no more users of interface objects in the code. Remove
all the polling support, and all the remaining references to
interface objects throughout the code base

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson
3ad646fef1 pollhelpers: Kill old style polling
All the major hypervisor drivers have supported listAllDomains
since rhel6 vintage libvirt. Most other driver types have had the APIs
since their introduction, or for just as long.

I will be surprised if this affects anyone in any material way

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-24 17:04:18 -05:00
Cole Robinson
4147f760e8 connection: Explicitly error if domain listing APIs are not supported
This will be more important when we drop old domain polling APIs,
because it will be more likely we encounter an old libvirt or weird
connection without the expected API support

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-24 15:39:41 -05:00
Cole Robinson
ef972cf2ea virtinst: support: add full code coverage testing 2019-06-14 14:00:13 -04:00
Cole Robinson
f056798918 virtinst: Add a bunch of # pragma: no cover 2019-06-11 17:51:25 -04:00
Cole Robinson
ca10e4094b util: move is_error_nosupport to SupportCache 2019-06-07 16:49:19 -04:00
Cole Robinson
ecc3e3d34e support: add is_libvirt_error_no_domain
Repurpose the generic util.exception_is_libvirt_error for the one
purpose that it's actually used, add it as a SupportCache staticmethod,
and test it
2019-06-07 16:44:14 -04:00
Cole Robinson
566a4681a8 support: Rework support check invocations
SupportCache.check_support(SUPPORT_FOOBAR, args) becomes
SupportCache.foobar(args)

And SupportCache absorbs the caching infrastructure from
VirtinstConnection.

For now we add some hackery to hide the API change from callers, but
this will be undone in the next patch
2019-06-07 16:25:39 -04:00
Cole Robinson
3d2f678c0f support: Add a SupportCache class
For now it just contains all the SUPPORT ID numbers and public
functions.
2019-06-07 15:56:23 -04:00
Cole Robinson
85a7b2cd61 virtManager: interface: Remove unused code after UI removal
Removal all the virtManager bits that are no longer used
2019-05-13 12:08:55 -04:00
Andrea Bolognani
9bec57723e guest: Enable USB for RISC-V virt guests
Unlike other features we have enabled earlier, this one requires
version checks because RISC-V guests have only started using PCI
by default very recently, and we can't have USB without PCI.

More specifically, we need QEMU commit d6c1bd4a2237 (included
in 4.0.0) and libvirt commit 7c48fb08e0cd (included in 5.3.0).

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-04-04 18:57:39 -04:00
Pavel Hrdina
95d1275f57 domcapabilities: get list of CPU models from domcapabilities
Currently we just call libvirt API which will return all CPU models for
specific architecture known to libvirt and we offer all of them to users
in GUI.  Let's switch to domain capabilities where we have more details
about these CPUs such as whether each model is usable with current QEMU
binary.  If libvirt can detect the usability we will offer only CPU
models that QEMU can actually run.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-03-19 13:41:53 +01:00
Marc Hartmayer
ee5f3eab4b support: Add SUPPORT_CONN_DEVICE_BOOT_ORDER
...and use it in domain.py.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:34 -05:00
Cole Robinson
1856c1fa65 support: Fix minimum version check
The original code for this was about version 0.7.3, but a refactor
accidentally changed it to 0.7.9 which is a libvirt version that
doesn't exist. Fix it
2019-03-06 13:06:54 -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
edab908f42 guest: Use q35 chipset by default for new qemu + supported OS
There's been various discussions about changing the x86 default
from 'pc' to 'q35' over the years, but it's unlikely to happen
at the qemu or libvirt level for compatibility reasons. So
let's start using it for new enough OS that support it.
2018-10-13 14:58:57 -04:00
Cole Robinson
019a33e975 clock: Drop RHEL hyperv clock distinction
I think enough time has passed that we can just check the
support based on the older RHEL version.
2018-10-06 19:45:51 -04:00
Cole Robinson
40dc4b1131 support: Limit qemu-xhci check to qemu 2.9.0 2018-10-04 20:48:43 -04:00
Cole Robinson
046a242bd4 guest: Use USB3 for x86 qemu if OS supports it
Using new annotations in osinfo-db
2018-10-03 19:02:07 -04:00
Cole Robinson
fb1bb26373 support: Drop lots more checks
- Remove anything for less than qemu 0.12 or libvirt 0.10, basically
  rhel6 vintage stuff
- Open code some simple checks
- Remove some that are only used for unnecessary error reporting
2018-08-31 22:21:15 -04:00
Cole Robinson
a5ef8a2995 support: Drop a few more support checks only used in tests/ 2018-08-31 18:31:17 -04:00
Cole Robinson
967ca4eeda virtinst: Drop direct 'support' usage
Except from connection. This requires some reorg in clitest and
some minor changes in a few other places
2018-08-31 18:31:17 -04:00
Cole Robinson
c33e8abcb5 support: Remove some unused checks 2018-08-31 18:31:17 -04:00
Cole Robinson
2eaff7fdcf support: Remove getversion/getlibversion checks
They are only used in one place, just handle it there
2018-08-31 18:31:17 -04:00
Cole Robinson
d8514e19c8 guest: Drop arm vexpress virtio-mmio support
This case will still work, but be a bit slower, which is fine. Nowadays
-M virt is much better for virt usage and nearly everyone is using that,
so save us the complication. This was really only useful when
bootstrapping arm virt support
2018-08-31 17:31:09 -04:00
Cole Robinson
e59c3d969e guest: Remove old xen acpi disabling
This is only for rhel5 vintage xen which is long out of support,
so drop it
2018-08-21 16:35:34 -04:00
Cole Robinson
fd2fe1249d graphics: Default to unset keymap
qemu and all related hypervisors (xen, vz) haven't needed this in
the common case for a very long time, so make keymap=None the default
2018-04-24 14:11:30 -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
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
Marc-André Lureau
84bc80a900 virtinst/support: add SUPPORT_CONN_VMCOREINFO check
It is supported since qemu 2.11 and libvirt 3.10.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-02-22 16:23:40 -05:00
Cole Robinson
d108bbe143 Convert docstrings to standard reStructuredText param format 2018-02-14 11:08:09 -05:00
Radostin Stoyanov
978fb25ac7 Wrap keys(), values() in a list
In Python 3 dict.values() [1] , dict.keys() [2] and dict.items() [3]
return a view [4] of the dictionary’s values, keys and items.

In Python 2 these functions return a list. [5] [6] [7]

To resolve this we can convert the result of these function to a list.

[1] https://docs.python.org/3/library/stdtypes.html#dict.values
[2] https://docs.python.org/3/library/stdtypes.html#dict.keys
[3] https://docs.python.org/3/library/stdtypes.html#dict.items
[4] https://docs.python.org/3/library/stdtypes.html#dict-views
[5] https://docs.python.org/2/library/stdtypes.html#dict.items
[6] https://docs.python.org/2/library/stdtypes.html#dict.keys
[7] https://docs.python.org/2/library/stdtypes.html#dict.values
2018-02-06 18:49:17 -05:00
Pavel Hrdina
0e812e3c42 vnc: don't skip authentication for listen type none with fixed QEMU
This was fixed by commit <fa03cb7fd21> in QEMU.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-01-16 09:42:11 +01:00
Pavel Hrdina
f3f9dd6b73 virtinst.support: fix copy&paste error
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-12-18 19:18:31 +01:00
Radostin Stoyanov
a2bcd6c43a Do not compare between None and int
In Python 2 comparison between int and None is allowed but in
Pyhton 3 it is not.

Example:

Pyhton 2

    >>> None > 0
    False

Python 3

    >>> None > 0
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: '>' not supported between instances of 'NoneType' and 'int'
2017-10-20 13:18:31 -04:00
Cole Robinson
f41844f3f2 guest: Use usb3 qemu-xhci for machvirt
This is what libvirt will default to nowadays for those configs,
so let's match it.
2017-07-10 19:46:13 -04:00
Cole Robinson
f2de47cee2 guest: Add USB3 controller for machvirt by default
...if libvirt is new enough to do machvirt PCI by default. We can
just use usb3 since all guest OS that support aarch64 are new enough
to support it
2017-06-28 15:35:07 -04:00
Pavel Hrdina
24f9d05329 virt-install: add support for loader secure attribute
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-06-01 09:58:46 +02:00
Pavel Hrdina
f38c56c971 virt-install: add support for SMM feature
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-06-01 09:58:46 +02: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