mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
qemuDomainGetResctrlMonData: Dereference resctrl monitor iff not NULL
If the host doesn't have resctrl then the monitor is going to be NULL and we must avoid dereferencing it. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
9801ee899f
commit
9fc616cc10
@ -20744,7 +20744,8 @@ qemuDomainGetResctrlMonData(virQEMUDriverPtr driver,
|
||||
caps = virQEMUDriverGetCapabilities(driver, false);
|
||||
|
||||
if (tag == VIR_RESCTRL_MONITOR_TYPE_CACHE) {
|
||||
features = caps->host.cache.monitor->features;
|
||||
if (caps->host.cache.monitor)
|
||||
features = caps->host.cache.monitor->features;
|
||||
} else {
|
||||
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
|
||||
_("Unsupported resctrl monitor type"));
|
||||
|
Loading…
Reference in New Issue
Block a user