Commit Graph

43509 Commits

Author SHA1 Message Date
Ani Sinha
5ee4f3e1d4 NEWS: document new acpi pci hotplug config option
Added the following new libvirt conf option to the release note to
indicate their availability with the next release:

<feature>
  <pci>
    <acpi-bridge-hotplug state='off|on'/>
  </pci>
</feature>

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-10-10 13:21:46 -04:00
Ani Sinha
bef0f0d8be qemu: command: add support for acpi-bridge-hotplug feature
This change adds backend qemu command line support for new libvirt
global feature 'acpi-bridge-hotplug'. This option can be used as
following:

<feature>
  <pci>
    <acpi-bridge-hotplug state='off|on'/>
  </pci>
</feature>

The '<pci>' sub-element under '<feature>' is also newly introduced.

'acpi-bridge-hotplug' turns on the following command line option to
qemu for x86 guests:

(pc): -global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=<off|on>

(q35): -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=<off|on>

This change also adds the required qemuxml2argv unit tests in order to
test correct qemu arguments. Unit tests have also been added to test
qemu capability validation checks as well as checks for using this
option with the right architecture.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-10-10 13:21:04 -04:00
Ani Sinha
7300ccc9b3 conf: introduce support for acpi-bridge-hotplug feature
This change introduces a new libvirt sub-element <pci> under
<features> that can be used to configure all pci related features.
Currently the only sub-sub element supported by this sub-element is
'acpi-bridge-hotplug' as shown below:

<features>
  <pci>
    <acpi-bridge-hotplug state='on|off'/>
  </pci>
</features>

The above option is only available for the QEMU driver, for x86 guests
only. It is a global option, affecting all PCI bridge controllers on
the guest.

The 'acpi-bridge-hotplug' option enables or disables ACPI hotplug
support for cold-plugged pci bridges. Examples of bridges include the
PCI-PCI bridge (pci-bridge controller) for pc (i440fx) machinetypes,
or PCIe-PCI bridges and pcie-root-port controllers for q35
machinetypes.

For pc machinetypes in x86, this option has been available in QEMU
since version 2.1. Please see the following changes in qemu repo:

