[PATCH 0/8] qemuMigrationDstPrepareStorage: Refactor and fix for VDPA storage
by Peter Krempa
Peter Krempa (8):
qemuMigrationDstPrepareStorage: Use 'switch' statement to include all
storage types
qemuMigrationDstPrepareStorage: Properly consider path for 'vdpa'
devices
qemuMigrationDstPrecreateDisk: Refactor cleanup
qemuMigrationDstPrepareStorage: Move block device specific logic
qemuMigrationDstPrepareStorage: Rework storage existence check
qemuMigrationDstPrepareStorage: Reject migration into 'dir' and
'vhost-user' types
qemuMigrationDstPrepareStorage: Move assumption that 'network' disks
always exist
qemuMigrationDstPrepareStorage: Annotate that existance of 'volume'
disks is checked elswhere
src/qemu/qemu_migration.c | 117 +++++++++++++++++++++-----------------
1 file changed, 66 insertions(+), 51 deletions(-)
--
2.43.0
9 months
[PATCH] domain_validate: Account for NVDIMM label size properly when checking for memory conflicts
by Michal Privoznik
As of v9.8.0-rc1~7 we check whether two <memory/> devices don't
overlap (since we allow setting where a <memory/> device should
be mapped to). We do this pretty straightforward, by comparing
start and end address of each <memory/> device combination.
But since only the start address is given (an exposed in the
XML), the end address is computed trivially as:
start + mem->size * 1024
And for majority of memory device types this works. Except for
NVDIMMs. For them the <memory/> device consists of two separate
regions: 1) actual memory device, and 2) label.
Label is where NVDIMM stores some additional information like
namespaces partition and so on. But it's not mapped into the
guest the same way as actual memory device. In fact, mem->size is
a sum of both actual memory device and label sizes. And to make
things a bit worse, both sizes are subject to alignment (either
the alignsize value specified in XML, or system page size if not
specified in XML).
Therefore, to get the size of actual memory device we need to
take mem->size and substract label size rounded up to alignment.
If we don't do this we report there's an overlap between two
NVDIMMs even when in reality there's none.
Resolves: https://issues.redhat.com/browse/RHEL-4452?focusedId=23805174#comment-238...
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/domain_validate.c | 50 ++++++++++++++++++++++++++++++++++++--
1 file changed, 48 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index 46479f10f2..5a9398b545 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -2225,6 +2225,52 @@ virDomainHostdevDefValidate(const virDomainHostdevDef *hostdev)
}
+/**
+ * virDomainMemoryGetMappedSize:
+ * @mem: memory device definition
+ *
+ * For given memory device definition (@mem) calculate size mapped into
+ * the guest. This is usually mem->size, except for NVDIMM where its
+ * label is mapped elsewhere.
+ *
+ * Returns: Number of bytes a memory device takes when mapped into a
+ * guest.
+ */
+static unsigned long long
+virDomainMemoryGetMappedSize(const virDomainMemoryDef *mem)
+{
+ unsigned long long ret = mem->size;
+
+ if (mem->model == VIR_DOMAIN_MEMORY_MODEL_NVDIMM) {
+ unsigned long long alignsize = mem->source.nvdimm.alignsize;
+ unsigned long long labelsize = 0;
+
+ /* For NVDIMM the situation is a bit more complicated. Firstly,
+ * its <label/> is not mapped as a part of memory device, so we
+ * must subtract label size from NVDIMM size. Secondly, label is
+ * also subject to alignment so we need to round it up before
+ * subtraction. */
+
+ if (alignsize == 0) {
+ long pagesize = virGetSystemPageSizeKB();
+
+ /* If no alignment is specified in the XML, fallback to
+ * system page size alignment. */
+ if (pagesize > 0)
+ alignsize = pagesize;
+ }
+
+ if (alignsize > 0) {
+ labelsize = VIR_ROUND_UP(mem->target.nvdimm.labelsize, alignsize);
+
+ ret -= labelsize;
+ }
+ }
+
+ return ret * 1024;
+}
+
+
static int
virDomainMemoryDefCheckConflict(const virDomainMemoryDef *mem,
const virDomainDef *def)
@@ -2259,7 +2305,7 @@ virDomainMemoryDefCheckConflict(const virDomainMemoryDef *mem,
}
/* thisStart and thisEnd are in bytes, mem->size in kibibytes */
- thisEnd = thisStart + mem->size * 1024;
+ thisEnd = thisStart + virDomainMemoryGetMappedSize(mem);
for (i = 0; i < def->nmems; i++) {
const virDomainMemoryDef *other = def->mems[i];
@@ -2316,7 +2362,7 @@ virDomainMemoryDefCheckConflict(const virDomainMemoryDef *mem,
if (thisStart == 0 || otherStart == 0)
continue;
- otherEnd = otherStart + other->size * 1024;
+ otherEnd = otherStart + virDomainMemoryGetMappedSize(other);
if ((thisStart <= otherStart && thisEnd > otherStart) ||
(otherStart <= thisStart && otherEnd > thisStart)) {
--
2.43.0
9 months
[PATCH] NEWS: Announce support for /dev/userfaultfd
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
NEWS.rst | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 15b0da31b6..cf9692130a 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -17,6 +17,12 @@ v10.1.0 (unreleased)
* **New features**
+ * qemu: Add support for /dev/userfaultfd
+
+ On hosts with new enough kernel which supports /dev/userfaultfd libvirt will
+ now automatically grant QEMU access to this device. It's no longer needed to
+ set vm.unprivileged_userfaultfd sysctl.
+
* qemu: Support clusters in CPU topology
It is now possible to configure the guest CPU topology to use clusters.
--
2.43.2
9 months
[PATCH 0/1] Expose availability of SEV-ES
by Takashi Kajinami
This introduces the new "model" field in sev elements so that clients can
check whether SEV-ES, the 2nd generation of AMD SEV, is available in
the taget hyprvisor.
Takashi Kajinami (1):
Expose available AMD SEV models in domain capabilities
src/conf/domain_capabilities.c | 2 +
src/conf/domain_capabilities.h | 1 +
src/conf/domain_conf.c | 7 +++
src/conf/domain_conf.h | 8 ++++
src/qemu/qemu_capabilities.c | 78 ++++++++++++++++++++++++----------
5 files changed, 74 insertions(+), 22 deletions(-)
--
2.43.0
9 months
Plans for 10.1.0 release (freeze on Monday 26 Feb)
by Jiri Denemark
We are getting close to 10.1.0 release of libvirt. To aim for the
release on Friday 01 Mar I suggest entering the freeze on Monday 26
Feb and tagging RC2 on Wednesday 28 Feb.
I hope this works for everyone.
Jirka
9 months
[PATCH v2 00/17] qemu: Improve handling of architecture-specific defaults
by Andrea Bolognani
Changes from [v1]:
* several patches have been pushed;
* of the remaining changes, only the ones related to SCSI and USB
controllers have been retained. I still intend to pursue the
rest, but those two are where the real nasty stuff happens, so
I'm focusing on them only for now;
* improve the handling of USB controllers on s390x;
* make all the code dealing with the legacy USB controller obsolete
and get rid of it;
* use out arguments to return models, making the new helpers fall
in line with the usual libvirt API conventions.
[v1] https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/G5...
Andrea Bolognani (17):
tests: Add controller-scsi-default-unavailable
qemu: Rename qemuDomainDefaultSCSIControllerModel()
qemu: Move error reporting out of
qemuDomainDefaultSCSIControllerModel()
qemu: Improve qemuDomainDefaultSCSIControllerModel()
qemu: Clean up qemuDomainDefaultSCSIControllerModel()
qemu: Use virtio-scsi by default on RISC-V
tests: Add usb-legacy-multiple
tests: Add usb-legacy-device
qemu: Always default to no USB controller on s390x
qemu: Only use legacy USB controller if actually needed
qemu: Validate USB controllers earlier
qemu: Improve error message for USB controller validation
qemu: Drop all code dealing with the legacy USB controller
qemu: Add qemuDomainDefaultUSBControllerModel()
qemu: Extend qemuDomainDefaultUSBControllerModel()
qemu: Clean up qemuDomainDefaultUSBControllerModel()
qemu: Use qemu-xhci by default on RISC-V
src/qemu/qemu_command.c | 145 +--------
src/qemu/qemu_domain.c | 300 +++++++++++++-----
src/qemu/qemu_domain.h | 6 +-
src/qemu/qemu_hotplug.c | 21 +-
src/qemu/qemu_validate.c | 69 +++-
.../qemuhotplug-base-ccw-live+ccw-virtio.xml | 5 +-
...with-2-ccw-virtio+ccw-virtio-1-reverse.xml | 5 +-
...otplug-base-ccw-live-with-2-ccw-virtio.xml | 5 +-
...-with-ccw-virtio+ccw-virtio-2-explicit.xml | 5 +-
...-ccw-live-with-ccw-virtio+ccw-virtio-2.xml | 5 +-
...uhotplug-base-ccw-live-with-ccw-virtio.xml | 5 +-
.../qemuhotplug-base-ccw-live.xml | 5 +-
.../arm-vexpressa9-basic.aarch64-latest.args | 1 -
.../arm-vexpressa9-nodevs.aarch64-latest.args | 1 -
.../arm-vexpressa9-virtio.aarch64-latest.args | 1 -
...scsi-default-unavailable.x86_64-latest.err | 1 +
.../controller-scsi-default-unavailable.xml | 15 +
.../disk-arm-virtio-sd.aarch64-latest.args | 1 -
...ault-models.riscv64-latest.abi-update.args | 12 +-
...fault-models.riscv64-latest.abi-update.xml | 25 +-
...64-virt-default-models.riscv64-latest.args | 12 +-
...v64-virt-default-models.riscv64-latest.xml | 25 +-
.../s390-usb-address.s390x-latest.xml | 6 +-
.../sparc-minimal.sparc-latest.args | 1 -
...ault-unavailable-i440fx.x86_64-latest.args | 33 --
...fault-unavailable-i440fx.x86_64-latest.err | 1 +
...fault-unavailable-i440fx.x86_64-latest.xml | 31 --
...-default-unavailable-q35.x86_64-latest.err | 2 +-
...-default-unavailable-q35.x86_64-latest.xml | 33 --
...ntroller-implicit-isapc.x86_64-latest.args | 1 -
...ler-nec-xhci-unavailable.x86_64-latest.xml | 33 --
.../usb-legacy-device.x86_64-latest.err | 1 +
tests/qemuxmlconfdata/usb-legacy-device.xml | 15 +
.../usb-legacy-multiple.x86_64-latest.err | 1 +
tests/qemuxmlconfdata/usb-legacy-multiple.xml | 15 +
tests/qemuxmlconftest.c | 28 +-
36 files changed, 418 insertions(+), 453 deletions(-)
create mode 100644 tests/qemuxmlconfdata/controller-scsi-default-unavailable.x86_64-latest.err
create mode 100644 tests/qemuxmlconfdata/controller-scsi-default-unavailable.xml
delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-i440fx.x86_64-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-i440fx.x86_64-latest.err
delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-i440fx.x86_64-latest.xml
delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-q35.x86_64-latest.xml
delete mode 100644 tests/qemuxmlconfdata/usb-controller-nec-xhci-unavailable.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/usb-legacy-device.x86_64-latest.err
create mode 100644 tests/qemuxmlconfdata/usb-legacy-device.xml
create mode 100644 tests/qemuxmlconfdata/usb-legacy-multiple.x86_64-latest.err
create mode 100644 tests/qemuxmlconfdata/usb-legacy-multiple.xml
--
2.43.0
9 months
[PATCH 0/3] syntax-check: Sync with gnulib, some tweaks
by Andrea Bolognani
One might see patch 3/3 and think hey, it would actually be nice if
developers were getting warned that some checks haven't been executed
because a tool is missing! And I completely agree.
However, since meson needs to see an exit code of 77 to mark a test
as skipped, and make return codes are in the range 0-2, making that
happen would require taking the cppi/flake8/black checks out of the
current scaffolding and wrap them in some other way. I have no
intention to shave that specific yak today O:-)
Andrea Bolognani (3):
all: Don't use 'grep -q'
syntax-check: Sync with gnulib
syntax-check: Drop 'syntax-check' target
build-aux/syntax-check.mk | 33 ++++++++-------------------------
libvirt.spec.in | 2 +-
tests/virsh-uriprecedence | 2 +-
tests/virt-aa-helper-test | 2 +-
4 files changed, 11 insertions(+), 28 deletions(-)
--
2.43.0
9 months
[PATCH] Set stubDriverName from hostdev driver model attribute during pci device setup
by Laine Stump
commit v9.10.0-129-g8b93d78c83 (first appearing in libvirt-10.0.0) was
supposed to allow forcing a PCI hostdev to be bound to a particular
driver by adding <driver model='blah'/> to the XML for the
device. Unfortunately, a single line was missed during the final
changes to the patch prior to pushing, and the result was that the
driver model could be set to *anything* and it would be accepted but
just ignored.
This patch adds the missing line, which will set the stubDriverName
field of the virPCIDevice object from the hostdev object as the
virPCIDevice is being created. This ends up being used by
virPCIDeviceBindToStub() as the driver that it binds the device to.
Fixes: 8b93d78c8325f1fba5db98848350f3db43f5e7d5
Signed-off-by: Laine Stump <laine(a)redhat.com>
---
src/hypervisor/virhostdev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/hypervisor/virhostdev.c b/src/hypervisor/virhostdev.c
index 40f8a4bc2c..53327f4f4d 100644
--- a/src/hypervisor/virhostdev.c
+++ b/src/hypervisor/virhostdev.c
@@ -242,6 +242,8 @@ virHostdevGetPCIHostDevice(const virDomainHostdevDef *hostdev,
return -1;
virPCIDeviceSetManaged(actual, hostdev->managed);
+ virPCIDeviceSetStubDriverName(actual, pcisrc->driver.model);
+
if (pcisrc->driver.name == VIR_DEVICE_HOSTDEV_PCI_DRIVER_NAME_VFIO) {
virPCIDeviceSetStubDriverType(actual, VIR_PCI_STUB_DRIVER_VFIO);
--
2.43.0
9 months
[PATCH 0/2] Introduce mshv Hypervisor type.
by Praveen K Paladugu
These patches introduce 'mshv' hypervisor type and check for the hypervisor
device on host while starting ch guests.
Praveen K Paladugu (2):
conf: Introduce mshv hypervisor type
ch: Check for hypervisor while starting guests
src/ch/ch_conf.c | 2 ++
src/ch/ch_driver.c | 7 +++++++
src/ch/ch_process.c | 34 ++++++++++++++++++++++++++++++++++
src/conf/domain_conf.c | 1 +
src/conf/domain_conf.h | 1 +
src/qemu/qemu_command.c | 1 +
6 files changed, 46 insertions(+)
--
2.43.0
9 months, 1 week