8840 Commits

Author SHA1 Message Date
Pavel Hrdina
443123ece6 virtinst: urldetect: detect Debian version for ISO images
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2025-04-16 12:06:57 -04:00
Pavel Hrdina
66aa81ae6d test_urldetect: arch is detected from the ISO media
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2025-04-16 12:06:57 -04:00
Pavel Hrdina
fbf7f060be virtinst: urldetect: figure out Debian arch from the ISO media
We should not use guest.os.arch, it doesn't work correctly if the ISO is
i386 and the VM arch is x86_64.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2025-04-16 12:06:57 -04:00
Pavel Hrdina
4257e19748 virtinst: urldetect: move default Debian arch to _set_url_paths
The function _find_treearch will be used for ISO files as well where we
don't want to have default arch.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2025-04-16 12:06:57 -04:00
Pavel Hrdina
c8a5b81867 virtinst: urldetect: don't check x86_64 for Debian/Ubuntu
They are using amd64 instead.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2025-04-16 12:06:57 -04:00
Pavel Hrdina
3b3eac28a6 test_urldetect: use fake badarch Debian
Instead of using existing arch use badarch in order to test parts of the
code when we don't know the architecture.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2025-04-16 12:06:57 -04:00
Cole Robinson
fb71f02fa2 uitests: Add coverage for mixed internal and external snapshots
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-04-16 11:58:33 -04:00
Cole Robinson
09574977da uitests: fix testManagerDefaultStartup race
"Checking for virtualization" is only there for about a second

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-04-16 11:58:33 -04:00
Cole Robinson
6458f09b72 uitests: fix testNewVMSession after networking changes
Keep this test as covering the default `Usermode` case

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-04-16 11:58:33 -04:00
Cole Robinson
f312872496 uitests: fix push button usage on fedora 41
somewhere in the stack this was renamed to just `button`

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-04-16 11:58:33 -04:00
Pavel Hrdina
4f9618289f virt-install: detect wayland in order to start virt-viewer
When running virt-install using waypipe the DISPLAY variable is not
defined and virt-install will complain that it cannot start virt-viewer.

Check for WAYLAND_DISPLAY as well, DISPLAY is defined only when xwayland
is used. In case of waypipe it configures only WAYLAND_DISPLAY.

Move the check before we check for virt-viewer as without display there
is no point to check if virt-viewer is installed or not.

Fixes: https://github.com/virt-manager/virt-manager/issues/884
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2025-03-24 15:32:28 +01:00
Joren
297d1cd282 Separate virtio sound device testing into an individual test 2025-03-22 14:14:46 +01:00
Pavel Hrdina
e39e0ad5f0 virt-manager: add support for vDPA network device
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2025-03-18 20:34:22 +01:00
Joren
e5142f28fe virt-install: add support for vDPA network device 2025-03-18 20:34:22 +01:00
Pavel Hrdina
714d5f1afd virt-manager: list virtual networks when creating new QEMU Session VM
Using qemu-bridge-helper QEMU Session VMs are now able to use host
bridge interfaces. Currently only interface named virbr0 is allowed by
default but it is possible to change it in `/etc/qemu/bridge.conf`.

We will still keep the usermode network as default.

Resolves: https://github.com/virt-manager/virt-manager/issues/863
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2025-03-18 20:33:33 +01:00
Pavel Hrdina
0273621b43 Update issue templates
The old issue template stopped working as GitHub updated how the
template should look like. While at it create two issue templates, one
for bugs and the other for feature requests.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2025-03-14 08:27:44 +01:00
dependabot[bot]
afc55ac0b9 ci: bump actions/setup-python from 3 to 5
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v3...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-10 16:59:30 +01:00
dependabot[bot]
1709dc8294 ci: bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-10 16:47:45 +01:00
Heinrich Schuchardt
ccfe4a0abc urlfetcher: add riscv64 architecture for Debian
Add riscv64 to the list of Debian architectures.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-03-08 12:59:18 +01:00
Marius Vollmer
92e90e6e27 xmlapi: Don't escape property values
libxml2 does that already.

