1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-08-22 01:50:06 +03:00

Compare commits

...

8 Commits

Author SHA1 Message Date
d8a915bcec Release of libvirt-8.2.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-04-01 12:23:38 +02:00
bea451be12 NEWS: Document some contributions
Document either my contributions or commits I helped review for
the upcoming release.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2022-04-01 11:45:31 +02:00
3c22f80dc6 NEWS: Mention 'manual' snapshots and FD passing for 'virsh qemu-monitor-command'
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2022-04-01 11:43:59 +02:00
75134a3a7d checkpoint: Fix a typo of comments
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2022-04-01 07:14:19 +02:00
d5f81479a6 virsh: Fix integer overflow in allocpages
I've came across an aarch64 system which supports hugepages up to
16GiB of size. However, I was unable to allocate them using
virsh allocpages. This is because cmdAllocpages() uses
vshCommandOptScaledInt(), which scales passed value into bytes,
but since the virNodeAllocPages() expects size in KiB the
variable holding bytes is then divided by 1024. However, the
limit for the biggest value passed to vshCommandOptScaledInt() is
UINT_MAX which is now obviously wrong, as it needs to be UINT_MAX
* 1024.

The same bug is in completer. But here, let's use ULLONG_MAX so
that we don't have to care about it anymore.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-03-31 14:33:40 +02:00
49156f8070 Fix spelling
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-03-31 11:31:08 +02:00
3832db2108 qemu: fix hotplug for multiqueue vdpa net device
While commit a5e659f0 removed the restriction against multiple queues
for the vdpa net device, there were some missing pieces. Configuring a
device statically and then starting the domain worked as expected, but
hotplugging a device didn't have the expected multiqueue support
enabled. Add the missing bits.

Consider the following device xml:
    <interface type="vdpa">
      <mac address="00:11:22:33:44:03" />
      <source dev="/dev/vhost-vdpa-0" />
      <model type="virtio" />
      <driver queues='2' />
    </interface>

Without this patch, hotplugging the above XML description resulted in
the following:
    {"execute":"netdev_add","arguments":{"type":"vhost-vdpa","vhostdev":"/dev/fdset/0","id":"hostnet1"},"id":"libvirt-392"}
    {"execute":"device_add","arguments":{"driver":"virtio-net-pci","netdev":"hostnet1","id":"net1","mac":"00:11:22:33:44:03","bus":"pci.5","addr":"0x0"},"id":"libvirt-393"}

With the patch, hotplugging results in the following:
    {"execute":"netdev_add","arguments":{"type":"vhost-vdpa","vhostdev":"/dev/fdset/0","queues":2,"id":"hostnet1"},"id":"libvirt-392"}
    {"execute":"device_add","arguments":{"driver":"virtio-net-pci","mq":true,"vectors":6,"netdev":"hostnet1","id":"net1","mac":"00:11:22:33:44:03","bus":"pci.5","addr":"0x0"},"id":"libvirt-393"}

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

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-03-30 10:14:28 -05:00
7767454267 fix documentation for sockets topology
In 0895a0e, it was noted that the "sockets" value in the topology
section of capabilities reflects not the number of sockets per NUMA
node, not the total number.

Unfortunately, the fix was applied to the wrong place: the domain XML
format documentation, not that for the capabilities output. And, in
fact, the domain XML interprets "sockets" as the total number, not a
per-node value.

Back out this change in favour of a note in the capabilities
documentation instead.

Fixes: 0895a0e75d
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: John Levon <john.levon@nutanix.com>
2022-03-30 15:51:57 +01:00
13 changed files with 93 additions and 25 deletions

View File

@ -8,15 +8,23 @@ the changes introduced by each of them.
For a more fine-grained view, use the `git log`_.
v8.2.0 (unreleased)
v8.2.0 (2022-04-01)
===================
* **Security**
* **Removed features**
* **New features**
* qemu: Introduce ``manual`` disk snapshot mode
This new mode allows users to synchronize libvirt snapshots with snapshots
which need to be done outside of libvirt e.g. when 'vhost-user-blk' is used
to back the disk.
* Introduce memory allocation threads
When starting a QEMU guest, libvirt can now instruct QEMU to allocate
guest's memory in parallel. This may be handy when guest has large amounts
of memory.
* **Improvements**
* qemu: ``VIR_MIGRATE_PARAM_TLS_DESTINATION`` now works with non-shared storage migration
@ -32,11 +40,61 @@ v8.2.0 (unreleased)
specify the overrides instead of relying on the argv passthrough of the
``-set`` qemu commandline option which no longer works with new qemu.
* qemu: Allow passing file descriptors to ``virsh qemu-monitor-command``
Passing FDs allows users wanting to experiment with qemu driven by libvirt
use commands like ``add-fd`` properly.
* libxl: Turn on user aliases
Users can now use so called user aliases for XEN domains.
* Implement support for FUSE3
The LXC driver uses fuse to overwrite some lines in ``/proc/meminfo``
inside containers so that they see correct amount of memory given to them.
The code was changed so that both ``fuse`` and ``fuse3`` are supported.
* Improve domain save/restore throughput
Code that's handling save or restore of QEMU domains was changed resulting
in better performance of I/O and thus shortening time needed for the operation.
* **Bug fixes**
* Both build and tests should now pass on Alpine Linux or any other
distribution with musl libc.
* virsh: Fix integer overflow in allocpages
On hosts which support hugepages larger than 1GiB ``virsh allocpages``
failed to accept them because of an integer overflow. This is now fixed.
* qemu: Fix segmentation fault in virDomainUndefineFlags
When a domain without any ``<loader/>`` was being undefined, libvirt has
crashed. This is now fixed.
* lxc: Fix unaligned reads of /proc/meminfo within a container
When /proc/meminfo was read in chunks smaller than the entire file, libvirt
would produce mangled output. While porting the code to FUSE3 this area was
reworked and the file can now be read with any granularity.
* qemu: Be less aggressive around cgroup_device_acl
A basic set of devices common to every domain can be set in ``qemu.conf``
via cgroup_device_acl knob. Devices from this set are allowed in CGroup and
created in domain private namespace for every domain. However, upon device
hotunplug it may have had happened that libvirt mistakenly denied a device
from this set and/or removed it from the namespace. For instance,
/dev/urandom was removed and denied in CGroup on RNG hotunplug.
* nodedev: trigger mdev device definition update on udev add and remove
When nodedev objects are added and removed mdev device definitions are
updated to report correct associated parent.
v8.1.0 (2022-03-01)
===================