9e047b982452c6 ("piix4: add acpi pci hotplug support")
133a2da488062e ("pc: acpi: generate AML only for PCI0 devices if PCI
               bridge hotplug is disabled")

For q35 machinetypes, this was introduced in QEMU 6.1 with the
following changes in qemu repo:

(a) c0e427d6eb5fef ("hw/acpi/ich9: Enable ACPI PCI hot-plug")
(b) 17858a16950860 ("hw/acpi/ich9: Set ACPI PCI hot-plug as default on
                   Q35")

The reasons for enabling ACPI based hotplug for PCIe (q35) based
machines (as opposed to native hotplug) are outlined in (b). There are
use cases where users would still want to use native
hotplug. Therefore, this config option enables users to choose either
ACPI based hotplug or native hotplug for bridges (for example for pcie
root port controller in q35 machines).

Qemu capability validation checks have also been added along with
related unit tests to exercise the new conf option.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-10-10 13:13:45 -04:00
Ani Sinha
58ba0f6a3d qemu: capablities: detect acpi-pci-hotplug-with-bridge-support
qemu added support for i440fx specific global boolean flag

PIIX4_PM.acpi-pci-hotplug-with-bridge-support

around version 2.1. This flag is enabled by default. When disabled, it
turns off acpi pci hotplug for cold plugged pci bridges in i440fx
machine types.

Very recently, in qemu version 6.1, the same global option was also
added for q35 machine types as well.

ICH9-LPC.acpi-pci-hotplug-with-bridge-support

This option turns on or off acpi based hotplug for cold plugged pcie
bridges like pcie root ports. This flag is also enabled by
default. Please refer to the following qemu changes:

c0e427d6eb5fef ("hw/acpi/ich9: Enable ACPI PCI hot-plug")
17858a16950860 ("hw/acpi/ich9: Set ACPI PCI hot-plug as default on Q35")

This patch adds the corresponding qemu capabilities in libvirt. For
i440fx, the capability is detected as
QEMU_CAPS_PIIX_ACPI_HOTPLUG_BRIDGE. For q35, the capability is
detected as QEMU_CAPS_ICH9_ACPI_HOTPLUG_BRIDGE.

Please note that the test specific qemu capabilities .replies files
has already been updated as a part of regular refreshing them when a
new qemu version is released. Hence, no updates to those files are
required.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-10-10 13:12:50 -04:00
Michal Privoznik
5de203f879 vireventglib: Remove handles with the highest priority
When a server decides to close a client, the
virNetServerClientCloseLocked() is called. In here various
cleanup steps are taken, but the most important part (from this
commit's POV at least) is the way that the socket is closed.
Firstly, removal of the socket associated with the client from
the event loop is signalized and then the socket is unrefed. The
socket is not closed just yet though, because the event loop
holds a reference to it. This reference will be freed as soon as
the event loop wakes up and starts issuing callbacks (in this
case virNetSocketEventFree()).

So far, this is how things usually work. But if the daemon
reaches the number of opened files limit, things start to work
differently.

If the RLIMIT_NOFILE limit is reached and there's a client that
wants to connect then the event loop wakes up, sees POLLIN on the
socket and calls virNetServerServiceAccept() which in turn calls
virNetSocketAccept(). But because of the limit, accept() fails
with EMFILE leaving the POLLIN event unhandled. The dispatch then
continues to next FDs with events on them. BUT, it will NOT call
the socket removal callback (virNetSocketEventFree()) because it
has low priority (G_PRIORITY_DEFAULT_IDLE). Per glib's
documentation:

 * Each event source is assigned a priority. The default priority,
 * %G_PRIORITY_DEFAULT, is 0. Values less than 0 denote higher priorities.
 * Values greater than 0 denote lower priorities. Events from high priority
 * sources are always processed before events from lower priority sources.

and per g_idle_add() documentation:

 * Adds a function to be called whenever there are no higher priority
 * events pending to the default main loop. The function is given the
 * default idle priority, %G_PRIORITY_DEFAULT_IDLE.

Now, because we did not accept() the client we are constantly
seeing POLLIN on the main socket and thus the removal of the
client socket won't ever happen.

The fix is to set at least the same priority as other sources,
but since we want to just close an FD, let's give it the highest
priority and call it before handling other events.

This issue can be easily reproduced, for instance:

 # ulimit -S -n 40 (tweak this number if needed)
 # ./src/libvirtd

from another terminal:

 # for ((i=0; i<100; i++)); do virsh list & done; virsh list

The last `virsh list` must not get stuck.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2007168
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2021-10-10 18:42:15 +02:00
Cole Robinson
1b9ce05ce2 lxc: controller: Fix container launch on cgroup v1
With cgroup v1 I'm seeing LXC container startup failures:

$ sudo virt-install --connect lxc:/// --name test-container --memory 128
--boot init=/bin/sh

Starting install...
ERROR    error from service:
GDBus.Error:org.freedesktop.machine1.NoMachineForPID: PID 2145047 does
not belong to any known machine

libvirt 7.0.0 works but 7.1.0+ does not. The root error seems to predate
that, showing up in syslog, but commit 9c1693eff made it fatal:

commit 9c1693eff4
Author: Pavel Hrdina <phrdina@redhat.com>
Date:   Fri Feb 5 16:17:35 2021 +0100

     vircgroup: use DBus call to systemd for some APIs

The error comes from virSystemdGetMachineByPID. The PID that shows up in
the above error message does not match the leader PID as reported by
machinectl.

This change fixes the error. Things seem to continue to work with
cgroupsv2 after this change.

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

Tested-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-10-08 13:20:46 -04:00
Jim Fehlig
3f9c1a4bb8 tools: Fix virt-host-validate SEV detection
virt-host-validate checks if AMD SEV is enabled by verifying
/sys/module/kvm_amd/parameters/sev is set to '1'. On a system
running kernel 5.13, the parameter is reported as 'Y'. To be
extra paranoid, add a check for 'y' along with 'Y' to complement
the existing check for '1'.

Fixes: https://bugzilla.opensuse.org/show_bug.cgi?id=1188715

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2021-10-06 11:23:24 -06:00
Ján Tomko
b96ca3b848 qemu: export vhost-user-fs-related functions
Prepare for hotplug support.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-10-06 12:03:12 +02:00
Ján Tomko
842ffd1563 qemu: vhost-user-fs: build extdevice for zpci
Other devices (includes 9p-based fsdev) call this wrapper
before formatting the device.

Add it here too.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-10-06 12:03:12 +02:00
Ján Tomko
c172a3733e qemu: alias: prepare qemuAssignDeviceFSAlias for disjunct ranges
Iterate through the array to find the first free index.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-10-06 12:03:12 +02:00
Ján Tomko
0b2a2e84e4 qemu: remove private data from virDomainFSDef
This reverts commit 801e6da29c

They are not needed anymore.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-10-06 12:03:12 +02:00
Ján Tomko
e7801a490c qemu: do not put virtiofs socket in private data
Reconstruct the socket path from priv->libDir in every user.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-10-06 12:03:12 +02:00
Ján Tomko
cf5b3482c1 qemu: vhost-user-fs: separate building of device string
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-10-06 12:03:12 +02:00
Ján Tomko
387e265f90 qemu: vhost-user-fs: separate building of chardev string
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-10-06 12:03:12 +02:00
Ján Tomko
ebdcb2a900 tests: qemuxml2argvtest: fix path to virtiofs socket
The mocked path in the test suite is not in sync with what libvirtd
generates.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-10-06 12:03:12 +02:00
Ján Tomko
1c9d4f9ea3 qemu: domain: introduce qemuDomainGetVHostUserFSSocketPath
Intended as a replacement for qemuVirtioFSCreateSocketFilename,
to be used outside of qemu_virtiofs.c

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-10-06 12:03:12 +02:00
Ján Tomko
be5c15212f conf: define cleanup func for virDomainChrSourceDef
It's defined also for 'virDomainChrDef'

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-10-06 12:03:11 +02:00
Ján Tomko
da4efc5433 qemu: vhost-user-fs: format alias on the command line
The commit adding the vhost-user-fs device forgot to format
the device's alias on the command line.

Thankfully it was not needed yet because virtiofs migration
is not yet supported, but it will be needed in the future
to allow hot(un)plug.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-10-06 12:03:11 +02:00
Andrea Bolognani
001a101a2e tools: Fix typo firemare -> firmware
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2021-10-06 11:14:07 +02:00
Michal Privoznik
1b2e06b1bf virsh: Use VIR_AUTOCLOSE more
There are few places where we can replace explicit
VIR_FORCE_CLOSE() with VIR_AUTOCLOSE annotation.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2021-10-06 09:28:19 +02:00
Michal Privoznik
f427e6c643 virsh: Add wrapper for virStreamFree
Similarly to virshDomainFree add a wrapper for the snapshot object
freeing function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2021-10-06 09:27:43 +02:00
Michal Privoznik
d39bd3998e virsh: Add wrapper for virNWFilterFree
Similarly to virshDomainFree add a wrapper for the snapshot object
freeing function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2021-10-06 09:27:03 +02:00
Michal Privoznik
40a3a5b608 virsh: Add wrapper for virNodeDeviceFree
Similarly to virshDomainFree add a wrapper for the snapshot object
freeing function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2021-10-06 09:26:25 +02:00
Michal Privoznik
db4df06533 virsh: Add wrapper for virNetworkFree
Similarly to virshDomainFree add a wrapper for the snapshot object
freeing function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2021-10-06 09:25:47 +02:00
Michal Privoznik
717b6549d5 virsh: Add wrapper for virStorageVolFree
Similarly to virshDomainFree add a wrapper for the snapshot object
freeing function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2021-10-06 09:25:22 +02:00
Michal Privoznik
663a29f42e virsh: Add wrapper for virStoragePoolFree
Similarly to virshDomainFree add a wrapper for the snapshot object
freeing function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2021-10-06 09:24:17 +02:00
Michal Privoznik
f8fb5be6c8 virsh: Add wrapper for virInterfaceFree
Similarly to virshDomainFree add a wrapper for the snapshot object
freeing function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2021-10-06 09:23:25 +02:00
Michal Privoznik
0c43fcddf2 virsh-util.h: Fix ordering of virshXXXFree functions
Currently the order of virshXXXFree functions in the header file
does not correspond to the order in the corresponding .c file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2021-10-06 09:20:45 +02:00
Michal Privoznik
f60bc4f620 qemu: Check if unpriv_sgio is already set before trying to set it
In case when libvirt runs inside a restricted container it may
not have enough permissions to modify unpriv_sgio. However, it
may have been set beforehand by sysadmin or an orchestration
tool. Therefore, let's check whether the currently set value is
the one we want and if it is refrain from writing to the file.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2010306
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-10-05 14:58:52 +02:00
Michal Privoznik
3ad0690015 virsh: Fix --nvram and --keep-nvram help strings
The --nvram and --keep-nvram options of the undefine command can
be used regardless of the domain status (the only consumer so far
- qemuDomainUndefineFlags() doesn't care about the domain
status). Yet, their corresponding help strings say something
about inactive domains while manpage says nothing. Remove the
reference to domain state.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2007659
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2021-10-05 08:54:32 +02:00
Ani Sinha
400979fd06 qemu: capabilities: remove -en from piix4-acpi-root-hotplug-en
The capability name piix4-acpi-root-hotplug-en is not conventional and
appreared to be confusing to some. "en" suffix is also incorrect as the
capability in qemu is used to both enable and disable hotplug on the pci root
bus on the i440fx. Hence, rename it to piix4.acpi-root-pci-hotplug so that it
is clearer, less confusing and more accurate.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-10-05 00:07:23 -04:00
William Douglas
13fc1432c6 ch: use g_auto in virCHMonitorNew
Also introduces a G_DEFINE_AUTOPTR_CLEANUP_FUNC for virCHMonitor.

Signed-off-by: William Douglas <william.douglas@intel.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-10-05 00:07:23 -04:00
William Douglas
9e99f84328 ch: use g_auto in virCHMonitorBuildKernelRelatedJson
Signed-off-by: William Douglas <william.douglas@intel.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-10-05 00:07:23 -04:00
William Douglas
2ba777f5e3 ch: use g_auto in virCHMonitorBuildMemoryJson
Signed-off-by: William Douglas <william.douglas@intel.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-10-05 00:07:23 -04:00
William Douglas
08bbe36fe4 ch: remove extra unref of domain object during virCHMonitorClose()
It is already being unrefed in virCHMonitorDispose().

Signed-off-by: William Douglas <william.douglas@intel.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-10-05 00:07:23 -04:00
William Douglas
bfaac4c2b1 ch: Correctly ref and close the virCHMonitor in virCHMonitorNew
In virCHMontiorNew the monitor object was referenced an additional
time incorrectly preventing it from being disposed of, and wasn't
always closed properly on failure.

Signed-off-by: William Douglas <william.douglas@intel.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-10-05 00:07:23 -04:00
William Douglas
5abf5949c1 ch_monitor: Stop leaking json value objects
In virCHMonitorBuildKernelRelatedJson there are two cases of json
value objects being lost after the pointer being redefined. This
change removes the needless redefinition.

Signed-off-by: William Douglas <william.douglas@intel.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-10-05 00:07:23 -04:00
Ani Sinha
5ff9e851cb NEWS: cosmetic - fix indentation
The indentation of the first item under the categoty "new features" for the
future release v7.9.0 is not right. Fix it.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2021-10-04 18:10:54 +02:00
Robin Lee
34bf62b0b2 docs: describe flag VIR_STORAGE_POOL_CREATE_NORMAL to correct the HTML doc
This patch makes the descriptions of virStoragePoolCreateFlags annotate to the
correct flag in the generated HTML file.

Signed-off-by: Robin Lee <cheeselee@fedoraproject.org>
2021-10-04 12:03:43 +00:00
simmon
159a64afd1 Translated using Weblate (Korean)
Currently translated at 100.0% (10374 of 10374 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: simmon <simmon@nplob.com>
Signed-off-by: simmon <simmon@nplob.com>
2021-10-01 23:23:11 +02:00
Jan Kuparinen
18c96ca702 Translated using Weblate (Finnish)
Currently translated at 23.0% (2387 of 10374 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/fi/

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
2021-10-01 23:23:11 +02:00
Ani Sinha
1c0aa23a83 NEWS: document new hotplug enable/disable option on pci-root controller
A new 'target' subelement of the pci-root controller has been
introduced having a 'hotplug' property. This property can be used to
turn off or turn on the ability to hotplug/unplug devices to the slots
of the pci-root.

The new element can be used like this:

<controller type='pci' model='pci-root'>
   <target hotplug='off'/>
</controller>

This will turn off hotplug capability on the pci-root ports. To turn
the capability on, we set hotplug='on' above (which is also the
default).

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-10-01 17:18:25 -04:00
Ani Sinha
133d7983d6 qemu: command: add support to enable/disable hotplug on pci-root controller
This change adds qemu backend command line support for enabling or disabling
hotplug on the pci-root controller using the 'target' sub-element of the
pci-root controller as shown below:

<controller type='pci' model='pci-root'>
  <target hotplug='off'/>
</controller>

'<target hotplug='off/on'/>' is only valid for pc (i440fx-based x86)
machinetypes and turns on the following command line option that is passed
to qemu for x86 guests:

-global PIIX4_PM.acpi-root-pci-hotplug=<off/on>

Before introduction of this attribute, hotplug was always enabled for
pci-root of an i440fx-based machinetype, and since its introduction
the default setting has always been "on" for those machinetypes.

This change also adds the required qemuxml2argv unit tests in order to test
correct qemu arguments. Unit tests have also been added to test qemu capability
validation checks.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-10-01 14:42:18 -04:00
Ani Sinha
8eadf82fb5 conf: introduce option to enable/disable pci hotplug on pci-root controller
This change introduces libvirt xml support to enable/disable hotplug on the
pci-root controller. It adds a 'target' subelement for the pci-root controller
with a 'hotplug' property. This property can be used to enable or disable
hotplug for the pci-root controller. For example, in order to disable hotplug
on the pci-root controller, one has to use set '<target hotplug='off'>' as
shown below:

<controller type='pci' model='pci-root'>
  <target hotplug='off'/>
</controller>

'<target hotplug='on'>' option would enable hotplug for pci-root controller.
This is also the default value. This option is only available for pc machine
types and is applicable for qemu/kvm accelerator only.This feature was
introduced from qemu version 5.2 with the following change in qemu repository:

3d7e78aa7777f ("Introduce a new flag for i440fx to disable PCI hotplug on the root bus")

The above qemu commit describes some reasons why users might to disable hotplug
on PCI root buses.

Related unit tests to exercise the new conf option has also been added.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-10-01 14:19:44 -04:00
Ani Sinha
fdec09b00a qemu: capablities: detect presence of acpi-root-pci-hotplug for i440fx machines
The following change in qemu added support for a global boolean flag specific
to i440fx machines that would turn off or on acpi based hotplug for pci root
bus:

3d7e78aa7777f ("Introduce a new flag for i440fx to disable PCI hotplug on the root bus")

The option is passed as "-global PIIX4_PM.acpi-root-pci-hotplug=on" etc in qemu
commandline. It is enabled by default. This patch adds the corresponding qemu
capabilities in libvirt as QEMU_CAPS_PIIX_ACPI_ROOT_PCI_HOTPLUG.

Please note that the test specific qemu capabilities .replies files has already
been updated as a part of regular refreshing them when a new qemu version is
released. Hence, no updates to those files are required.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-10-01 14:19:41 -04:00
Tim Wiederhake
4ad3c95f4b vshCmddefCheckInternals: Fix typo
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-10-01 13:12:23 +02:00
Michal Privoznik
9c1e5a5158 kbase: Document virtio-mem
This commit adds new memorydevices.rst page which should serve
all models of memory devices. Yet, I'm documenting virtio-mem
quirks only.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-10-01 11:05:12 +02:00
Michal Privoznik
2061062594 news: document recent virtio memory addition
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-10-01 11:05:08 +02:00
Michal Privoznik
f72e4edf50 virsh: Introduce update-memory-device command
New 'update-memory-device' command is introduced which aims on
making it user friendly to change <memory/> device. So far I just
need to change <requested/> so I'm introducing --requested-size
only; but the idea is that this is extensible for other cases
too. For instance, want to change <myElement/>? A new
--my-element argument can be easily introduced.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-10-01 11:05:05 +02:00
Michal Privoznik
b1c3b5dfec qemuDomainSetMemoryFlags: Take virtio-mem into consideration
The qemuDomainSetMemoryFlags() allows for memballoon
(<currentMemory/>) changes for both active and inactive guests.
And just before doing any change, we have to make sure that the
new size is not greater than the total memory (<memory/>).

However, the total memory includes not only the regular guest
memory, but also sum of maximum sizes of all virtio-mems (in fact
all memory devices for that matter). But virtio-mem devices are
modified differently (via virDomainUpdateDevice()) and thus the
upper limit for new balloon size has to be lowered.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-10-01 11:05:02 +02:00