Commit Graph

1950 Commits

Author SHA1 Message Date
Jonathon Jongsma
40b73fec1b Fix filesystem socket.source
When specifying the socket.source option for filesystem devices, like
this:
  --filesystem type=mount,driver.type=virtiofs,source.socket=/xyz.sock,target.dir=tag1

virt-install is writing the xml as:

    <filesystem type="mount">
      <source>
        <socket>/xyz.sock</socket>
      </source>
      <target dir="tag1"/>
      <driver type="virtiofs"/>
    </filesystem>

This produces an error such as:

  ERROR missing source information for device mount_tag1

But the socket should be an attribute of source rather than a child
element. After this patch, the same command results in the following XML
and no error is produced:

    <filesystem type="mount">
      <source socket="/xyz.sock"/>
      <target dir="tag1"/>
      <driver type="virtiofs"/>
    </filesystem>

Resolves: RHEL-1126

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
2023-10-24 10:30:37 +02:00
Cole Robinson
775edfd5dc connectauth: Drop sanity checking for libvirtd
Nowadays with libvirt split daemons, libvirtd isn't required to
be installed for a first run local connection to succeed, so we
are needlessly blocking the app from 'just working' in many cases.
Especially considering that many distros often have libvirt running
out of the box due to gnome-boxes pulling it in.

Drop the daemon checking entirely.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-09-24 16:31:58 -04:00
Cole Robinson
ec434948a8 installer: drop default TPM for --cloud-init install phase
When shim in the guest sees unpopulated EFI NVRAM, like when
we create a new UEFI VM, it invokes fallback.efi to populate
initial NVRAM boot entries. When the guest also has a TPM device,
shim will do a one time VM reset. This reset throws off the
reboot detection that is central to virt-install's install
process.

The main install case that this will usually be relevant is
the combo of UEFI and --cloud-init. The latter usually implies
use of a distro cloud image, which will be using shim, and the
--cloud-init process requires a multi stage install compared
to just a plain import install.

For that case, we disable the default TPM device for the first
boot.

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-09-12 12:04:49 -04:00
Cole Robinson
fca6de3950 tests: Add more cloud-init and TPM test cases
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-09-12 12:03:40 -04:00
Cole Robinson
0f706cf874 Fix some pylint
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-09-12 11:54:04 -04:00
Cole Robinson
19b0f3f446 tests: Add unit test coverage for #539
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-08-29 12:27:40 -04:00
Laszlo Ersek
6e5c1db6b4 tests/data: refresh Fedora tree URLs in virt-install-osinfo* expected XMLs
Libosinfo seems to generate Fedora tree URLs using the "https", not
"http", scheme now; which breaks CI. Update the expected outputs
accordingly.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
2023-08-29 13:24:52 +02:00
Cole Robinson
7cd6151a21 uitests: Drop hotplug work around, f38 libvirt is fixed now
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-05-24 12:49:02 -04:00
Cole Robinson
64bd6ba53e tests: uitests: make menu operations more robust
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-05-06 19:43:24 -04:00
Cole Robinson
509c95ddb9 uitests: More attempts at making manager reposition test reliable
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-05-06 19:43:24 -04:00
Cole Robinson
75422ec75e uitests: Make hotplug test pass on both f37 and f38
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-05-06 19:43:24 -04:00
Cole Robinson
a9cf4945b1 tests: Default --uitests to --verbosity=2
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-05-06 16:50:20 -04:00
Cole Robinson
6030049cd7 tests: uitests: Fix manager window repositioning test
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-05-05 15:48:24 -04:00
Cole Robinson
7f83d23f4f tests: livetests: work around qemu media change regression
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-05-05 15:47:25 -04:00
Cole Robinson
909c8aa880 tests: uitests: Fix window reposition on f38
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-05-05 14:54:31 -04:00
Oleg Vasilev
7769548411 tests: cli: test serial file clone
Previous commit added serial file clone, now we test it.

