Commit Graph

8547 Commits

Author SHA1 Message Date
Cole Robinson
9ad347fd76 tests: test XML generation for --disk path=file://...
Tweak the test case added in ba3a098c3b
to test XML generation instead, to make sure nothing regresses
weirdly there.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-09-06 14:54:09 -04:00
Pavel Hrdina
67206a858a tests: add more test cases to cover all code paths
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
74fd503b9e virtinst: enable most Hyper-V features by default
We will not enable hyperv_reset feature as modern Hyper-V versions don't
export it.

We also don't enable hyperv_reenlightenment as it is mostly relevant
when migrating VMs that are running Hyper-V inside and requires other
bits to work correctly.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04: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
Pavel Hrdina
9e9dbf735c domain.features: use domcapabilities when setting default Hyper-V features
We will no longer enable hyperv features based on libvirt and QEMU
versions.

Some tests don't use the kvm-x86_64-domcaps-latest so the code will now
not enable Hyper-V features. There are still other test cases that cover
Hyper-V features so instead of mangling with URI for these tests update
test data.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
66bbfa23b2 domain.features: extract setting default hyperv features
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
c279c17e6c domcapabilities: get list of supported Hyper-V features
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
bec2d7cb44 tests: update kvm-x86_64-domcaps-latest
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
139b0e285b cli: add --features hyperv.avic.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
a06d53596b cli: add --features hyperv.evmcs.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
5afc6919c9 cli: add --features hyperv.ipi.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
e3ec248cff cli: add --features hyperv.tblflush.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
c421ec1b75 cli: add --features hyperv.reenlightenment.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
2786ea5df2 cli: add --features hyperv.frequencies.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
6289a1369b cli: add --features hyperv.stimer.direct.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
1f69795b0a cli: add --features hyperv.stimer.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
d7976a883a cli: add --features hyperv.runtime.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
d2a29245cd cli: add --features hyperv.vpindex.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
1c3fb02543 test_cli: extract hyperv features to separate lines
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
ac26945c56 domain.features: reorder Hyper-V features
Follow the table from libvirt documentation [1].

[1] <https://libvirt.org/formatdomain.html#hypervisor-features>

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Cole Robinson
2da4884962 tests: Cover some weird virt-xml corner case behaviors
Examples:

`virt-xml MYVM --add-device --sound FOO1 --sound FOO2` is not rejected
and will add 2 devices.

`virt-xml MYVM --remove-device --sound opt1=FOO1 --sound opt2=FOO2`
is not rejected, only the final `--sound` option is used.

`virt-xml MYVM --edit --sound FOO1 --sound address.type=BAR` is not
rejected. The commandlines will effectively be squashed

`--sound` can be any XML option, but trying to mix and match
options like `--sound` and `--disk` is always rejected.

These bits are unexpected and undocument, but have been around since
the beginning of virt-xml.

I can see us breaking compat on these in the future (particularly the
--remove-device bit), but that would need to be an explicit decision,
and announced appropriately. In the mean time, we should be testing
this so it doesn't accidentally regress.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-28 21:09:31 +02:00
Cole Robinson
7e79e064ea Revert virt-xml multiple --edit support
This reverts b34ae0d0c8 and
1fef5d8661.

Playing with this some more I found some deeper problems. For example

```console
[:~/src/virt-manager] (main) $ ./virt-xml test-for-virtxml --connect test://`pwd`/tests/data/testdriver/testsuite.xml --print-diff --edit 1 --video model=FOO --edit 2 --sound model=BAR
--- Original XML
+++ Altered XML
@@ -180,14 +180,14 @@
     <graphics type="vnc" port="-1" autoport="yes">
       <listen type="address"/>
     </graphics>
-    <sound model="sb16"/>
+    <sound model="BAR"/>
     <sound model="es1370"/>
     <sound model="ich6"/>
     <video>
       <model type="vmvga" vram="16384" heads="1" primary="yes"/>
     </video>
     <video>
-      <model type="cirrus" vram="16384" heads="3"/>
+      <model type="FOO" vram="16384" heads="3"/>
     </video>
     <hostdev mode="subsystem" type="usb" managed="yes">
       <source>
```

There's other weirdness too, though it's mostly strange plays on previous weird behavior

* `--edit --video model=vga --edit --sound model=ich9 --video model=qxl` works
* `--add-device --sound model=foo --video model=bar` was previously rejected but now works
* `--remove-device --video model=vmvga --sound model=sb16` was previously rejected by now works

