mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: virtiofs: do not crash if cgroups are missing
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>
This commit is contained in:
parent
0bb33164d0
commit
a9da009219
@ -353,6 +353,9 @@ qemuVirtioFSSetupCgroup(virDomainObj *vm,
|
|||||||
pid_t pid = -1;
|
pid_t pid = -1;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
if (!cgroup)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (!(pidfile = qemuVirtioFSCreatePidFilename(vm, fs->info.alias)))
|
if (!(pidfile = qemuVirtioFSCreatePidFilename(vm, fs->info.alias)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user