View File

@ -62,7 +62,7 @@ centos-stream-8-tests:
variables:
# needed by libvirt-gitlab-executor
DISTRO: centos-stream-8
# can be overriden in forks to set a different runner tag
# can be overridden in forks to set a different runner tag
LIBVIRT_CI_INTEGRATION_RUNNER_TAG: redhat-vm-host
tags:
- $LIBVIRT_CI_INTEGRATION_RUNNER_TAG
@ -78,7 +78,7 @@ centos-stream-9-tests:
variables:
# needed by libvirt-gitlab-executor
DISTRO: centos-stream-9
# can be overriden in forks to set a different runner tag
# can be overridden in forks to set a different runner tag
LIBVIRT_CI_INTEGRATION_RUNNER_TAG: redhat-vm-host
tags:
- $LIBVIRT_CI_INTEGRATION_RUNNER_TAG
@ -94,7 +94,7 @@ fedora-34-tests:
variables:
# needed by libvirt-gitlab-executor
DISTRO: fedora-34
# can be overriden in forks to set a different runner tag
# can be overridden in forks to set a different runner tag
LIBVIRT_CI_INTEGRATION_RUNNER_TAG: redhat-vm-host
tags:
- $LIBVIRT_CI_INTEGRATION_RUNNER_TAG
@ -110,7 +110,7 @@ fedora-35-tests:
variables:
# needed by libvirt-gitlab-executor
DISTRO: fedora-35
# can be overriden in forks to set a different runner tag
# can be overridden in forks to set a different runner tag
LIBVIRT_CI_INTEGRATION_RUNNER_TAG: redhat-vm-host
tags:
- $LIBVIRT_CI_INTEGRATION_RUNNER_TAG

View File

@ -589,13 +589,13 @@ specific properties of devices instantiated by libvirt.
The ``<qemu:device>`` sub-element groups overrides for a device identified via
the ``alias`` attribute. The alias corresponds to the ``<alias name=''>``
property of a device. It's strongly recommended to use user-specified aliases
for devices with overriden properties.
for devices with overridden properties.
Sub element ``<qemu:frontend>`` encapsulates all overrides of properties for the
device frontend and overrides what libvirt formats via ``-device``.
:since:`Since 8.2.0`.
The individual properties are overriden by a ``<qemu:property>`` element. The
The individual properties are overridden by a ``<qemu:property>`` element. The
``name`` specifies the name of the property to override. In case when libvirt
doesn't configure the property a property with the name is added to the
commandline. The ``type`` attribute specifies a type of the argument used. The
@ -612,7 +612,7 @@ remove a device property which is not formatted by libvirt will cause failure
to startup the VM.
*Note:* The libvirt project doesn't guarantee any form of compatibility and
stability of devices with overriden properties. The domain is tainted when
stability of devices with overridden properties. The domain is tainted when
such configuration is used.
Example:

View File

@ -51,7 +51,10 @@
<dt><code>topology</code></dt>
<dd>This element embodies the host internal topology. Management
applications may want to learn this information when orchestrating new
guests - e.g. due to reduce inter-NUMA node transfers.</dd>
guests - e.g. due to reduce inter-NUMA node transfers. Note that the
<code>sockets</code> value reported here is per-NUMA-node; this is in
contrast to the value given in domain definitions, which is interpreted
as a total number of sockets for the domain.</dd>
<dt><code>secmodel</code></dt>
<dd>To find out default security labels for different security models you

View File

