Commit Graph

666 Commits

Author SHA1 Message Date
Cole Robinson
245e89ac38 guest: Rework set/get_uefi entry points
This replaces the pattern:

  Guest.set_uefi_path(Guest.get_uefi_path())

With a single entrypoint

  Guest.enable_uefi()

to immediately change the guest config to use UEFI, using our
default logic.

This will make it easier to change that logic in the future, like
using <os firmware='efi'> instead of hardcoded paths

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-26 11:59:42 -05:00
Cole Robinson
dfef112b2a virt-xml: Fix device lookup by integer properties
We were not correctly accounting for the internal representation of
some fields, and just trying to a string comparison. We need to be
a bit smarter than that

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-25 13:43:58 -05:00
Cole Robinson
f13c8d87fb guest: Remove the hyperv + uefi workaround for win7 + win2k8r2
Both these windows versions are now longer supported, and UEFI isn't
the default, so I don't think this hack is much needed anymore

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-25 12:05:45 -05:00
Daniel P. Berrangé
eb58c09f48 virtinst/guest: enable a TPM by default if UEFI is present
The bare metal world is moving to a situation where UEFI is going to be
the only supported firmware and there will be a strong expectation for
TPM and SecureBoot support.

With this in mind, if we're enabling UEFI on a VM, it makes sense to
also provide a TPM alongside it.

Since this requires swtpm to be installed we can't do this
unconditionally. The forthcoming libvirt release expands the domain
capabilities to report whether TPMs are supported, so we check that.

The user can disable the default TPM by requesting --tpm none

https://github.com/virt-manager/virt-manager/issues/310
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-01-21 17:49:15 -05:00
Cole Robinson
7e1f886aa9 cli: Clean up nodedev address functions a bit
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-21 13:20:46 -05:00
Cole Robinson
7986ffa80b nodedev: Move the CLI string format lookup to cli.py
This address string decomposing is strictly and virt-* cli feature.
Move it to cli.py to make that explicit

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-21 13:20:46 -05:00
Daniel P. Berrangé
95eb8dda9b virtinst: add missing 'dies' parameter for --vcpus
Although using --cpu topology.XXX is the preferred way to set topology,
it is still possible via the --vcpus parameter. For consistency, this
should support the full set of parameters, so dies needs to be added.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-01-20 14:16:38 -05:00
Jonathon Jongsma
9766beea04 cli: add 'ioapic.driver' to --features
Add the ability to set the ioapic driver using the --features argument:

    $ virt-install --features ioapic.driver=qemu ...

This results in the following xml:

  <features>
    ...
    <ioapic driver="qemu"/>
  </features>

This is required in order to install a guest with >255 cpus. Such a
configuration requires an iommu with extended interrupt mode enabled,
which in turn requires IOMMU interrupt remapping to be enabled, which in
turn requires a split I/O APIC.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
2022-01-11 18:26:06 -05:00
lisongmin
7da5daff92 cli: --cloud-init add network-config option 2021-10-04 16:31:39 -04: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
Hugues Fafard
cb97f6001b cli: --cpu: code cleanup & reordering
Shuffling bits of code around, adding comments and grouping CLI options
to make the code easier to read and understand at a glance.

Brings the ordering of XML options in line with libvirt's own output as
implemented in `src/conf/cpu_conf.c` and `src/conf/numa_conf.c`.
2021-10-04 15:10:10 -04:00
Hugues Fafard
6a2bc142eb cli: --cpu: add support for NUMA interconnects
This includes support for the following options:
* numa.interconnects.latency[0-9]*.initiator
* numa.interconnects.latency[0-9]*.target
* numa.interconnects.latency[0-9]*.cache
* numa.interconnects.latency[0-9]*.type
* numa.interconnects.latency[0-9]*.value
* numa.interconnects.latency[0-9]*.unit
* The same suboptions for `numa.interconnects.bandwith[0-9]*`

