Commit Graph

2438 Commits

Author SHA1 Message Date
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
Cole Robinson a254ece0f0 virt-install: --help required options are wrong
Nowadays it could be as simple as `virt-install --install fedora36`.

Trying to represent the interdepencies here is not worth it, but
let's keep a simple string around to avoid the default parser
usage string, which is huge

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-21 16:10:55 -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
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 4b15073572 cli: Drop unnecessary --disk prop aliases
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-17 10:27:36 -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 8ca7c91697 Prep for release 4.1.0
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-04 15:53:33 -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 02e6abad48 cli: Break up parse_option_strings
Into run_parser and run_all_parsers. Opencode some of the special
case handling in virtxml

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-03 12:34:47 -04:00
Cole Robinson e2dfbf9bd9 virt-xml: Simplify --build-xml parse_option_strings usage
parse_option_strings will do the right thing for us already

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-03 12:34:47 -04:00
Cole Robinson bfa37d0065 xmlutil: Take unindent_device_xml from details.py
We will use this in virt-xml soon

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-03 12:34:47 -04:00
Cole Robinson d2b346370a virtxml: Remove redundant listify calls
parse_option_strings always returns a list

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-03 12:34:47 -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
Lin Ma b8a77805b0 domain: cpu: Clear 'migratable' when changing to custom cpu
Otherwise going host-passthrough -> custom can cause libvirt validation
error due to libvirt fills the default value(migratable='on') for the
host-passthrough in domain XML.

Signed-off-by: Lin Ma <lma@suse.com>
2022-08-01 10:11:43 -04:00
Cole Robinson 35871fe96b capabilities: Remove noisy alias debugging
our debugging output is not this fine grained, so this crowds out
more interesting messages

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-01 06:04:48 -04:00
Cole Robinson 8079c421bd connection: De-duplicate ui and cli version logging
Remove the open coded version logging in cli.py and virt-manager
connection.py, and move it into virtinst connection open

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-01 06:04:48 -04:00
Cole Robinson aeffa4f711 guest: Check coverage for more of domcaps caching
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-07-27 18:07:05 -04:00
Daniel P. Berrangé 92ba8e5d35 virtinst: log libvirt version numbers after connecting
The various version numbers reported by libvirt are all relevant pieces
of information when debugging problem reports.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-27 17:53:14 -04:00
Daniel P. Berrangé 01ff867f56 virtinst: include the version number in first log message
Knowledge of the version number is not always available from the user
bug report. They may merely have a log file from an automated system.
Including the version number in the log message is key information.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-27 17:53:14 -04:00
Daniel P. Berrangé b5e8e58d74 virtinst: include host capbilities in debug log
This is critical information when debugging many user problems.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-27 17:53:14 -04:00
Daniel P. Berrangé fec5fd84a7 virtinst: include domain capbilities in debug log
This is critical information when debugging many user problems.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-27 17:53:14 -04:00
Daniel P. Berrangé 05fcc7410e virtinst: fix caching of domain capabilities
The domain capabilities XML always contains the canonical machine name.
When the selected machine type for a guest is an alias, the check
comparing it to the domain capabilities machine will always fail. This
prevents the domain capabilities result from being cached.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-27 17:53:14 -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 9da917b8ac connection: Add get_libvirt_data_root_dir()
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-20 09:10:59 -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
Cole Robinson bfe17ce627 osdict: Fix test coverage with latest libosinfo
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-13 13:49:08 -04:00
Jonathon Jongsma 44355e5ed0 virt-install: add support for qemu-vdagent channel
This allows support for host/guest clipboard sharing when using vnc
guests (and possibly other graphics types in the future). This channel
is similar to the spicevmc channel, but it contains a couple additional
options to enable/disable clipboard sharing and specify the mouse mode.
In the case of spice, these settings are specified on the 'graphics'
element, but for qemu-vdagent, they are specified on the channel. For
example:

   --channel=qemu-vdagent,source.clipboard.copypaste=on,source.mouse.mode=client

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
2022-06-13 13:49:08 -04:00
Cole Robinson 34662fecc9 tests: Fix with latest argcomplete
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-13 13:20:01 -04:00
Martin Kletzander a62e3df72f Add support for URL query with disks
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2022-04-13 08:35:50 -04:00
Cole Robinson e924dfb389 Prep for release 4.0.0
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-03-02 12:44:04 -05:00
Cole Robinson 291b750831 osdict: Hardcode win11 requires UEFI
Since there's a release pending, this is a bit of future proofing
if win11 pops up in a future osinfo-db without accompanying
libosinfo firmware APIs landing

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-03-02 10:57:36 -05:00
Cole Robinson 5640e9be5b osdict: firmware handling tweaks
* Check it for test:/// URI too
* Move the whole logic into osdict.requires_firmware_efi
* Wrap it all in an exception handler the final API breaks us
* Add some coverage exclusions since this is currently untestable

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-03-02 10:52:06 -05:00
Daniel P. Berrangé 5d74ca7621 virtinst/guest: use EFI firmware if osinfo-db shows lack of BIOS support
Windows 11 only supports EFI for installation, legacy BIOS is
discontinued as an option for new installs, unless you switch into
the console and run various regedit hacks in the installer.

