[libvirt PATCH 0/2] Fix the failing FreeBSD 13.1 CI build job
by Erik Skultety
failing CI job reference: https://gitlab.com/libvirt/libvirt/-/jobs/4880861477
Even though 13.1 has been marked as EOL and we are rightfully permitted to bump
the version, we can't/shouldn't fix this directly in lcitool just yet, because
libosinfo hasn't caught up on this fact yet and if we just bumped the cirrus
version in the lcitool target OS config without updating the libosinfo ID we'd
create a consistency problem.
However, thanks to Paolo Bonzini's work on lcitool we have an easy workaround
fix at hand where we can override many data-related things in lcitool.
Erik Skultety (2):
ci: Introduce a new 'lcitool' data directory
ci: Udate FreeBSD-13 image with lcitool manifest
ci/gitlab/builds.yml | 2 +-
ci/lcitool/targets/freebsd-13.yml | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
create mode 100644 ci/lcitool/targets/freebsd-13.yml
--
2.41.0
9 months, 1 week
Does libvirt support intra-host migration?
by Eric Wheeler
Hello all:
I looked around for documentation on intra-host KVM migration but haven't
found much. For example, this could be useful to "migrate" VM to run on
an upgraded version of `qemu-kvm` without migrating to a different host
and migrating back.
We tested migrating a VM to the same host on an old version of libvirt
(el7), and it complained about UUID conflicts if the destination already
hosts the same VM.
Changing the name or the UUID in the destination XML during migration
(`virsh migrate --xml`) gives an error that the UUID or name does not
match during migration:
UUID change:
error: unsupported configuration: Target domain uuid 66a113f4-a101-4db1-8478-49cf088fedb9 does not match source b5256b25-e137-45b8-bddb-78545ab55fc4
Name change:
error: unsupported configuration: Target domain name 'diskless2' does not match source 'diskless'
Questions before we do more testing:
- Do modern versions of libvirt support intra-host migration?
- If so, which version?
- Documentation?
Any help you can provide would be greatly appreciated!
--
Eric Wheeler
9 months, 1 week
Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping
by Peter Xu
On Fri, Aug 11, 2023 at 06:25:14PM +0200, David Hildenbrand wrote:
> On 11.08.23 18:22, Peter Xu wrote:
> > On Fri, Aug 11, 2023 at 06:17:05PM +0200, David Hildenbrand wrote:
> > > We wouldn't touch "-mem-path".
> >
> > But still the same issue when someone uses -object memory-backend-file for
> > hugetlb, mapping privately, expecting ram discard to work?
> >
> > Basically I see that example as, "hugetlb" in general made the private
> > mapping over RW file usable, so forbidden that anywhere may take a risk.
>
> These users can be directed to using hugetlb
>
> a) using MAP_SHARED
> b) using memory-backend-memfd, if MAP_PRIVATE is desired
>
> Am I missing any important use case? Are we being a bit to careful about
> virtio-balloon and postcopy simply not being available for these corner
> cases?
The current immediate issue is not really mem=rw + fd=rw + private case
(which was a known issue), but how to make mem=rw + fd=ro + private work
for ThinnerBloger, iiuc.
I'd just think it safer to expose that cap to solve problem A (vm
templating) without affecting problem B (fallcate-over-private not working
right), when B is uncertain.
I'm also copy Daniel & libvirt list in case there's quick comment from
there. Say, maybe libvirt never use private mapping on hugetlb files over
memory-backend-file at all, then it's probably fine.
In all cases, you and Igor should have the final grasp; no stand on a
strong opinon from my side.
--
Peter Xu
9 months, 1 week
[libvirt PATCH] ci: integration: Drop the Fedora 35 check
by Erik Skultety
We're already past Fedora 35 and so all new fedora's default to
modular daemon setup.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
ci/integration-template.yml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/ci/integration-template.yml b/ci/integration-template.yml
index efd04b76c1..111a115286 100644
--- a/ci/integration-template.yml
+++ b/ci/integration-template.yml
@@ -38,8 +38,7 @@
.enable-libvirt-debugging: &enable-libvirt-debugging
- source /etc/os-release # in order to query the vendor-provided variables
- - if test "$ID" = "centos" && test "$VERSION_ID" -lt 9 ||
- test "$ID" = "fedora" && test "$VERSION_ID" -lt 35;
+ - if test "$ID" = "centos" && test "$VERSION_ID" -lt 9;
then
DAEMONS="libvirtd virtlockd virtlogd";
else
--
2.41.0
9 months, 1 week
[PATCH 0/4] migration: Sanitize handling of 'migrate_disks' parameter
by Peter Krempa
Improve error reporting when users select disk's to migrate but don't
enable non-shared storage migration.
Peter Krempa (4):
qemuMigrationSrcBeginPhase: Properly report error when non-shared
storage migration is requested over tunnel
qemuMigrationSrcBeginPhase: Require storage migration when
'migrate_disks' parameter is specified
virsh: doMigrate: Rework virsh option to migration flag conversion
virsh: doMigrate: Require --copy-storage-(all|inc) with
--migrate-disks
src/qemu/qemu_migration.c | 7 +++
tools/virsh-domain.c | 113 ++++++++++++++++----------------------
2 files changed, 54 insertions(+), 66 deletions(-)
--
2.41.0
9 months, 2 weeks
[PATCH 0/5] introduce support for block device properties
by Kristina Hanicova
I noticed this on the list after the 1849570 bug on discard granularity:
https://listman.redhat.com/archives/libvir-list/2020-June/203862.html
so I decided to add maximum unmap size as well.
The series is heavily based on Lin's patches and I would be glad if
there is any way to add Lin into commit messages as well.
Kristina Hanicova (5):
conf: add support for discard_granularity
qemu: add support for discard_granularity
conf: add support for max_unmap_size
qemu: Introduce QEMU_CAPS_SCSI_DISK_MAX_UNMAP_SIZE capability
qemu: add support for max_unmap_size
docs/formatdomain.rst | 16 +++++++-
src/conf/domain_conf.c | 22 ++++++++++-
src/conf/domain_conf.h | 2 +
src/conf/domain_validate.c | 4 +-
src/conf/schemas/domaincommon.rng | 10 +++++
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 4 ++
src/qemu/qemu_domain.c | 4 ++
src/vz/vz_utils.c | 4 +-
.../caps_4.2.0_aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_4.2.0_ppc64.xml | 1 +
.../qemucapabilitiesdata/caps_4.2.0_s390x.xml | 1 +
.../caps_4.2.0_x86_64.xml | 1 +
.../caps_5.0.0_aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_5.0.0_ppc64.xml | 1 +
.../caps_5.0.0_riscv64.xml | 1 +
.../caps_5.0.0_x86_64.xml | 1 +
.../qemucapabilitiesdata/caps_5.1.0_sparc.xml | 1 +
.../caps_5.1.0_x86_64.xml | 1 +
.../caps_5.2.0_aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_5.2.0_ppc64.xml | 1 +
.../caps_5.2.0_riscv64.xml | 1 +
.../qemucapabilitiesdata/caps_5.2.0_s390x.xml | 1 +
.../caps_5.2.0_x86_64.xml | 1 +
.../caps_6.0.0_aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_6.0.0_s390x.xml | 1 +
.../caps_6.0.0_x86_64.xml | 1 +
.../caps_6.1.0_x86_64.xml | 1 +
.../caps_6.2.0_aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_6.2.0_ppc64.xml | 1 +
.../caps_6.2.0_x86_64.xml | 1 +
.../caps_7.0.0_aarch64+hvf.xml | 1 +
.../caps_7.0.0_aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_7.0.0_ppc64.xml | 1 +
.../caps_7.0.0_x86_64.xml | 1 +
.../qemucapabilitiesdata/caps_7.1.0_ppc64.xml | 1 +
.../caps_7.1.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml | 1 +
.../caps_7.2.0_x86_64+hvf.xml | 1 +
.../caps_7.2.0_x86_64.xml | 1 +
.../caps_8.0.0_riscv64.xml | 1 +
.../caps_8.0.0_x86_64.xml | 1 +
.../qemucapabilitiesdata/caps_8.1.0_s390x.xml | 1 +
.../caps_8.1.0_x86_64.xml | 1 +
.../disk-blockio.x86_64-latest.args | 2 +-
tests/qemuxml2argvdata/disk-blockio.xml | 2 +-
...csi-disk-max_unmap_size.x86_64-latest.args | 37 +++++++++++++++++++
.../disk-scsi-disk-max_unmap_size.xml | 28 ++++++++++++++
tests/qemuxml2argvtest.c | 1 +
50 files changed, 168 insertions(+), 6 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-scsi-disk-max_unmap_size.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-scsi-disk-max_unmap_size.xml
--
2.41.0
9 months, 2 weeks
[PATCH] virStorageBackendLogicalCheckPool: Properly mark empty logical pools as active
by Peter Krempa
The '/dev' filesystem convenience directory for a LVM volume group is
not created when the volume group is empty.
The logic in 'virStorageBackendLogicalCheckPool' which is used to see
whether a pool is active was first checking presence of the directory,
which failed for an empty VG.
Since the second step is virStorageBackendLogicalMatchPoolSource which
is checking mapping between configured PVs and the VG, we can simply
rely on the function to also check presence of the pool.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2228223
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/storage/storage_backend_logical.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
index 9462ac6790..6acbc37f18 100644
--- a/src/storage/storage_backend_logical.c
+++ b/src/storage/storage_backend_logical.c
@@ -624,13 +624,7 @@ static int
virStorageBackendLogicalCheckPool(virStoragePoolObj *pool,
bool *isActive)
{
- virStoragePoolDef *def = virStoragePoolObjGetDef(pool);
-
- /* If we can find the target.path as well as ensure that the
- * pool's def source
- */
- *isActive = virFileExists(def->target.path) &&
- virStorageBackendLogicalMatchPoolSource(pool);
+ *isActive = virStorageBackendLogicalMatchPoolSource(pool);
return 0;
}
--
2.41.0
9 months, 2 weeks
[libvirt PATCH v2 00/24] introduce external snapshot revert support
by Pavel Hrdina
This implements virDomainRevertToSnapshot to work with external
snapshots. In addition it modifies virDomainSnapshotDelete to work
correctly when we revert to non-leaf snapshot or when there is
non-linear snapshot tree with multiple branches.
Gitlab repo with the patches:
https://gitlab.com/phrdina/libvirt/-/tree/snapshot-revert-external
Pavel Hrdina (24):
libvirt_private: list virDomainMomentDefPostParse
snapshot_conf: export virDomainSnapshotDiskDefClear
snapshot_conf: use alternate domain definition in
virDomainSnapshotDefAssignExternalNames
snapshot_conf: introduce <revertDisks> metadata element
snapshot_conf: add new argument to virDomainSnapshotAlignDisks
qemu_snapshot: introduce qemuSnapshotDomainDefUpdateDisk
qemu_snapshot: use virDomainDiskByName while updating domain def
qemu_snapshot: introduce qemuSnapshotCreateQcow2Files
qemu_snapshot: allow using alternate domain definition when creating
qcow2 files
qemu_snapshot: move external disk prepare to single function
qemu_snapshot: use VIR_ASYNC_JOB_SNAPSHOT when reverting snapshot
qemu_snapshot: introduce external snapshot revert support
qemu_snapshot: rename qemuSnapshotDeleteExternalPrepare
qemu_snapshot: extract external snapshot delete prepare to function
qemu_snapshot: add merge to external snapshot delete prepare data
qemu_snapshot: prepare data for non-active leaf external snapshot
deletion
qemu_snapshot: add support to delete external snapshot without block
commit
qemu_snapshot: delete: properly update parent snapshot with revert
data
qemu_snapshot: remove revertdisks when creating new snapshot
virdomainmomentobjlist: introduce virDomainMomentIsAncestor
qemu_snapshot: update backing store after deleting external snapshot
qemu_snapshot: check only once if snapshot is external
qemu_snapshot: add checks for external snapshot deletion
qemu_snapshot: allow snapshot revert for external snapshots
src/conf/schemas/domainsnapshot.rng | 7 +
src/conf/snapshot_conf.c | 52 +-
src/conf/snapshot_conf.h | 11 +-
src/conf/virdomainmomentobjlist.c | 17 +
src/conf/virdomainmomentobjlist.h | 4 +
src/libvirt_private.syms | 6 +
src/qemu/qemu_snapshot.c | 874 ++++++++++++++++++++++------
src/test/test_driver.c | 2 +-
8 files changed, 780 insertions(+), 193 deletions(-)
--
2.41.0
9 months, 2 weeks
[PATCH] conf: fix error message
by Anastasia Belova
From: Анастасия Белова <abelova(a)astralinux.ru>
In case of invalid placement its value should
be passed as a parameter of virReportError
instead of mode.
Fixes: 93e82727ec ("numatune: Encapsulate numatune configuration in order to unify results")
Signed-off-by: Anastasia Belova <abelova(a)astralinux.ru>
---
src/conf/numa_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c
index a616521763..31b5ea58f6 100644
--- a/src/conf/numa_conf.c
+++ b/src/conf/numa_conf.c
@@ -508,7 +508,7 @@ virDomainNumatuneSet(virDomainNuma *numa,
(placement < 0 || placement >= VIR_DOMAIN_NUMATUNE_PLACEMENT_LAST)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported numatune placement '%1$d'"),
- mode);
+ placement);
return -1;
}
--
2.30.2
9 months, 2 weeks
[PATCH v2] lxc_container: Increase stack size for lxcContainerChild()
by Michal Privoznik
When spawning a new container (via clone()) we allocate stack for
lxcContainerChild(). So far, we allocate 4 pages for the stack
and this used to be enough until we started rewriting everything
to glib. With glib we switched to g_strerror() which localizes
errno strings and thus increases stack usage, while the
previously used strerror_r() was more compact.
Fortunately, the solution is easy - just increase how much stack
the child can use (16 pages ought to be enough for anybody).
And while at it, lets use mmap() for allocation which offer some
nice features:
MAP_STACK - align allocation to be suitable for stack (even
though, currently ignored on Linux),
MAP_GROWSDOWN - kernel guards out of bounds access from child
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/511
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
This is a v2 of:
https://listman.redhat.com/archives/libvir-list/2023-August/241127.html
diff to v1:
- switched from g_new0() to mmap() for additional security
src/lxc/lxc_container.c | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 63cf283285..c215b83848 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -26,6 +26,7 @@
#include <sys/ioctl.h>
#include <sys/mount.h>
#include <sys/stat.h>
+#include <sys/mman.h>
#include <unistd.h>
#include <mntent.h>
#include <sys/reboot.h>
@@ -2132,9 +2133,10 @@ int lxcContainerStart(virDomainDef *def,
{
pid_t pid;
int cflags;
- int stacksize = getpagesize() * 4;
- g_autofree char *stack = NULL;
+ int stacksize = getpagesize() * 16;
+ char *stack = NULL;
char *stacktop;
+ int ret = -1;
lxc_child_argv_t args = {
.config = def,
.securityDriver = securityDriver,
@@ -2150,7 +2152,14 @@ int lxcContainerStart(virDomainDef *def,
};
/* allocate a stack for the container */
- stack = g_new0(char, stacksize);
+ stack = mmap(NULL, stacksize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS | MAP_GROWSDOWN | MAP_STACK,
+ -1, 0);
+ if (stack == MAP_FAILED) {
+ virReportSystemError(errno, "%s",
+ _("Unable to allocate stack"));
+ return -1;
+ }
stacktop = stack + stacksize;
@@ -2160,7 +2169,7 @@ int lxcContainerStart(virDomainDef *def,
if (virProcessNamespaceAvailable(VIR_PROCESS_NAMESPACE_USER) < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Kernel doesn't support user namespace"));
- return -1;
+ goto cleanup;
}
VIR_DEBUG("Enable user namespace");
cflags |= CLONE_NEWUSER;
@@ -2175,7 +2184,7 @@ int lxcContainerStart(virDomainDef *def,
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Config asks for inherit net namespace "
"as well as private network interfaces"));
- return -1;
+ goto cleanup;
}
VIR_DEBUG("Inheriting a net namespace");
}
@@ -2199,10 +2208,16 @@ int lxcContainerStart(virDomainDef *def,
if (pid < 0) {
virReportSystemError(errno, "%s",
_("Failed to run clone container"));
- return -1;
+ goto cleanup;
}
- return pid;
+ ret = pid;
+ cleanup:
+ if (munmap(stack, stacksize) < 0) {
+ VIR_WARN("Unable to munmap() stack: %s", g_strerror(errno));
+ }
+
+ return ret;
}
int lxcContainerChown(virDomainDef *def, const char *path)
--
2.41.0
9 months, 2 weeks