@ -1489,12 +1489,12 @@ In case no restrictions need to be put on CPU model and its features, a simpler
The ``topology`` element specifies requested topology of virtual CPU provided
to the guest. Four attributes, ``sockets``, ``dies``, ``cores``, and
``threads``, accept non-zero positive integer values. They refer to the
number of CPU sockets per NUMA node, number of dies per socket, number of
cores per die, and number of threads per core, respectively. The ``dies``
attribute is optional and will default to 1 if omitted, while the other
attributes are all mandatory. Hypervisors may require that the maximum number
of vCPUs specified by the ``cpus`` element equals to the number of vcpus
resulting from the topology.
total number of CPU sockets, number of dies per socket, number of cores per
die, and number of threads per core, respectively. The ``dies`` attribute is
optional and will default to 1 if omitted, while the other attributes are all
mandatory. Hypervisors may require that the maximum number of vCPUs specified
by the ``cpus`` element equals to the number of vcpus resulting from the
topology.
``feature``
The ``cpu`` element can contain zero or more ``feature`` elements used to
fine-tune features provided by the selected CPU model. The list of known

View File

@ -248,7 +248,7 @@ virDomainCheckpointGetXMLDesc(virDomainCheckpointPtr checkpoint,
* @checkpoints: pointer to variable to store the array containing checkpoint
* object, or NULL if the list is not required (just returns
* number of checkpoints)
* @flags: bitwise-OR of supported virDomainCheckpoinListFlags
* @flags: bitwise-OR of supported virDomainCheckpointListFlags
*
* Collect the list of domain checkpoints for the given domain and allocate
* an array to store those objects.

View File

@ -642,7 +642,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
QEMU_CAPS_DIRTYRATE_MODE , /* calc-dirty-rate accepts mode parameter */
/* 425 */
QEMU_CAPS_BLOCKDEV_NBD_TLS_HOSTNAME, /* tls hostname can be overriden for NBD clients */
QEMU_CAPS_BLOCKDEV_NBD_TLS_HOSTNAME, /* tls hostname can be overridden for NBD clients */
QEMU_CAPS_MEMORY_BACKEND_PREALLOC_THREADS, /* -object memory-backend-*.prealloc-threads */
QEMU_CAPS_LAST /* this must always be the last item */

View File

@ -4346,6 +4346,10 @@ qemuBuildHostNetProps(virDomainNetDef *net,
if (virJSONValueObjectAdd(&netprops, "s:type", "vhost-vdpa", NULL) < 0 ||
virJSONValueObjectAppendString(netprops, "vhostdev", vdpadev) < 0)
return NULL;
if (net->driver.virtio.queues > 1 &&
virJSONValueObjectAppendNumberUlong(netprops, "queues", net->driver.virtio.queues) < 0)
return NULL;
break;
case VIR_DOMAIN_NET_TYPE_HOSTDEV:

View File

@ -3368,7 +3368,7 @@ qemuDomainDefNamespaceParseOverrideProperties(qemuDomainXmlNsOverrideProperty *p
if (STREQ(prop->name, "id")) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("property with name 'id' can't be overriden"));
_("property with name 'id' can't be overridden"));
return -1;
}

View File

@ -1386,6 +1386,9 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
break;
case VIR_DOMAIN_NET_TYPE_VDPA:
queueSize = net->driver.virtio.queues;
if (!queueSize)
queueSize = 1;
if (qemuDomainAdjustMaxMemLock(vm, false) < 0)
goto cleanup;
adjustmemlock = true;

View File

@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-boot strict=on \
-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
-add-fd set=0,fd=1732,opaque=net0-vdpa \
-netdev vhost-vdpa,vhostdev=/dev/fdset/0,id=hostnet0 \
-netdev vhost-vdpa,vhostdev=/dev/fdset/0,queues=2,id=hostnet0 \
-device '{"driver":"virtio-net-pci","mq":true,"vectors":6,"netdev":"hostnet0","id":"net0","mac":"52:54:00:95:db:c0","bus":"pci.0","addr":"0x2"}' \
-audiodev '{"id":"audio1","driver":"none"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \

View File

@ -42,7 +42,7 @@ virshPagesizeNodeToString(xmlNodePtr node)
unit = virXMLPropString(node, "unit");
if (virStrToLong_ull(pagesize, NULL, 10, &byteval) < 0)
return NULL;
if (virScaleInteger(&byteval, unit, 1024, UINT_MAX) < 0)
if (virScaleInteger(&byteval, unit, 1024, ULLONG_MAX) < 0)
return NULL;
size = vshPrettyCapacity(byteval, &suffix);
ret = g_strdup_printf("%.0f%s", size, suffix);

View File

@ -488,7 +488,7 @@ cmdAllocpages(vshControl *ctl, const vshCmd *cmd)
if (cellno && vshCommandOptInt(ctl, cmd, "cellno", &startCell) < 0)
return false;
if (vshCommandOptScaledInt(ctl, cmd, "pagesize", &tmp, 1024, UINT_MAX) < 0)
if (vshCommandOptScaledInt(ctl, cmd, "pagesize", &tmp, 1024, UINT_MAX * 1024ULL) < 0)
return false;
pageSizes[0] = VIR_DIV_UP(tmp, 1024);