Signed-off-by: Oleg Vasilev <oleg.vasilev@virtuozzo.com>
2023-03-22 17:44:06 -04:00
Cole Robinson
5c49151df9 tests: test win11 XML generation
And drop the futureproofing workaround now that it's no longer
required

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-01-19 11:54:03 -05:00
Toshiki Sonoda
6ec00474a6 virtinstall: Hide total_size in the progress bar if it doesn't need
virt-install prints the total_size value to the progress bar even if it
is meaningless.
This value can be confusing to user, so for execute prosess that doesn't
copy files (total_size = 0B), we hide the total_size value.
For example, 'Creating domain...' doesn't need to print the total_size
value.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
Signed-off-by: Haruka Ohata <ohata.haruka@fujitsu.com>
2022-12-14 13:18:36 -05:00
Cole Robinson
4114fa1aa8 progress: Fix showing correct final total
Reproducer:
Reproducer:
./virt-install --connect test:///default \
               --location tests/data/fakemedia/fake-f26-netinst.iso

Before:
Starting install...
Retrieving 'vmlinuz'                            |    0 B  00:00:00 ...
Retrieving 'initrd.img'                         |    0 B  00:00:00 ...

After:
Starting install...
Retrieving 'vmlinuz'                            |    9 B  00:00:00 ...
Retrieving 'initrd.img'                         |    9 B  00:00:00 ...

progress.end() currently only reports the total amount of bytes
that were last written to the UI. It should report the total amount
that's been passed to update().

Reported-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-12-14 13:01:48 -05:00
Cole Robinson
b5d6dfaa0d tests: Update to latest kvm domcaps
And add some test coverage exclusions, needed for previous patches

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-12-14 12:45:05 -05:00
Lin Ma
c313209455 tests: Add domcaps coverage for usb-redir/spicevmc channel checks
Signed-off-by: Lin Ma <lma@suse.com>
2022-12-14 12:44:54 -05:00
Cole Robinson
bb1afaba29 Fix pylint/pycodestyle warnings with latest versions
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-12-13 11:23:45 -05:00
Lin Ma
4a2df06483 diskbackend: Drop support for sheepdog
The sheepdog project is no longer actively developed, Libvirt removed
the support for sheepdog storage backend since v8.8.0, Let's drop it.

Signed-off-by: Lin Ma <lma@suse.com>
2022-11-07 10:10:00 -05:00
Cole Robinson
15ddeae6cb cli: support --boot loader.stateless=
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-10-17 11:54:37 -04:00
Cole Robinson
1d64a678d3 virt-install: Reuse cli.fail_conflicting
For the --unattended + --cloud-init conflict

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-22 10:16:19 -04:00
Cole Robinson
999ccb85e3 virt-install: --unattended and --cloud-init conflict
Make it an explicit error, otherwise unattended is preferred and
cloud-init is ignored

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-21 16:47:26 -04:00
Cole Robinson
b0d0516736 cloner: Sync <uuid> and <sysinfo> system uuid
Otherwise libvirt errors like:

ERROR    UUID mismatch between <uuid> and <sysinfo>

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-21 16:21:10 -04:00
Lin Ma
fbdf051626 cli: --cpu: Add maxphysaddr.{mode,bits} options
This commit added support for cpu physical address bits control, It's
useful for VMs with huge amount of ram.

E.g.
--cpu Cascadelake-Server,maxphysaddr.mode=emulate,maxphysaddr.bits=46

Signed-off-by: Lin Ma <lma@suse.com>
2022-08-20 10:03:11 -04:00
Lin Ma
c22a876e9a tests: Add a compat check for linux2020 in amd-sev test case
It avoids amd-sev test failure if using older osinfo-db.

Signed-off-by: Lin Ma <lma@suse.com>
2022-08-20 09:59:27 -04:00
Cole Robinson
e94786c066 virtinstall: fix regression with --boot and no install method
Anything passed to --boot should imply --install no_install=yes
in the absence of other --install options. This is historically
what we've done but we regressed in 4.1.0

Resolves: https://github.com/virt-manager/virt-manager/issues/426

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-20 09:54:01 -04:00
Cole Robinson
1cb0be4002 virtinstall: split no_install conditional apart to track code coverage
Each bit here is part of the CLI API, we need to be sure we are
covering each one. Extend the test suite to hit one case we are missing

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-20 09:47:49 -04:00
Cole Robinson
1b87e3e54c tests: testdriver: Add filesystem socket example
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-17 10:29:31 -04:00
Cole Robinson
7295ebfb02 tests: cli: Fix test output after previous commit
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-17 10:21:31 -04:00
Lin Ma
11a887ece5 cli: --disk: Add driver.metadata_cache options
Properly setting the metadata cache size can provide better performance
in case of using big qcow2 images.

