mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00: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);
|
caps = virQEMUDriverGetCapabilities(driver, false);
|
||||||
|
|
||||||
if (tag == VIR_RESCTRL_MONITOR_TYPE_CACHE) {
|
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 {
|
} else {
|
||||||
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
|
||||||
_("Unsupported resctrl monitor type"));
|
_("Unsupported resctrl monitor type"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user