Fixing all this is not trivial. So I think we need to revert and go back to the drawing board.
2024-08-28 21:09:31 +02:00
Cole Robinson
5fe6dcc6b4 Fix some pylint
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-28 11:53:35 -04:00
Daniel P. Berrangé
97469abd8e tests: add tests for AMD SEV-SNP
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-08-28 14:38:40 +02:00
Daniel P. Berrangé
3559dcd9de virtinst: add properties for AMD SEV-SNP
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-08-28 14:38:40 +02:00
Pavel Hrdina
1fef5d8661 tests: add virt-xml test to demonstrate changing graphics and video at the same time
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-08-26 12:33:51 -04:00
Pavel Hrdina
b34ae0d0c8 virt-xml: allow multiple --edit options
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-08-26 12:33:51 -04:00
Pavel Hrdina
cb6636f4bf virtinst: add getter/setter for video model
This makes it easier for users to change video model from QXL to
different model as QXL is special and uses other attributes that are not
supported by any other model. Without this code libvirt would report
error or user would have to request `clearxml`.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-08-26 12:33:51 -04:00
Pavel Hrdina
093d58fbc8 virtinst: add/remove spice devices when updating graphics type
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-08-26 12:33:51 -04:00
Pavel Hrdina
aaf8551914 virtinst: remove spice devices when removing last spice graphics
When Spice graphics is used QEMU creates a Spice server and communicates
with Spice client using multiple channels. These channels are used by
the spice devices as well. Without the Spice graphics defined there is
no use for the other devices. In addition libvirt will report error for
such configuration.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-08-26 12:33:51 -04:00
Pavel Hrdina
7a03f3efa8 testsuite: add test-spice vm definition
This will test spice related changes. Follow up patches will change this
behavior to remove spice related devices.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-08-26 12:33:51 -04:00
Pavel Hrdina
2a0aa2d56b virtinst: fix compare for audio devices
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-08-26 12:33:51 -04:00
Pavel Hrdina
ef64949e84 virtinst: unify detection of duplicate console when removing device
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-08-26 12:33:51 -04:00
Cole Robinson
29145b9e93 Fix some pylint
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-26 11:36:01 -04:00
Pavel Hrdina
90ceb87b7c virt-install: implement passt backend for user network interface
Add new `--network backend.type` attribute, libvirt currently supports
only `passt`. If not network type is specified virt-install will pick
`user` type as it is required for `passt` backend.

This also introduces support to specify portForward and specifying port
range as well.

For more details see [1].

[1] <https://libvirt.org/formatdomain.html#userspace-slirp-or-passt-connection>

Fixes: https://github.com/virt-manager/virt-manager/issues/488
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-08-26 11:27:03 -04:00
Pino Toscano
b1ee4c94c7 po: Refresh translation template
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2024-08-16 22:43:54 +02:00
Omar TS
baa380aae3 Translated using Weblate (Arabic)
Currently translated at 1.9% (28 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/ar/
2024-08-16 22:43:04 +02:00
Henning
2d3f3faacd Translated using Weblate (German)
Currently translated at 88.8% (1291 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/de/
2024-08-16 22:43:04 +02:00
Abdul Munif Hanafi
deadb8a5c8 Translated using Weblate (Indonesian)
Currently translated at 39.6% (576 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/id/
2024-08-16 22:43:04 +02:00
Andika Triwidada
41fa111ceb Translated using Weblate (Indonesian)
Currently translated at 39.4% (573 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/id/

Translated using Weblate (Indonesian)

Currently translated at 31.1% (453 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/id/

Translated using Weblate (Indonesian)

Currently translated at 17.2% (251 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/id/
2024-08-16 22:43:04 +02:00
zhanchun li
276c1c4b0e Translated using Weblate (Chinese (Traditional) (zh_TW))
Currently translated at 100.0% (1453 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/zh_TW/
2024-08-16 22:43:04 +02:00
김인수
383c83afee Translated using Weblate (Korean)
Currently translated at 100.0% (1453 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/ko/
2024-08-16 22:43:04 +02:00
Renan Birck Pinheiro
735a4352f5 Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.9% (1452 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/pt_BR/

Translated using Weblate (Portuguese (Brazil))

Currently translated at 99.7% (1449 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/pt_BR/

Translated using Weblate (Portuguese (Brazil))

Currently translated at 99.5% (1447 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/pt_BR/

Translated using Weblate (Portuguese (Brazil))

Currently translated at 99.2% (1442 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/pt_BR/

Translated using Weblate (Portuguese (Brazil))

Currently translated at 98.7% (1435 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/pt_BR/

Translated using Weblate (Portuguese (Brazil))

Currently translated at 97.7% (1420 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/pt_BR/

Translated using Weblate (Portuguese (Brazil))

Currently translated at 97.6% (1419 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/pt_BR/

Translated using Weblate (Portuguese (Brazil))

Currently translated at 95.9% (1394 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/pt_BR/
2024-08-16 22:43:04 +02:00
Andi Chandler
4e6ce92ed0 Translated using Weblate (English (United Kingdom))
Currently translated at 100.0% (1453 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/en_GB/
2024-08-16 22:43:04 +02:00
stephane blondon
a4adbc1a78 Translated using Weblate (French)
Currently translated at 92.7% (1347 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/fr/

Translated using Weblate (French)

Currently translated at 92.7% (1348 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/fr/

Translated using Weblate (French)

Currently translated at 92.5% (1345 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/fr/

Translated using Weblate (French)

Currently translated at 89.9% (1307 of 1453 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/fr/
2024-08-16 22:43:04 +02:00
Cole Robinson
954c9b6bf7 uitests: createvm: fix case on f40
We should be checking 'selected' here, not 'focused'. This stopped
working on f40 apparently

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-14 11:36:13 -04:00
Cole Robinson
2ddbea5d0b uitests: Fix get_text() on fedora40
Seems like some dependent lib started exposing a similarly named
function, so ours stopped working

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-14 06:17:10 -04:00
Cole Robinson
0cad0c4dff uitests: force internal snapshots in test_snapshot.py
Incase the libvirt test driver ever starts advertising support

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-12 19:55:58 -04:00
Cole Robinson
a00c090022 uitests: handle newer libvirt test driver UpdateDevice support
Make it fail for the cases that expect it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-12 19:55:58 -04:00
Cole Robinson
2e1bacfd33 uitests: Add live external snapshot testing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-12 19:55:58 -04:00