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>
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"));