From nobody Tue Nov 26 21:38:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1565092075; cv=none; d=zoho.com; s=zohoarc; b=d4MMgyoywTXsfCigY8chWeTi9WBGIh87pJwRqQE8YxiQmATXfvaQP/zTe2DllbHnv2narQf6esROgxFGSgXc2feljr+3poTf+0yOq/NynMh5305COraa4E3oIzJD2Dz1U5rrzZ4GP0mSa38D7qMTJa6o6aWuDDbs92wX6x1SO7U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565092075; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=DorKzWNz1ICCb/TZA2jaXQ8uMTuxdjpeZdzutjAGitU=; b=fQwz+tCAm1TdwTb22hkRnysAZgNeKiVulj/izQOps598EgU5glMtdtnvRzZ2WhpyAPL8QIr+PqtgX+teAqWWCnjyjJHdofe9T3zhvr2Clt1B1i1znd0V2TWXoCaStjff6ldkAxcA4AKZs8o6w4spV1IVxHF6vtMOvu709+hiNaE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565092075714474.15908564064136; Tue, 6 Aug 2019 04:47:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7E2BF30BCB80; Tue, 6 Aug 2019 11:47:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 54F6919C78; Tue, 6 Aug 2019 11:47:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1E46E180B536; Tue, 6 Aug 2019 11:47:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x76BlrR3022378 for ; Tue, 6 Aug 2019 07:47:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 03E255DA8C; Tue, 6 Aug 2019 11:47:53 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 379345DA21; Tue, 6 Aug 2019 11:47:52 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 6 Aug 2019 13:47:45 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: huaqiang.wang@intel.com Subject: [libvirt] [PATCH 2/3] qemuDomainGetResctrlMonData: Dereference resctrl monitor iff not NULL X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 06 Aug 2019 11:47:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" 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 --- src/qemu/qemu_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d5a8beb134..25b6653e38 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20744,7 +20744,8 @@ qemuDomainGetResctrlMonData(virQEMUDriverPtr driver, caps =3D virQEMUDriverGetCapabilities(driver, false); =20 if (tag =3D=3D VIR_RESCTRL_MONITOR_TYPE_CACHE) { - features =3D caps->host.cache.monitor->features; + if (caps->host.cache.monitor) + features =3D caps->host.cache.monitor->features; } else { virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", _("Unsupported resctrl monitor type")); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list