[PATCH 1/1] qemuProcessEventSubmit : fix potential use after free
by Shaleen Bathla
Coverity scan reports use after free issue.
In error case, don't free vm object as it will be unlocked+freed
in the parent function like qemuProcessHandleReset().
Signed-off-by: Shaleen Bathla <shaleen.bathla(a)oracle.com>
---
src/qemu/qemu_process.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 9fc7eada5220..a4133b37cf22 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -287,7 +287,6 @@ qemuProcessEventSubmit(virDomainObj *vm,
event->data = data;
if (virThreadPoolSendJob(driver->workerPool, 0, event) < 0) {
- virObjectUnref(vm);
qemuProcessEventFree(event);
}
}
--
2.31.1
1 year, 10 months
[PATCH V5 00/11] spec: Decompose the daemon subpackage
by Jim Fehlig
This is V5 of
https://listman.redhat.com/archives/libvir-list/2022-December/236472.html
The end goal is to remove the libvirt-dameon dependency on the various
libvirt-daemon-driver-foo subpackages, allowing installation of a
modular daemon configuration without the traditional monolithic libvirtd.
Changes from V4:
- Address more review comments from Andrea
Jim Fehlig (11):
spec: Move virtlockd to a new subpackage libvirt-daemon-lock
spec: Move virtlogd to a new subpackage libvirt-daemon-log
spec: Move virtproxyd to a new subpackage libvirt-daemon-proxy
spec: Move lockd plugin to a new subpackage
spec: Rename the libvirt-lock-sanlock subpackage
spec: Move common files and dependencies to libvirt-daemon-common
spec: Add module-init-tools dependency to nodedev and lxc drivers
spec: Add numad dependency to qemu and lxc drivers
spec: Remove libvirt-daemon dependency from drivers
spec: Remove libvirt-daemon dependency from hypervisor subpackages
kbase: Update rpm-deployment.rst with new subpackages
docs/kbase/rpm-deployment.rst | 51 ++++--
libvirt.spec.in | 326 ++++++++++++++++++++++++----------
2 files changed, 269 insertions(+), 108 deletions(-)
--
2.38.1
1 year, 10 months
[PATCH] qemuBuildThreadContextProps: Generate ThreadContext less frequently
by Michal Privoznik
Currently, the ThreadContext object is generated whenever we see
.host-nodes attribute for a memory-backend-* object. The idea was
that when the backend is pinned to a specific set of host NUMA
nodes, then the allocation could be happening on CPUs from those
nodes too. But this may not be always possible.
Users might configure their guests in such way that vCPUs and
corresponding guest NUMA nodes are on different host NUMA nodes
than emulator thread. In this case, ThreadContext won't work,
because ThreadContext objects live in context of the emulator
thread (vCPU threads are moved around by us later, when emulator
thread finished its setup and spawned vCPU threads - see
qemuProcessSetupVcpus()). Therefore, memory allocation is done by
emulator thread which is pinned to a subset of host NUMA nodes,
but tries to create a ThreadContext object with a disjoint subset
of host NUMA nodes, which fails.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2154750
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_command.c | 11 ++++++-----
.../hugepages-memaccess2.x86_64-latest.args | 9 +++------
.../memory-hotplug-virtio-mem.x86_64-latest.args | 3 +--
.../numatune-memnode.x86_64-latest.args | 9 +++------
.../numatune-system-memory.x86_64-latest.args | 3 +--
5 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 06e29ff8ae..af17f37754 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3633,6 +3633,10 @@ qemuBuildThreadContextProps(virJSONValue **tcProps,
if (!nodemask)
return 0;
+ if (virJSONValueObjectGetBoolean(*memProps, "prealloc", &prealloc) < 0 ||
+ !prealloc)
+ return 0;
+
memalias = virJSONValueObjectGetString(*memProps, "id");
if (!memalias) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@@ -3655,11 +3659,8 @@ qemuBuildThreadContextProps(virJSONValue **tcProps,
NULL) < 0)
return -1;
- if (virJSONValueObjectGetBoolean(*memProps, "prealloc", &prealloc) >= 0 &&
- prealloc) {
- priv->threadContextAliases = g_slist_prepend(priv->threadContextAliases,
- g_steal_pointer(&tcAlias));
- }
+ priv->threadContextAliases = g_slist_prepend(priv->threadContextAliases,
+ g_steal_pointer(&tcAlias));
*tcProps = g_steal_pointer(&props);
return 0;
diff --git a/tests/qemuxml2argvdata/hugepages-memaccess2.x86_64-latest.args b/tests/qemuxml2argvdata/hugepages-memaccess2.x86_64-latest.args
index f73da5865d..fedc9fe1ce 100644
--- a/tests/qemuxml2argvdata/hugepages-memaccess2.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/hugepages-memaccess2.x86_64-latest.args
@@ -16,17 +16,14 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-m size=4194304k,slots=16,maxmem=8388608k \
-overcommit mem-lock=off \
-smp 4,sockets=4,cores=1,threads=1 \
--object '{"qom-type":"thread-context","id":"tc-ram-node0","node-affinity":[0,1,2,3]}' \
--object '{"qom-type":"memory-backend-file","id":"ram-node0","mem-path":"/var/lib/libvirt/qemu/ram/-1-QEMUGuest1/ram-node0","share":false,"size":1073741824,"host-nodes":[0,1,2,3],"policy":"bind","prealloc-context":"tc-ram-node0"}' \
+-object '{"qom-type":"memory-backend-file","id":"ram-node0","mem-path":"/var/lib/libvirt/qemu/ram/-1-QEMUGuest1/ram-node0","share":false,"size":1073741824,"host-nodes":[0,1,2,3],"policy":"bind"}' \
-numa node,nodeid=0,cpus=0,memdev=ram-node0 \
-object '{"qom-type":"thread-context","id":"tc-ram-node1","node-affinity":[0,1,2,3]}' \
-object '{"qom-type":"memory-backend-file","id":"ram-node1","mem-path":"/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1","share":true,"prealloc":true,"size":1073741824,"host-nodes":[0,1,2,3],"policy":"bind","prealloc-context":"tc-ram-node1"}' \
-numa node,nodeid=1,cpus=1,memdev=ram-node1 \
--object '{"qom-type":"thread-context","id":"tc-ram-node2","node-affinity":[0,1,2,3]}' \
--object '{"qom-type":"memory-backend-file","id":"ram-node2","mem-path":"/var/lib/libvirt/qemu/ram/-1-QEMUGuest1/ram-node2","share":false,"size":1073741824,"host-nodes":[0,1,2,3],"policy":"bind","prealloc-context":"tc-ram-node2"}' \
+-object '{"qom-type":"memory-backend-file","id":"ram-node2","mem-path":"/var/lib/libvirt/qemu/ram/-1-QEMUGuest1/ram-node2","share":false,"size":1073741824,"host-nodes":[0,1,2,3],"policy":"bind"}' \
-numa node,nodeid=2,cpus=2,memdev=ram-node2 \
--object '{"qom-type":"thread-context","id":"tc-ram-node3","node-affinity":[3]}' \
--object '{"qom-type":"memory-backend-file","id":"ram-node3","mem-path":"/var/lib/libvirt/qemu/ram/-1-QEMUGuest1/ram-node3","share":false,"size":1073741824,"host-nodes":[3],"policy":"bind","prealloc-context":"tc-ram-node3"}' \
+-object '{"qom-type":"memory-backend-file","id":"ram-node3","mem-path":"/var/lib/libvirt/qemu/ram/-1-QEMUGuest1/ram-node3","share":false,"size":1073741824,"host-nodes":[3],"policy":"bind"}' \
-numa node,nodeid=3,cpus=3,memdev=ram-node3 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
index 04876fc044..5aa8110aeb 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
@@ -32,8 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
-object '{"qom-type":"memory-backend-ram","id":"memvirtiomem0","reserve":false,"size":1073741824}' \
-device '{"driver":"virtio-mem-pci","node":0,"block-size":2097152,"requested-size":536870912,"memdev":"memvirtiomem0","id":"virtiomem0","bus":"pci.0","addr":"0x2"}' \
--object '{"qom-type":"thread-context","id":"tc-memvirtiomem1","node-affinity":[1,2,3]}' \
--object '{"qom-type":"memory-backend-file","id":"memvirtiomem1","mem-path":"/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1","reserve":false,"size":2147483648,"host-nodes":[1,2,3],"policy":"bind","prealloc-context":"tc-memvirtiomem1"}' \
+-object '{"qom-type":"memory-backend-file","id":"memvirtiomem1","mem-path":"/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1","reserve":false,"size":2147483648,"host-nodes":[1,2,3],"policy":"bind"}' \
-device '{"driver":"virtio-mem-pci","node":0,"block-size":2097152,"requested-size":1073741824,"memdev":"memvirtiomem1","prealloc":true,"id":"virtiomem1","bus":"pci.1","addr":"0x1"}' \
-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
diff --git a/tests/qemuxml2argvdata/numatune-memnode.x86_64-latest.args b/tests/qemuxml2argvdata/numatune-memnode.x86_64-latest.args
index f4ef91006f..7cb7e659a4 100644
--- a/tests/qemuxml2argvdata/numatune-memnode.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/numatune-memnode.x86_64-latest.args
@@ -16,14 +16,11 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest/.config \
-m 24105 \
-overcommit mem-lock=off \
-smp 32,sockets=32,cores=1,threads=1 \
--object '{"qom-type":"thread-context","id":"tc-ram-node0","node-affinity":[3]}' \
--object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":20971520,"host-nodes":[3],"policy":"preferred","prealloc-context":"tc-ram-node0"}' \
+-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":20971520,"host-nodes":[3],"policy":"preferred"}' \
-numa node,nodeid=0,cpus=0,memdev=ram-node0 \
--object '{"qom-type":"thread-context","id":"tc-ram-node1","node-affinity":[0,1,2,3,4,5,6,7]}' \
--object '{"qom-type":"memory-backend-ram","id":"ram-node1","size":676331520,"host-nodes":[0,1,2,3,4,5,6,7],"policy":"bind","prealloc-context":"tc-ram-node1"}' \
+-object '{"qom-type":"memory-backend-ram","id":"ram-node1","size":676331520,"host-nodes":[0,1,2,3,4,5,6,7],"policy":"bind"}' \
-numa node,nodeid=1,cpus=1-27,cpus=29,memdev=ram-node1 \
--object '{"qom-type":"thread-context","id":"tc-ram-node2","node-affinity":[1,2,5,7]}' \
--object '{"qom-type":"memory-backend-ram","id":"ram-node2","size":24578621440,"host-nodes":[1,2,5,7],"policy":"bind","prealloc-context":"tc-ram-node2"}' \
+-object '{"qom-type":"memory-backend-ram","id":"ram-node2","size":24578621440,"host-nodes":[1,2,5,7],"policy":"bind"}' \
-numa node,nodeid=2,cpus=28,cpus=30-31,memdev=ram-node2 \
-uuid 9f4b6512-e73a-4a25-93e8-5307802821ce \
-display none \
diff --git a/tests/qemuxml2argvdata/numatune-system-memory.x86_64-latest.args b/tests/qemuxml2argvdata/numatune-system-memory.x86_64-latest.args
index 125dc43153..fd93abe3eb 100644
--- a/tests/qemuxml2argvdata/numatune-system-memory.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/numatune-system-memory.x86_64-latest.args
@@ -14,8 +14,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu64 \
-m 214 \
--object '{"qom-type":"thread-context","id":"tc-pc.ram","node-affinity":[0]}' \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264,"host-nodes":[0],"policy":"bind","prealloc-context":"tc-pc.ram"}' \
+-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264,"host-nodes":[0],"policy":"bind"}' \
-overcommit mem-lock=off \
-smp 2,sockets=2,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--
2.38.2
1 year, 10 months
[PATCH (pushed)] qemu: Fix variable sizing issues with 'bandwidth' argument of qemuBlockCommit
by Peter Krempa
The patch moving the code didn't faithfully represent the typecasting
of the 'bandwidth' variable needed to properly convert from the legacy
'unsigned long' argument which resulted in a build failure on 32 bit
systems:
../src/qemu/qemu_block.c: In function ‘qemuBlockCommit’:
../src/qemu/qemu_block.c:3249:23: error: comparison is always false due to limited range of data type [-Werror=type-limits]
3249 | if (bandwidth > LLONG_MAX >> 20) {
| ^
Fix it by returning the check into qemuDomainBlockCommit as it's needed
only because of the legacy argument type in the old API and use
'unsigned long long' for qemuBlockCommit.
Fixes: f5a77198bf9
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
Pushed under the build-breaker rule.
src/qemu/qemu_block.c | 15 ++-------------
src/qemu/qemu_block.h | 2 +-
src/qemu/qemu_driver.c | 14 +++++++++++++-
3 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 7ea42961b6..9bfb06ac08 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -3205,7 +3205,7 @@ qemuBlockExportAddNBD(virDomainObj *vm,
* @baseSource: disk source within backing chain to commit data into
* @topSource: disk source within backing chain with data we will commit
* @top_parent: disk source that has @topSource as backing disk
- * @bandwidth: bandwidth limit, flags determine the unit
+ * @bandwidth: bandwidth limit in bytes/s
* @asyncJob: qemu async job type
* @autofinalize: virTristateBool controlling qemu block job finalization
* @flags: bitwise-OR of virDomainBlockCommitFlags
@@ -3227,7 +3227,7 @@ qemuBlockCommit(virDomainObj *vm,
virStorageSource *baseSource,
virStorageSource *topSource,
virStorageSource *top_parent,
- unsigned long bandwidth,
+ unsigned long long bandwidth,
virDomainAsyncJob asyncJob,
virTristateBool autofinalize,
unsigned int flags)
@@ -3244,17 +3244,6 @@ qemuBlockCommit(virDomainObj *vm,
if (virDomainObjCheckActive(vm) < 0)
return NULL;
- /* Convert bandwidth MiB to bytes, if necessary */
- if (!(flags & VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES)) {
- if (bandwidth > LLONG_MAX >> 20) {
- virReportError(VIR_ERR_OVERFLOW,
- _("bandwidth must be less than %llu"),
- LLONG_MAX >> 20);
- return NULL;
- }
- bandwidth <<= 20;
- }
-
if (!qemuDomainDiskBlockJobIsSupported(disk))
return NULL;
diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h
index a8079c2207..eac986e0f0 100644
--- a/src/qemu/qemu_block.h
+++ b/src/qemu/qemu_block.h
@@ -283,7 +283,7 @@ qemuBlockCommit(virDomainObj *vm,
virStorageSource *baseSource,
virStorageSource *topSource,
virStorageSource *top_parent,
- unsigned long bandwidth,
+ unsigned long long bandwidth,
virDomainAsyncJob asyncJob,
virTristateBool autofinalize,
unsigned int flags);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3ea48c9049..d9f7ce234e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14994,6 +14994,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
virStorageSource *topSource;
virStorageSource *baseSource = NULL;
virStorageSource *top_parent = NULL;
+ unsigned long long speed = bandwidth;
g_autoptr(qemuBlockJobData) job = NULL;
virCheckFlags(VIR_DOMAIN_BLOCK_COMMIT_SHALLOW |
@@ -15011,6 +15012,17 @@ qemuDomainBlockCommit(virDomainPtr dom,
if (virDomainObjBeginJob(vm, VIR_JOB_MODIFY) < 0)
goto cleanup;
+ /* Convert bandwidth MiB to bytes, if necessary */
+ if (!(flags & VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES)) {
+ if (speed > LLONG_MAX >> 20) {
+ virReportError(VIR_ERR_OVERFLOW,
+ _("bandwidth must be less than %llu"),
+ LLONG_MAX >> 20);
+ goto endjob;
+ }
+ speed <<= 20;
+ }
+
if (!(disk = qemuDomainDiskByName(vm->def, path)))
goto endjob;
@@ -15027,7 +15039,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
goto endjob;
job = qemuBlockCommit(vm, disk, baseSource, topSource, top_parent,
- bandwidth, VIR_ASYNC_JOB_NONE, VIR_TRISTATE_BOOL_YES,
+ speed, VIR_ASYNC_JOB_NONE, VIR_TRISTATE_BOOL_YES,
flags);
if (job)
ret = 0;
--
2.38.1
1 year, 10 months
[PATCH V6 00/11] spec: Decompose the daemon subpackage
by Jim Fehlig
This is V6 of
https://listman.redhat.com/archives/libvir-list/2022-December/236502.html
The end goal is to remove the libvirt-dameon dependency on the various
libvirt-daemon-driver-foo subpackages, allowing installation of a
modular daemon configuration without the traditional monolithic libvirtd.
Changes from V5:
* Remove lockd dependency from hypervisor packages
* Add virtproxyd as a weak dependency to the hypervisor packages
Jim Fehlig (11):
spec: Move virtlockd to a new subpackage libvirt-daemon-lock
spec: Move virtlogd to a new subpackage libvirt-daemon-log
spec: Move virtproxyd to a new subpackage libvirt-daemon-proxy
spec: Move lockd plugin to a new subpackage
spec: Rename the libvirt-lock-sanlock subpackage
spec: Move common files and dependencies to libvirt-daemon-common
spec: Add module-init-tools dependency to nodedev and lxc drivers
spec: Add numad dependency to qemu and lxc drivers
spec: Remove libvirt-daemon dependency from drivers
spec: Remove libvirt-daemon dependency from hypervisor subpackages
kbase: Update rpm-deployment.rst with new subpackages
docs/kbase/rpm-deployment.rst | 48 +++--
libvirt.spec.in | 325 ++++++++++++++++++++++++----------
2 files changed, 265 insertions(+), 108 deletions(-)
--
2.38.1
1 year, 10 months
[PATCH] qemu: snapshot: Restructure control flow to detect errors sooner and work around compiler
by Peter Krempa
Some compilers aren't happy when an automatically freed variable is used
just to free something (thus it's only assigned in the code):
When compiling qemuSnapshotDelete after recent commits they complain:
../src/qemu/qemu_snapshot.c:3153:61: error: variable 'delData' set but not used [-Werror,-Wunused-but-set-variable]
g_autoslist(qemuSnapshotDeleteExternalData) delData = NULL;
^
To work around the issue we can restructure the code which also has the
following semantic implications:
- since qemuSnapshotDeleteExternalPrepare does validation we error out
sooner than attempting to start the VM
- we read the temporary variable at least in one code path
Fixes: 4a4d89a9252
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_snapshot.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 32f7011cbe..b8416808b3 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -3146,12 +3146,13 @@ qemuSnapshotDelete(virDomainObj *vm,
if (virDomainSnapshotIsExternal(snap) &&
!(flags & (VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN |
VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY))) {
+ g_autoslist(qemuSnapshotDeleteExternalData) tmpData = NULL;
- externalData = qemuSnapshotDeleteExternalPrepare(vm, snap);
+ /* this also serves as validation whether the snapshot can be deleted */
+ if (!(tmpData = qemuSnapshotDeleteExternalPrepare(vm, snap)))
+ goto endjob;
if (!virDomainObjIsActive(vm)) {
- g_autoslist(qemuSnapshotDeleteExternalData) delData = NULL;
-
if (qemuProcessStart(NULL, driver, vm, NULL, VIR_ASYNC_JOB_SNAPSHOT,
NULL, -1, NULL, NULL,
VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
@@ -3163,20 +3164,19 @@ qemuSnapshotDelete(virDomainObj *vm,
/* Call the prepare again as some data require that the VM is
* running to get everything we need. */
- delData = g_steal_pointer(&externalData);
- externalData = qemuSnapshotDeleteExternalPrepare(vm, snap);
+ if (!(externalData = qemuSnapshotDeleteExternalPrepare(vm, snap)))
+ goto endjob;
} else {
qemuDomainJobPrivate *jobPriv = vm->job->privateData;
+ externalData = g_steal_pointer(&tmpData);
+
/* If the VM is running we need to indicate that the async snapshot
* job is snapshot delete job. */
jobPriv->snapshotDelete = true;
qemuDomainSaveStatus(vm);
}
-
- if (!externalData)
- goto endjob;
}
}
--
2.38.1
1 year, 10 months
[PATCH V4 00/11] spec: Decompose the daemon subpackage
by Jim Fehlig
This is V4 of
https://listman.redhat.com/archives/libvir-list/2022-December/236427.html
The end goal is to remove the libvirt-dameon dependency on the various
libvirt-daemon-driver-foo subpackages, allowing installation of a
modular daemon configuration without the traditional monolithic libvirtd.
Changes from V3:
- Address review comments, some of which I overlooked from V2 review
Jim Fehlig (11):
spec: Move virtlockd to a new subpackage libvirt-daemon-lock
spec: Move virtlogd to a new subpackage libvirt-daemon-log
spec: Move virtproxyd to a new subpackage libvirt-daemon-proxy
spec: Move lockd plugin to a new subpackage
spec: Rename the libvirt-lock-sanlock subpackage
spec: Move common files and dependencies to libvirt-daemon-common
spec: Add module-init-tools dependency to nodedev and lxc drivers
spec: Add numad dependency to qemu and lxc drivers
spec: Remove libvirt-daemon dependency from drivers
spec: Remove libvirt-daemon dependency from hypervisor subpackages
kbase: Update rpm-deployment.rst with new subpackages
docs/kbase/rpm-deployment.rst | 51 ++++--
libvirt.spec.in | 334 ++++++++++++++++++++++++----------
2 files changed, 276 insertions(+), 109 deletions(-)
--
2.38.1
1 year, 10 months
[libvirt PATCH] ci: Refresh and add Fedora 37 target
by Erik Skultety
This patch pulls in latest lcitool changes mainly though moves onto Fedora
37 over Fedora 35 which is dropped.
Test pipeline (ignore non-Fedora 37 stuff):
https://gitlab.com/eskultety/libvirt/-/pipelines/741518165
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
...-mingw32.sh => fedora-37-cross-mingw32.sh} | 0
...-mingw64.sh => fedora-37-cross-mingw64.sh} | 0
ci/buildenv/{fedora-35.sh => fedora-37.sh} | 1 -
ci/cirrus/macos-12.vars | 10 +-
...ile => fedora-37-cross-mingw32.Dockerfile} | 2 +-
...ile => fedora-37-cross-mingw64.Dockerfile} | 2 +-
...ora-35.Dockerfile => fedora-37.Dockerfile} | 3 +-
ci/gitlab/builds.yml | 76 ++++++-------
ci/gitlab/containers.yml | 22 ++--
ci/integration.yml | 104 +++++++++---------
ci/manifest.yml | 16 +--
11 files changed, 117 insertions(+), 119 deletions(-)
rename ci/buildenv/{fedora-36-cross-mingw32.sh => fedora-37-cross-mingw32.sh} (100%)
rename ci/buildenv/{fedora-36-cross-mingw64.sh => fedora-37-cross-mingw64.sh} (100%)
rename ci/buildenv/{fedora-35.sh => fedora-37.sh} (99%)
rename ci/containers/{fedora-36-cross-mingw32.Dockerfile => fedora-37-cross-mingw32.Dockerfile} (98%)
rename ci/containers/{fedora-36-cross-mingw64.Dockerfile => fedora-37-cross-mingw64.Dockerfile} (98%)
rename ci/containers/{fedora-35.Dockerfile => fedora-37.Dockerfile} (97%)
diff --git a/ci/buildenv/fedora-36-cross-mingw32.sh b/ci/buildenv/fedora-37-cross-mingw32.sh
similarity index 100%
rename from ci/buildenv/fedora-36-cross-mingw32.sh
rename to ci/buildenv/fedora-37-cross-mingw32.sh
diff --git a/ci/buildenv/fedora-36-cross-mingw64.sh b/ci/buildenv/fedora-37-cross-mingw64.sh
similarity index 100%
rename from ci/buildenv/fedora-36-cross-mingw64.sh
rename to ci/buildenv/fedora-37-cross-mingw64.sh
diff --git a/ci/buildenv/fedora-35.sh b/ci/buildenv/fedora-37.sh
similarity index 99%
rename from ci/buildenv/fedora-35.sh
rename to ci/buildenv/fedora-37.sh
index 2ee8c901e5..23886ae77c 100644
--- a/ci/buildenv/fedora-35.sh
+++ b/ci/buildenv/fedora-37.sh
@@ -58,7 +58,6 @@ function install_buildenv() {
lvm2 \
make \
meson \
- netcf-devel \
nfs-utils \
ninja-build \
numactl-devel \
diff --git a/ci/cirrus/macos-12.vars b/ci/cirrus/macos-12.vars
index a5afb4eb4d..8ecc9c4450 100644
--- a/ci/cirrus/macos-12.vars
+++ b/ci/cirrus/macos-12.vars
@@ -4,13 +4,13 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-CCACHE='/usr/local/bin/ccache'
+CCACHE='/opt/homebrew/bin/ccache'
CPAN_PKGS=''
CROSS_PKGS=''
-MAKE='/usr/local/bin/gmake'
-NINJA='/usr/local/bin/ninja'
+MAKE='/opt/homebrew/bin/gmake'
+NINJA='/opt/homebrew/bin/ninja'
PACKAGING_COMMAND='brew'
-PIP3='/usr/local/bin/pip3'
+PIP3='/opt/homebrew/bin/pip3'
PKGS='augeas bash-completion ccache codespell cppi curl diffutils docutils flake8 gettext git glib gnu-sed gnutls grep libiscsi libpcap libssh libssh2 libxml2 libxslt make meson ninja perl pkg-config python3 qemu readline rpcgen scrub yajl'
PYPI_PKGS=''
-PYTHON='/usr/local/bin/python3'
+PYTHON='/opt/homebrew/bin/python3'
diff --git a/ci/containers/fedora-36-cross-mingw32.Dockerfile b/ci/containers/fedora-37-cross-mingw32.Dockerfile
similarity index 98%
rename from ci/containers/fedora-36-cross-mingw32.Dockerfile
rename to ci/containers/fedora-37-cross-mingw32.Dockerfile
index 24b2760c18..14fb25a17e 100644
--- a/ci/containers/fedora-36-cross-mingw32.Dockerfile
+++ b/ci/containers/fedora-37-cross-mingw32.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM registry.fedoraproject.org/fedora:36
+FROM registry.fedoraproject.org/fedora:37
RUN dnf install -y nosync && \
echo -e '#!/bin/sh\n\
diff --git a/ci/containers/fedora-36-cross-mingw64.Dockerfile b/ci/containers/fedora-37-cross-mingw64.Dockerfile
similarity index 98%
rename from ci/containers/fedora-36-cross-mingw64.Dockerfile
rename to ci/containers/fedora-37-cross-mingw64.Dockerfile
index a3369209da..c468dd7a6c 100644
--- a/ci/containers/fedora-36-cross-mingw64.Dockerfile
+++ b/ci/containers/fedora-37-cross-mingw64.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM registry.fedoraproject.org/fedora:36
+FROM registry.fedoraproject.org/fedora:37
RUN dnf install -y nosync && \
echo -e '#!/bin/sh\n\
diff --git a/ci/containers/fedora-35.Dockerfile b/ci/containers/fedora-37.Dockerfile
similarity index 97%
rename from ci/containers/fedora-35.Dockerfile
rename to ci/containers/fedora-37.Dockerfile
index f517cf9443..17f586af59 100644
--- a/ci/containers/fedora-35.Dockerfile
+++ b/ci/containers/fedora-37.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM registry.fedoraproject.org/fedora:35
+FROM registry.fedoraproject.org/fedora:37
RUN dnf install -y nosync && \
echo -e '#!/bin/sh\n\
@@ -69,7 +69,6 @@ exec "$@"' > /usr/bin/nosync && \
lvm2 \
make \
meson \
- netcf-devel \
nfs-utils \
ninja-build \
numactl-devel \
diff --git a/ci/gitlab/builds.yml b/ci/gitlab/builds.yml
index 0e2daebe97..89c15fa28d 100644
--- a/ci/gitlab/builds.yml
+++ b/ci/gitlab/builds.yml
@@ -193,32 +193,6 @@ x86_64-debian-sid-local-env:
NAME: debian-sid
-x86_64-fedora-35-prebuilt-env:
- extends: .native_build_job_prebuilt_env
- needs:
- - job: x86_64-fedora-35-container
- optional: true
- allow_failure: false
- variables:
- NAME: fedora-35
- artifacts:
- expire_in: 1 day
- paths:
- - libvirt-rpms
-
-x86_64-fedora-35-local-env:
- extends: .native_build_job_local_env
- needs: []
- allow_failure: false
- variables:
- IMAGE: registry.fedoraproject.org/fedora:35
- NAME: fedora-35
- artifacts:
- expire_in: 1 day
- paths:
- - libvirt-rpms
-
-
x86_64-fedora-36-prebuilt-env:
extends: .native_build_job_prebuilt_env
needs:
@@ -245,6 +219,32 @@ x86_64-fedora-36-local-env:
- libvirt-rpms
+x86_64-fedora-37-prebuilt-env:
+ extends: .native_build_job_prebuilt_env
+ needs:
+ - job: x86_64-fedora-37-container
+ optional: true
+ allow_failure: false
+ variables:
+ NAME: fedora-37
+ artifacts:
+ expire_in: 1 day
+ paths:
+ - libvirt-rpms
+
+x86_64-fedora-37-local-env:
+ extends: .native_build_job_local_env
+ needs: []
+ allow_failure: false
+ variables:
+ IMAGE: registry.fedoraproject.org/fedora:37
+ NAME: fedora-37
+ artifacts:
+ expire_in: 1 day
+ paths:
+ - libvirt-rpms
+
+
x86_64-fedora-rawhide-prebuilt-env:
extends: .native_build_job_prebuilt_env
needs:
@@ -746,46 +746,46 @@ s390x-debian-sid-local-env:
NAME: debian-sid
-mingw32-fedora-36-prebuilt-env:
+mingw32-fedora-37-prebuilt-env:
extends: .cross_build_job_prebuilt_env
needs:
- - job: mingw32-fedora-36-container
+ - job: mingw32-fedora-37-container
optional: true
allow_failure: false
variables:
CROSS: mingw32
JOB_OPTIONAL: 1
- NAME: fedora-36
+ NAME: fedora-37
-mingw32-fedora-36-local-env:
+mingw32-fedora-37-local-env:
extends: .cross_build_job_local_env
needs: []
allow_failure: false
variables:
CROSS: mingw32
- IMAGE: registry.fedoraproject.org/fedora:36
+ IMAGE: registry.fedoraproject.org/fedora:37
JOB_OPTIONAL: 1
- NAME: fedora-36
+ NAME: fedora-37
-mingw64-fedora-36-prebuilt-env:
+mingw64-fedora-37-prebuilt-env:
extends: .cross_build_job_prebuilt_env
needs:
- - job: mingw64-fedora-36-container
+ - job: mingw64-fedora-37-container
optional: true
allow_failure: false
variables:
CROSS: mingw64
- NAME: fedora-36
+ NAME: fedora-37
-mingw64-fedora-36-local-env:
+mingw64-fedora-37-local-env:
extends: .cross_build_job_local_env
needs: []
allow_failure: false
variables:
CROSS: mingw64
- IMAGE: registry.fedoraproject.org/fedora:36
- NAME: fedora-36
+ IMAGE: registry.fedoraproject.org/fedora:37
+ NAME: fedora-37
mingw32-fedora-rawhide-prebuilt-env:
diff --git a/ci/gitlab/containers.yml b/ci/gitlab/containers.yml
index 1b7f63955b..fa426bd3a6 100644
--- a/ci/gitlab/containers.yml
+++ b/ci/gitlab/containers.yml
@@ -56,13 +56,6 @@ x86_64-debian-sid-container:
NAME: debian-sid
-x86_64-fedora-35-container:
- extends: .container_job
- allow_failure: false
- variables:
- NAME: fedora-35
-
-
x86_64-fedora-36-container:
extends: .container_job
allow_failure: false
@@ -70,6 +63,13 @@ x86_64-fedora-36-container:
NAME: fedora-36
+x86_64-fedora-37-container:
+ extends: .container_job
+ allow_failure: false
+ variables:
+ NAME: fedora-37
+
+
x86_64-fedora-rawhide-container:
extends: .container_job
allow_failure: true
@@ -235,19 +235,19 @@ s390x-debian-sid-container:
NAME: debian-sid-cross-s390x
-mingw32-fedora-36-container:
+mingw32-fedora-37-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
- NAME: fedora-36-cross-mingw32
+ NAME: fedora-37-cross-mingw32
-mingw64-fedora-36-container:
+mingw64-fedora-37-container:
extends: .container_job
allow_failure: false
variables:
- NAME: fedora-36-cross-mingw64
+ NAME: fedora-37-cross-mingw64
mingw32-fedora-rawhide-container:
diff --git a/ci/integration.yml b/ci/integration.yml
index b79d2e0f40..2bdda1d3c1 100644
--- a/ci/integration.yml
+++ b/ci/integration.yml
@@ -81,46 +81,6 @@ centos-stream-9-tests-local-env:
artifacts: true
-.fedora-35-tests:
- variables:
- # needed by libvirt-gitlab-executor
- DISTRO: fedora-35
- # 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
-
-fedora-35-tests-prebuilt-env:
- extends:
- - .integration_tests_prebuilt_env
- - .fedora-35-tests
- needs:
- - x86_64-fedora-35-prebuilt-env
- - project: libvirt/libvirt-perl
- job: x86_64-fedora-35-prebuilt-env
- ref: master
- artifacts: true
- - project: libvirt/libvirt-python
- job: x86_64-fedora-35-prebuilt-env
- ref: master
- artifacts: true
-
-fedora-35-tests-local-env:
- extends:
- - .integration_tests_local_env
- - .fedora-35-tests
- needs:
- - x86_64-fedora-35-local-env
- - project: libvirt/libvirt-perl
- job: x86_64-fedora-35-prebuilt-env
- ref: master
- artifacts: true
- - project: libvirt/libvirt-python
- job: x86_64-fedora-35-prebuilt-env
- ref: master
- artifacts: true
-
-
.fedora-36-tests:
variables:
# needed by libvirt-gitlab-executor
@@ -161,41 +121,81 @@ fedora-36-tests-local-env:
artifacts: true
-.fedora-36-upstream-qemu-tests:
+.fedora-37-tests:
variables:
# needed by libvirt-gitlab-executor
- DISTRO: fedora-36
+ DISTRO: fedora-37
# 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
-fedora-36-upstream-qemu-tests-prebuilt-env:
+fedora-37-tests-prebuilt-env:
extends:
- .integration_tests_prebuilt_env
- - .fedora-36-upstream-qemu-tests
+ - .fedora-37-tests
needs:
- - x86_64-fedora-36-prebuilt-env
+ - x86_64-fedora-37-prebuilt-env
- project: libvirt/libvirt-perl
- job: x86_64-fedora-36-prebuilt-env
+ job: x86_64-fedora-37-prebuilt-env
ref: master
artifacts: true
- project: libvirt/libvirt-python
- job: x86_64-fedora-36-prebuilt-env
+ job: x86_64-fedora-37-prebuilt-env
ref: master
artifacts: true
-fedora-36-upstream-qemu-tests-local-env:
+fedora-37-tests-local-env:
extends:
- .integration_tests_local_env
- - .fedora-36-upstream-qemu-tests
+ - .fedora-37-tests
needs:
- - x86_64-fedora-36-local-env
+ - x86_64-fedora-37-local-env
- project: libvirt/libvirt-perl
- job: x86_64-fedora-36-prebuilt-env
+ job: x86_64-fedora-37-prebuilt-env
ref: master
artifacts: true
- project: libvirt/libvirt-python
- job: x86_64-fedora-36-prebuilt-env
+ job: x86_64-fedora-37-prebuilt-env
+ ref: master
+ artifacts: true
+
+
+.fedora-37-upstream-qemu-tests:
+ variables:
+ # needed by libvirt-gitlab-executor
+ DISTRO: fedora-37
+ # 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
+
+fedora-37-upstream-qemu-tests-prebuilt-env:
+ extends:
+ - .integration_tests_prebuilt_env
+ - .fedora-37-upstream-qemu-tests
+ needs:
+ - x86_64-fedora-37-prebuilt-env
+ - project: libvirt/libvirt-perl
+ job: x86_64-fedora-37-prebuilt-env
+ ref: master
+ artifacts: true
+ - project: libvirt/libvirt-python
+ job: x86_64-fedora-37-prebuilt-env
+ ref: master
+ artifacts: true
+
+fedora-37-upstream-qemu-tests-local-env:
+ extends:
+ - .integration_tests_local_env
+ - .fedora-37-upstream-qemu-tests
+ needs:
+ - x86_64-fedora-37-local-env
+ - project: libvirt/libvirt-perl
+ job: x86_64-fedora-37-prebuilt-env
+ ref: master
+ artifacts: true
+ - project: libvirt/libvirt-python
+ job: x86_64-fedora-37-prebuilt-env
ref: master
artifacts: true
diff --git a/ci/manifest.yml b/ci/manifest.yml
index 2aec92dd26..2aa9ce9952 100644
--- a/ci/manifest.yml
+++ b/ci/manifest.yml
@@ -116,14 +116,6 @@ targets:
containers: false
builds: false
- fedora-35:
- jobs:
- - arch: x86_64
- artifacts:
- expire_in: 1 day
- paths:
- - libvirt-rpms
-
fedora-36:
jobs:
- arch: x86_64
@@ -132,6 +124,14 @@ targets:
paths:
- libvirt-rpms
+ fedora-37:
+ jobs:
+ - arch: x86_64
+ artifacts:
+ expire_in: 1 day
+ paths:
+ - libvirt-rpms
+
- arch: mingw32
builds: false
--
2.39.0
1 year, 10 months
[PATCH] virNWFilterSnoopLeaseFileLoad: Don't typecast 'ipl.timeout'
by Peter Krempa
Use a temporary variable to avoid memory alignment issues on ARM:
../src/nwfilter/nwfilter_dhcpsnoop.c: In function ‘virNWFilterSnoopLeaseFileLoad’:
../src/nwfilter/nwfilter_dhcpsnoop.c:1745:20: error: cast increases required alignment of target type [-Werror=cast-align]
1745 | (unsigned long long *) &ipl.timeout,
|
Fixes: 0d278aa089bf3a00bf2d6e56d2f01ea4677190a7
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
Corresponding job:
https://gitlab.com/pipo.sk/libvirt/-/jobs/3565653957
src/nwfilter/nwfilter_dhcpsnoop.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c
index e604d67b96..20afc1b2d4 100644
--- a/src/nwfilter/nwfilter_dhcpsnoop.c
+++ b/src/nwfilter/nwfilter_dhcpsnoop.c
@@ -1733,6 +1733,8 @@ virNWFilterSnoopLeaseFileLoad(void)
fp = fopen(LEASEFILE, "r");
time(&now);
while (fp && fgets(line, sizeof(line), fp)) {
+ unsigned long long timeout;
+
if (line[strlen(line)-1] != '\n') {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("virNWFilterSnoopLeaseFileLoad lease file "
@@ -1742,13 +1744,13 @@ virNWFilterSnoopLeaseFileLoad(void)
ln++;
/* key len 54 = "VMUUID"+'-'+"MAC" */
if (sscanf(line, "%llu %54s %15s %15s",
- (unsigned long long *) &ipl.timeout,
- ifkey, ipstr, srvstr) < 4) {
+ &timeout, ifkey, ipstr, srvstr) < 4) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("virNWFilterSnoopLeaseFileLoad lease file "
"line %d corrupt"), ln);
break;
}
+ ipl.timeout = timeout;
if (ipl.timeout && ipl.timeout < now)
continue;
req = virNWFilterSnoopReqGetByIFKey(ifkey);
--
2.38.1
1 year, 10 months
[PATCH v2 00/17] Add support for passing FDs to access disk images
by Peter Krempa
v2:
- fixed uninitialized value usage when reading image header
Peter Krempa (17):
lib: Introduce virDomainFDAssociate API
virsh: Introduce 'dom-fd-associate' for invoking
virDomainFDAssociate()
conf: storage_source: Introduce type for storing FDs associated for
storage
qemu: Implement qemuDomainFDAssociate
qemuxml2argvtest: Add support for populating 'fds' in private data
conf: Add 'fdgroup' attribute for 'file' disks
qemu: domain: Introduce qemuDomainStartupCleanup
conf: storage_source: Introduce virStorageSourceIsFD
qemu: Prepare data for FD-passed disk image sources
qemu: block: Add support for passing FDs of disk images
secuirity: DAC: Don't relabel FD-passed virStorageSource images
security: selinux: Handle security labelling of FD-passed images
qemu: Prepare storage backing chain traversal code for FD passed
images
qemu: driver: Don't allow certain operations with FD-passed disks
qemu: cgroup: Don't setup cgroups for FD-passed images
qemu: Enable support for FD passed disk sources
qemuxml2*test: Enable testing of disks with 'fdgroup'
docs/formatdomain.rst | 8 ++
docs/manpages/virsh.rst | 19 +++
include/libvirt/libvirt-domain.h | 20 +++
src/conf/domain_conf.c | 2 +
src/conf/domain_conf.h | 1 +
src/conf/domain_postparse.c | 9 ++
src/conf/schemas/domaincommon.rng | 3 +
src/conf/storage_source_conf.c | 57 ++++++++
src/conf/storage_source_conf.h | 27 ++++
src/driver-hypervisor.h | 8 ++
src/libvirt-domain.c | 80 +++++++++++
src/libvirt_private.syms | 2 +
src/libvirt_public.syms | 5 +
src/qemu/qemu_block.c | 31 ++++-
src/qemu/qemu_cgroup.c | 4 +-
src/qemu/qemu_command.c | 22 +++
src/qemu/qemu_domain.c | 129 ++++++++++++++++--
src/qemu/qemu_domain.h | 11 +-
src/qemu/qemu_driver.c | 89 ++++++++++++
src/qemu/qemu_hotplug.c | 1 +
src/qemu/qemu_process.c | 2 +-
src/remote/remote_daemon_dispatch.c | 40 ++++++
src/remote/remote_driver.c | 27 ++++
src/remote/remote_protocol.x | 14 +-
src/remote_protocol-structs | 6 +
src/security/security_dac.c | 16 ++-
src/security/security_selinux.c | 32 ++++-
src/security/virt-aa-helper.c | 3 +-
src/storage_file/storage_source.c | 15 ++
.../disk-source-fd.x86_64-latest.args | 49 +++++++
tests/qemuxml2argvdata/disk-source-fd.xml | 40 ++++++
tests/qemuxml2argvtest.c | 9 ++
.../disk-source-fd.x86_64-latest.xml | 52 +++++++
tests/qemuxml2xmltest.c | 2 +
tests/testutilsqemu.c | 33 +++++
tests/testutilsqemu.h | 2 +
tools/virsh-domain.c | 76 +++++++++++
37 files changed, 923 insertions(+), 23 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-source-fd.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-source-fd.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-source-fd.x86_64-latest.xml
--
2.38.1
1 year, 10 months