libvirt/SOURCES/qemu-virtiofs-do-not-crash-if-cgroups-are-missing.patch
eabdullin 2daa9ba65a - cpu: x86: Add support for adding features to existing CPU models
- qemu: domain: Check arch in qemuDomainMakeCPUMigratable
- conf: cpu: Introduce virCPUDefListFeatures
- qemu: domain: Drop added features from migratable CPU
- Add vmx-* features to Broadwell*
- Add vmx-* features to Cascadelake*
- Add vmx-* features to Conroe
- Add vmx-* features to Cooperlake
- Add vmx-* features to core2duo
- Add vmx-* features to Haswell*
- Add vmx-* features to Icelake*
- Add vmx-* features to IvyBridge*
- Add vmx-* features to kvm*
- Add vmx-* features to Nehalem*
- Add vmx-* features to Penryn
- Add vmx-* features to SandyBridge*
- Add vmx-* features to SapphireRapids
- Add vmx-* features to Skylake*
- Add vmx-* features to Snowridge
- Add vmx-* features to Westmere*
- qemu: virtiofs: do not crash if cgroups are missing
- qemu: virtiofs: set correct label when creating the socket
- qemu: virtiofs: error out if getting the group or user name fails
2024-04-30 21:06:27 +03:00

35 lines
1.1 KiB
Diff

From a9da0092198ba2f278cea370f8251f2e29f57c7d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Tue, 5 Mar 2024 14:55:26 +0100
Subject: [PATCH] qemu: virtiofs: do not crash if cgroups are missing
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
On domain startup, qemuSetupCgroupForExtDevices checks
if a cgroup controller is present and skips the setup if not.
Add a similar check to qemuVirtioFSSetupCgroup to prevent
crashing when hotplugging a virtiofs filesystem.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_virtiofs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c
index d539d0a192e..15dea3bb57f 100644
--- a/src/qemu/qemu_virtiofs.c
+++ b/src/qemu/qemu_virtiofs.c
@@ -353,6 +353,9 @@ qemuVirtioFSSetupCgroup(virDomainObj *vm,
pid_t pid = -1;
int rc;
+ if (!cgroup)
+ return 0;
+
if (!(pidfile = qemuVirtioFSCreatePidFilename(vm, fs->info.alias)))
return -1;