]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: fix crash in qemuDomainSetBlkioParameters without cgroups
authorPavel Hrdina <phrdina@redhat.com>
Tue, 11 Aug 2020 13:56:54 +0000 (15:56 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Wed, 12 Aug 2020 12:43:01 +0000 (14:43 +0200)
commita6886aafacaf25d1ce667ae961264ae1eb69900f
tree5d628ef269e789c03c781fed59943da52fc1f3bd
parent61e56729ffdb1036cdc543add95009fc74f2a8d8
qemu: fix crash in qemuDomainSetBlkioParameters without cgroups

If we don't have cgroups available and user tries to update blkio
parameters for running VM it will crash.

It should have been protected by the virCgroupHasController() check but
it was never called if the API was executed without any flags.

We call virDomainObjGetDefs() which sets `def` and `persistentDef` based
on the flags and these two variables should be used to figure out if we
need to update LIVE, CONFIG or both states.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1808293

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_driver.c