Note that the cache= attribute is only explicitly defined for <latency>
nodes in the documentation. However, since <latency> and <bandwidth>
nodes are otherwise identical, the docs also don't explicitly forbid it
for <bandwidth> nodes, and libvirt happily accepts XML that does specify
it for for <bandwidth> nodes, this implements the cache= attribute for
<bandwidth> elements as well.
2021-10-04 15:08:39 -04:00
Hugues Fafard
fbcb7539c3 cli: --cpu: add support for NUMA caches
This includes support for the following options:
* numa.cell[0-9]*.cache[0-9]*.level
* numa.cell[0-9]*.cache[0-9]*.associativity
* numa.cell[0-9]*.cache[0-9]*.policy
* numa.cell[0-9]*.cache[0-9]*.size.value
* numa.cell[0-9]*.cache[0-9]*.size.unit
* numa.cell[0-9]*.cache[0-9]*.line.value
* numa.cell[0-9]*.cache[0-9]*.line.unit
2021-10-04 15:08:38 -04:00
Hugues Fafard
42bb522f0d cli: --cpu: make numa.cell[0-9]*.discard an on/off type option 2021-10-04 15:08:38 -04:00
Hugues Fafard
bf3bd824c1 cli: --cpu: add support for unit of NUMA memory size
This adds support for the `numa.cell[0-9]*.unit` option.
2021-10-04 15:08:38 -04:00
Hugues Fafard
7d49d95a0f cli: --cpu: add support for specifying dies in topology
This adds support for the `topology.dies` option.
2021-10-04 15:08:38 -04:00
Hugues Fafard
1166bb3d8d cli: --cpu: add support for check & migratable options
Note that the `migratable` option is only allowed by libvirt for
`mode=passthrough` or `mode=maximum`.
2021-10-04 15:08:38 -04:00
Hugues Fafard
bcd97dd01a cli: --cputune: add support for cachetune montiors
This adds support for the following options:
* `cachetune[0-9]*.monitor[0-9]*.level`
* `cachetune[0-9]*.monitor[0-9]*.vcpus`
2021-10-04 13:31:54 -04:00
Hugues Fafard
563a97f022 cli: --cputune: add scheduling options
This includes support for the following options:
* `emulatorsched.scheduler`
* `emulatorsched.priority`
* `iothreadsched.iothreads`
* `iothreadsched.scheduler`
* `iothreadsched.priority`
2021-10-04 13:31:54 -04:00
Hugues Fafard
95721ae8d7 cli: --cputune: cleanup 2021-10-04 13:31:54 -04:00
Hugues Fafard
5cfbbf5701 cli: --cputune: add support for host cpu usage quotas
This includes support for the following options:
* `shares`
* `period`
* `quota`
* `global_period`
* `global_quota`
* `emulator_period`
* `emulator_quota`
* `iothread_period`
* `iothread_quota`
2021-10-04 13:31:54 -04:00
Pavel Hrdina
0953e1aea1 cli: introduce --resource fibrechannel.appid option
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2021-09-14 17:08:35 +02:00
Cole Robinson
520b3a3b35 cli: --filesystem: add binary.sandbox.mode and source.socket
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-07-30 13:15:29 -04:00
Cole Robinson
a214018af3 cli: --vsock: add generic virtio options support
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-07-30 13:09:08 -04:00
Hugues Fafard
6cc7987627 Finish reordering stuff and cleaning up
Finishes shuffling bits of code around to make the options better
grouped in the code so it's easier to read and understand what's what at
a glance.
2021-07-29 11:44:57 -04:00
Hugues Fafard
edf6c3ff2e cli: --boot: Completed options for container boot
Adds support for `initenv[0-9]*.name` and `initenv[0-9]*` suboptions.
2021-07-29 11:44:57 -04:00
Hugues Fafard
7bc4ba81ff cli: --boot: Completed options for direct kernel boot
Adds support for `acpi.table` and `acpi.table.type` suboptions.
2021-07-29 11:44:57 -04:00
Hugues Fafard
0a856179a5 cli: --boot: Completed options for host-based bootloader
Adds support for `bootloader_args` suboption
2021-07-29 11:44:57 -04:00
Hugues Fafard
a24cdd1964 cli: --boot: Completed options for guest-based bootloader
Adds support for `bootmenu.timeout` suboption.
2021-07-29 11:44:57 -04:00
Hugues Fafard
f067435e2a cli: --input: make source.repeat on/off type option 2021-07-28 14:49:52 -04:00
Hugues Fafard
b987613106 cli: --boot: add support of firmware features
libvirt 7.2.0 introduced support for a list of firmware features
that should or should not be present. Libvirt takes these into
account when auto-selecting a firmware. Currently supported features
are `enrolled-keys` and `secure-boot`.
2021-07-28 09:46:16 -04:00
Hugues Fafard
9028d728f8 cli: --input: add support for evdev inputs
This adds support for evdev inputs which were introduced in 7.4.0,
as well as passthrough inputs and some other misc options to complete
the --input command.