Fixes #838
2025-03-05 19:20:15 +01:00
Cole Robinson
9137fd26ef Use pre-commit to run black in CI
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-03-05 17:16:22 +01:00
Cole Robinson
8d18bdc1e5 Add pre-commit as a runner for black
`pre-commit` provides an easy way for devs to never miss committing
code without running black, and an easy way to to invoke black from
CI. In the future we can use it to run codespell, and new-to-us
tools like flake8

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-03-05 17:16:22 +01:00
Cole Robinson
f4c57a4d3b Remove pycodestyle usage
`black` is incharge of style now

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-03-05 17:16:22 +01:00
Pavel Hrdina
9558daafd9 Translated using Weblate (Japanese)
Currently translated at 94.3% (1377 of 1459 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/ja/
2025-03-05 17:02:35 +01:00
Remus-Gabriel Chelu
354c1eeb7e Translated using Weblate (Romanian)
Currently translated at 100.0% (1459 of 1459 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/ro/
2025-03-05 17:02:35 +01:00
Nicolás Gal
5c39b38167 Translated using Weblate (Spanish)
Currently translated at 100.0% (1459 of 1459 strings)

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

Translated using Weblate (Spanish)

Currently translated at 100.0% (1459 of 1459 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/es/
2025-03-05 17:02:35 +01:00
Temuri Doghonadze
451b8cf920 Translated using Weblate (Georgian)
Currently translated at 100.0% (1459 of 1459 strings)

Translation: virt-manager/virt-manager
Translate-URL: https://translate.fedoraproject.org/projects/virt-manager/virt-manager/ka/
2025-03-05 17:02:35 +01:00
Cole Robinson
ef41638f5e tests: test_urls: fix dead URL
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-03-03 12:40:36 -05:00
Akihiko Odaki
fb54f37b60 tests: Increase virtio-mem block size
virtio-mem block size must be equal to or greater than the transparent
huge page size; otherwise, libvirt raises an error and a test will
fail. For example, on Asahi Linux, the transparent huge page size is 32
MiB, which is greater than 2 MiB, the specified virtio-mem block size.

On Linux 6.13, the configuration with the maximum transparent huge page
size is Arm64 with 64 KiB, and it has 512 MiB transparent huge pages.
Increase the block size to 512 MiB so that the test passes on every
Linux configuration.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
2025-03-03 12:19:33 -05:00
Lin Ma
a0e390b1b6 man/virt-install: Document pstore device
Signed-off-by: Lin Ma <lma@suse.de>
2025-03-03 12:01:09 -05:00
Lin Ma
6c43ab3863 tests: add pstore test
Signed-off-by: Lin Ma <lma@suse.de>
2025-03-03 12:01:09 -05:00
Lin Ma
b5f6569bc0 virtinst: add --pstore backend=acpi-erst,path=XX,size=YY support
Libvirt since v10.6.0 introduces pstore pci device for storing oops/panic
logs in nvram storage.

Let's add it into virt-install, It has 3 suboptions:
* backend: The desired backend, by far only 'acpi-erst' is accepted.
* path:    Represents a path in the host that backs the pstore device in
           the guest. It is optional, If not specified the libvirt will
           auto generates one.
* size:    Configures the size of the persistent storage available to the
           guest. It is mandatory, unit is kilobytes.

Eg:
virt-install --pstore backend=acpi-erst,path=/tmp/guest_acpi_esrt,size=8

Signed-off-by: Lin Ma <lma@suse.de>
2025-03-03 12:01:09 -05:00
Pino Toscano
af07c39b13 chore: format the code with black
(crobinso: compress to one commit, and adjust string concat issues)

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2025-03-03 11:40:37 -05:00
Pino Toscano
768390e505 chore: add configuration for black
Add a pyproject.toml file with the configuration for the "black" tool,
to prepare reformatting the whole codebase with it:
- extend the line length from the default 88 characters to 100, more
  suitable for the virt-manager codebase
- set a custom regexp for the files to format, so also the wrapper
  scripts are handled

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2025-03-03 11:40:07 -05:00
Cole Robinson
6f188482b2 tests: uitests: handle linux2020 going EOL
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-03-03 10:39:12 -05:00
Heinrich Schuchardt
6c6c39be2f createvm: prioritize riscv64
As all major distros support the riscv64 architecture, add it to the
list of prioritized architectures. This will move it up in the
architecture drop-down menu and thereby easier to find when creating
a new VM.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-03-03 10:13:14 -05:00
Pavel Hrdina
5ddd3456a0 virtManager: domain: fix indentation
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2025-01-29 10:50:03 +01:00
Lin Ma
9ef77c1892 tests: skip some hyperv feature tests for libvirt older than 10.7.0/11.0.0
Signed-off-by: Lin Ma <lma@suse.de>
2025-01-29 10:48:57 +01:00
Lin Ma
81c873ba36 cli: Add --features hyperv.tlbflush.extended.state=on/off
Signed-off-by: Lin Ma <lma@suse.de>
2025-01-29 10:48:57 +01:00
Lin Ma
5f2a2dbd0a cli: Add --features hyperv.tlbflush.direct.state=on/off
Signed-off-by: Lin Ma <lma@suse.de>
2025-01-29 10:48:57 +01:00
Lin Ma
1f43c0d1d9 cli: Add --features hyperv.emsr_bitmap.state=on/off
Signed-off-by: Lin Ma <lma@suse.de>
2025-01-29 10:48:57 +01:00
Lin Ma
5617330513 cli: Add --features hyperv.xmm_input.state=on/off
Signed-off-by: Lin Ma <lma@suse.de>
2025-01-29 10:48:57 +01:00
Lin Ma
dc89a02c75 cli: Add nvram.templateFormat to indicate template format
Signed-off-by: Lin Ma <lma@suse.de>
2025-01-29 10:48:57 +01:00
Lin Ma
f278c89b49 cli: Add --tpm backend.profile.{source,removeDisabled} support
Swtpm since v0.10 supports to configure a TPM2 with a profile from file.
eg:

root@localhost:~ # cat /etc/swtpm/profiles/mytest.json
{
      "Name": "custom:test",
      "Algorithms":"rsa,rsa-min-size=1024,......"
}

root@localhost:~ # swtpm_setup --tpm2 --print-profiles | jq
{
  "local": [
    {
      "Name": "mytest",
      "Algorithms": "rsa,rsa-min-size=1024,......"
    }
  ],
  "builtin": [
    {
      "Name": "default-v1",
      "StateFormatLevel": 7,
      "Commands": "......",
      "Algorithms": "rsa,rsa-min-size=1024,......",
      "Description": "......"
    },
    {
      "Name": "null",
      "StateFormatLevel": 1,
      "Commands": "......",
      "Algorithms": "rsa,rsa-min-size=1024,......",
      "Description": "......"
    },
    {
      "Name": "custom",
      "StateFormatLevel": 2,
      "Commands": "......",
      "Algorithms": "rsa,rsa-min-size=1024,......",
      "Description": "......"
    }
  ]
}

Libvirt supports it since v10.10.0

Let's add this feature into virt-install, eg:

root@localhost:~ # virt-install \
......\
--tpm model=tpm-tis,backend.version=2.0,\
backend.profile.source=local:mytest,backend.profile.removeDisabled=check

Signed-off-by: Lin Ma <lma@suse.de>
2025-01-29 10:48:57 +01:00
Lin Ma
9263859944 .gitignore: Ignore coverage.xml
Signed-off-by: Lin Ma <lma@suse.de>
2025-01-29 10:48:57 +01:00
Lin Ma
006ce41576 test_cli: Fix a pycodestyle E261 issue
root@localhost:~ # meson test -C build

==================================== 1/3 =========================
test:         pycodestyle
start time:   14:08:14
duration:     5.80s
result:       exit status 1
command:      MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:...... \
/usr/bin/pycodestyle \
--config setup.cfg --format pylint tests virtinst virtManager
----------------------------------- stdout -----------------------------------
tests/test_cli.py:1157: [E261] at least two spaces before inline comment
......

Signed-off-by: Lin Ma <lma@suse.de>
2025-01-29 10:48:57 +01:00
Lin Ma
a7c455f460 cli: Add 'poll' settings for iothread
Since libvirt v9.4.0, It introduces 'poll' settings in domain XML to
override the hypervisor-default interval of polling for iothread.

Let's add it into virt-install.
Eg:
virt-install \
...... \
--iothreads iothreads=2,\
iothreadids.iothread0.id=1,\
iothreadids.iothread1.id=2,\
iothreadids.iothread1.poll.max=123,\
iothreadids.iothread1.poll.grow=456,\
iothreadids.iothread1.poll.shrink=789

It results in the following domain XML snippet:
  <iothreads>2</iothreads>
  <iothreadids>
    <iothread id='1'/>
    <iothread id='2'>
      <poll max='123' grow='456' shrink='789'/>
    </iothread>
  </iothreadids>

Signed-off-by: Lin Ma <lma@suse.de>
2025-01-29 10:25:37 +01:00
Lin Ma
36d00e0e79 cli: Add --disk driver.queue_size support
Eg:
virt-install \
......
--disk /tmp/disk0.qcow2,size=10,driver.type=qcow2,\
driver.queues=4,driver.queue_size=256 \
......

It results in the following domain XML snippet:
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' queues='4' queue_size='256'/>
      <source file='/tmp/disk0.qcow2' index='2'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
    </disk>

Signed-off-by: Lin Ma <lma@suse.de>
2025-01-29 10:25:37 +01:00
Lin Ma
79c333e364 cli: add target.memReserve for pci-bridge and pcie-root-port controllers
Libvirt(since v10.3.0) supports setting memReserve attribute to pci-bridge
and pcie-root-port, Let's add it into virt-install. Eg:

virt-install \
......
--controller pci,index=0,model=pcie-root \
--controller pci,index=1,model=pcie-root-port,target.memReserve=8196 \
--controller pci,index=2,model=dmi-to-pci-bridge \
--controller pci,index=3,model=pci-bridge,target.memReserve=8196 \
......

It results in the following domain XML snippet:
    <controller type='pci' index='0' model='pcie-root'>
      <alias name='pcie.0'/>
    </controller>
    <controller type='pci' index='1' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='1' port='0x10' memReserve='8196'/>
      <alias name='pci.1'/>
      <address type='pci' ....../>
    </controller>
    <controller type='pci' index='2' model='dmi-to-pci-bridge'>
      <model name='i82801b11-bridge'/>
      <alias name='pci.2'/>
      <address type='pci' ....../>
    </controller>
    <controller type='pci' index='3' model='pci-bridge'>
      <model name='pci-bridge'/>
      <target chassisNr='3' memReserve='8196'/>
      <alias name='pci.3'/>
      <address type='pci' ....../>
    </controller>

Signed-off-by: Lin Ma <lma@suse.de>
2025-01-29 10:25:37 +01:00
Lin Ma
8564ace73a cli: Add --memdev target.dynamicMemslots support for virtio-mem
Libvirt supports setting dynamicMemslots attribute for virtio-mem since
v10.1.0, Let's add it into virt-install. Eg:

virt-install \
......
--vcpu 2 \
--cpu cell0.cpus=0,cell0.memory=4194304,\
cell1.cpus=1,cell1.memory=4194304 \
--memory maxMemory=65536,maxMemory.slots=8 \
--memdev model=virtio-mem,\
target.node=0,\
target.block=2048,\
target.size=8192,\
target.dynamicMemslots=yes \
......

It results in the following domain XML snippet:
    <memory model='virtio-mem'>
      <target dynamicMemslots='yes'>
        ......
    </memory>

Signed-off-by: Lin Ma <lma@suse.de>
2025-01-29 10:25:37 +01:00