This is not something we expect users to do, so osinfo-db will
report:

   <firmware arch="x86_64" type="efi"/>
   <firmware arch="x86_64" type="bios" supported="false"/>

for Windows 11.

When seeing 'bios' with supported=false, we need to prefer EFI
firmware no matter what.

For other OS we should stil prefer BIOS, because EFI blocks the usage of
internal qcow2 snapshots until some libvirt work is done to use the new
QMP snapshot commands.

Note this relies on a new API osinfo_os_get_complete_firmware_list
just added to libosinfo in version 1.10, so for most existing OS
distros this will be dormant functionality until they rebase to
latest libosinfo APIs.

The Windows 11 entry for osinfo-db will be the first that exposes
the metadata indicating lack of BIOS support.

Related: https://github.com/virt-manager/virt-manager/issues/310
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-03-02 10:42:12 -05:00
Cole Robinson 78e24fc986 cloudinit: Fix disabling cloud-init on first boot
`sudo` throws errors and is not even required to write the `disable`
file. Also add a message to the file that it was created by us

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-03-01 14:29:46 -05:00
Cole Robinson 22478f307d virt-install: Add --cloud-init clouduser-ssh-key=
This sets the sshkey for the default cloud-init username

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-03-01 14:29:46 -05:00
Cole Robinson c8afd1f51e virt-install: Rename --cloud-init ssh-key -> root-ssh-key
Originally we thought it would be for the clouduser, but then
we changed it, and now it's ambiguous. Rename it to make the
usage clear, and add an alias to keep any users working

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-03-01 14:29:46 -05:00
Cole Robinson 906604c972 tests: Compare cloud-init userdata output too
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-03-01 14:29:46 -05:00
Cole Robinson d77efa1586 installer: Add smbios serial ds=nocloud for --cloud-init
This is a hint to cloud-init that we are passing in a nocloud
data source. This should typically just be an optimization, but
Ubuntu -kvm-disk cloud images since at least 20.04 need this to
work with -M q35:
https://bugs.launchpad.net/cloud-init/+bug/1940791

Fixes: https://github.com/virt-manager/virt-manager/issues/359

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-03-01 14:29:46 -05:00
Cole Robinson 51663a2c8c installer: Rework how we alter install and final XML
The Guest object passed in by the user is no longer altered in place,
instead we act on copies of the original XML. We need to rework how
unattended/cloudinit device altering works a bit to handle this.

There's some XML churn because working on parsexml gives different
output ordering, but this is expected.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-03-01 14:13:35 -05:00
Cole Robinson 08d3068340 installer: Rename install_xml -> initial_xml
Better describes when it applies

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-03-01 10:34:52 -05:00
Cole Robinson 825ec644b8 installer: Do not force reboot with --cloud-init
Resolves: https://github.com/virt-manager/virt-manager/issues/189

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-03-01 10:32:01 -05:00