New suboptions:
* source.evdev
* source.dev
* source.repeat
* source.grab
* source.grabToggle
* model
2021-07-27 16:04:15 -04:00
Hugues Fafard
20d2376b18 cli: --shmem: added support for shared memory devices
This includes support for the following suboptions:
* name              (<shmem name=X>)
* role              (<shmem role=X>)
* model.type        (<shmem><model type=X/>)
* size              (<shmem><size>X)
* size.unit         (<shmem><size unit=X/>)
* server.path       (<shmem><server path=X/>)
* msi.vectors       (<shmem><msi vectors=X/>)
* msi.ioeventfd     (<shmem><msi ioeventfd=X/>)
2021-07-27 15:55:00 -04:00
Cole Robinson
6e9b6bff30 cli: --memdev: add uuid= option
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-07-27 13:01:14 -04:00
Hugues Fafard
ddcca8f585 cli: --disk: add support for driver.queues config 2021-07-27 08:38:09 -04:00
Hugues Fafard
c2f629fc03 cli: --cputune: add iothreadpin[0-9]* config
This adds the following suboptions to configure the
<domain><cputune><iothreadpin> list:

* iothreadpin[0-9]*.iothread
* iothreadpin[0-9]*.cpuset
2021-07-27 08:28:10 -04:00
Hugues Fafard
f0f7ae2d1c cli: --cputune: add emulatorpin.cpuset config
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2021-07-26 14:12:36 -04:00
Michal Privoznik
351667a354 virtinst: Support missing NVDIMM knobs
There are two domain XML knobs specific to NVDIMMs that
virt-install doesn't allow to set: <pmem/> and <alignsize/>.
Implement them.

Closes: https://github.com/virt-manager/virt-manager/issues/267
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2021-06-22 12:47:28 -04:00
Han Han
38dd57284f cli: --feature: Support kvm.poll-control.state
Implement kvm.poll-control.state to `virt-install --feature`. It requires
libvirt >= v6.10.0.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Han Han <hhan@redhat.com>
2021-05-28 15:43:38 -04:00
Han Han
a1ddd23c89 virtinst: Support transient.shareBacking option
Implement "<transient shareBacking=yes/>" to virtinst to allow a transient disk
to be shared across VMs. It is introduced to libvirt since:

75871da0ec    qemu: Allow <transient> disks with images shared accross
VMs

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Han Han <hhan@redhat.com>
2021-05-26 19:04:07 -04:00
Han Han
8ef556773d virtinst: Implement support for transient disks
Since libvirt v6.9, the element <transient/> is to configure a disk
which discards its changes while VM was active. Support this element
by cmdline option `--disk ...,transient=on`.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Han Han <hhan@redhat.com>
2021-05-26 19:04:07 -04:00
Han Han
dfd40733f1 virtinst: Support rotation_rate attrib in target
Support rotation_rate attrib which is introduced since libvirt v7.3.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Han Han <hhan@redhat.com>
2021-05-23 17:39:55 -04:00
Jonathan Schwender
f9a0c3ccb2 cli: --cputune: add vcpusched[0-9]* config
This adds the following suboptions to configure <cputune>:

- vcpusched.vcpus
- vcpusched.scheduler
- vcpusched.priority

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2021-02-16 16:37:15 -05:00
Cole Robinson
56cb813d42 cli: Add --tpm persistent_state=
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-01-24 18:54:54 -05:00
Cole Robinson
2862f1be98 cli: Add --memballoon freePageReporting=
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-01-24 18:49:55 -05:00
Cole Robinson
5c1ace02c9 cli: Add --sound audio.id=
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-01-24 18:48:09 -05:00
Cole Robinson
d3517ded62 cli: Add --filesystem fmode, dmode
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-01-24 18:46:47 -05:00
Igor Ryzhov
ac9316cce1 virtinst: add support for controller target subelement
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-11-21 14:47:22 -05:00
Cole Robinson
3d07b28a36 device: disk: Rename path property to get/set_source_path
This makes it more clear that 'path' is really a special designation
with a bunch of complicated logic behind it. It's also easier to
grep for

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-11 19:06:32 -05:00
Cole Robinson
b3ff59c75c device: disk: Move <source> XML handling to its own class
Makes DeviceDisk less complicated, helps with readability

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-11 18:07:50 -05:00