This patch introduces two driver options:
* driver.metadata_cache.max_size
* driver.metadata_cache.max_size.unit

E.g. --disk ...,driver.type=qcow2,\
     driver.metadata_cache.max_size=2,\
     driver.metadata_cache.max_size.unit=MiB

BTW, Metadata cache size control is currently supported only for qcow2.
Regarding how to properly caluclate the cache size of qcow2, Please refer
to qemu's documentation.

Signed-off-by: Lin Ma <lma@suse.com>
2022-08-17 09:57:29 -04:00
Cole Robinson
e132cb6fcd tests: test_inject: Drop --debug usage
Otherwise it scrolls output too fast and user doesn't notice the
instructions

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-04 15:06:17 -04:00
Cole Robinson
5e48307e9d virtinstall: Set VM name earlier so disks are named correctly
We need to change the flow from

  * parse all the strings
  * set capabilities defaults
  * build installer
  * fill in all guest defaults

To

  * parse boot and metadata strings
  * set capabilities defaults
  * build installer
  * set --name default
  * parse all the remaining strings
  * fill in all guest defaults

Because --disk parsing depends on --name for some path generation.
So this fixes --disk names when --name is implicitly specified by
--install or --osinfo

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-03 12:34:47 -04:00
Cole Robinson
4ca0d2c29b tests: More trailing newline fixes
The diff_compare rstrip() should never have been added, let's fix
it once and for all but dealing with missing newlines in the diff
helper

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-03 12:34:47 -04:00
Cole Robinson
effe274a9b tests: test_urls: Update fedora links
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-03 11:44:25 -04:00
Charles Arnold
424283ad1d launch_security: Use SEV-ES policy=0x07 if host supports it 2022-08-03 08:47:35 -04:00
Lin Ma
2984c13cff cli: Add --iothreads defaultiothread.thread_pool_{min,max}
It allows to set the thread pool size to optimize spawning worker threads
for the default event loop in real time environment. For example:

--iothreads defaultiothread.thread_pool_min=8,\
defaultiothread.thread_pool_max=16

Signed-off-by: Lin Ma <lma@suse.com>
2022-08-02 14:56:09 -04:00
Lin Ma
0d84bcfbfa cli: Add iothreadids attributes thread_pool_min and thread_pool_max
These two optional attributes allow setting lower and upper boundary for
number of worker threads for given IOThread. For example:

--iothreads iothreads=2,\
iothreadids.iothread0.id=1,\
iothreadids.iothread1.id=2,\
iothreadids.iothread1.thread_pool_min=8,\
iothreadids.iothread1.thread_pool_max=16

Signed-off-by: Lin Ma <lma@suse.com>
2022-08-01 11:32:23 -04:00
Cole Robinson
58ffe7fa7a tests: uitests: livetests: Fix LXC domain cleanup
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-01 10:38:01 -04:00
Cole Robinson
6287760ed0 tests: Fix memdev uuid testing with libvirt.git
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-01 06:46:41 -04:00
Cole Robinson
a4a5c1529a tests: Fix with latest libvirt
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-07-27 17:51:21 -04:00
Cole Robinson
7ae10b5566 cli: Add --serial source.tls=on|off
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-20 18:06:40 -04:00
Cole Robinson
137cfdc347 cli: Add --serial source.channel
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-20 18:03:55 -04:00
Cole Robinson
d0e6213643 cli: Add --memorybacking allocation.threads
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-20 17:54:50 -04:00
Cole Robinson
d51541e155 Fix UI rename with firmware='efi'
Our code to duplicate nvram wasn't expecting the XML to be devoid
of an nvram path.

Resolves: https://github.com/virt-manager/virt-manager/issues/372

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-20 09:37:26 -04:00
Cole Robinson
280c30736f tests: Fix test skipping with old osinfo-db
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-18 17:42:44 -04:00
Cole Robinson
48f66f27fd domcaps: armv7l doesn't support tpm-tis
Libvirt domcaps can advertise armv7l support for tpm-tis, even though
it will explicitly reject that config:

https://gitlab.com/libvirt/libvirt/-/issues/329

Work around that in domcaps. Without this, UEFI arm32 VMs generate
default configs that libvirt will reject

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-17 13:09:39 -04:00