From nobody Mon Apr 29 03:00:27 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.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; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 149188932346047.327031714875034; Mon, 10 Apr 2017 22:42:03 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CAA9A624B0; Tue, 11 Apr 2017 05:41:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5DB347EF7C; Tue, 11 Apr 2017 05:41:58 +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 9B9761F8; Tue, 11 Apr 2017 05:41:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v3B5frOF019384 for ; Tue, 11 Apr 2017 01:41:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2D7C2B3904; Tue, 11 Apr 2017 05:41:53 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6B6F6B38FA; Tue, 11 Apr 2017 05:41:51 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6000719CF24; Tue, 11 Apr 2017 05:41:48 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2017 22:41:47 -0700 Received: from s2600wt.sh.intel.com ([10.239.48.158]) by fmsmga001.fm.intel.com with ESMTP; 10 Apr 2017 22:41:45 -0700 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CAA9A624B0 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=intel.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CAA9A624B0 Authentication-Results: mx1.redhat.com; dkim=fail reason="key not found in DNS" (0-bit key) header.d=intel.com header.i=@intel.com header.b="R+X8sL3s" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6000719CF24 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=intel.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=liyong.qiao@intel.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6000719CF24 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491889309; x=1523425309; h=from:to:cc:subject:date:message-id; bh=QCrhl9poIRswAmHPMCbyDFYWsT8Zhae1I0J4PhVaK/Q=; b=R+X8sL3sBftVjJ1cFNCEiH5pqjcHkbbos54AOwPFbLCBwXeTvih8aWKB KY6wvREGtHeICgOnJ4Sdwpzx/03nyw==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,184,1488873600"; d="scan'208";a="1133801676" From: Eli Qiao To: libvir-list@redhat.com Date: Tue, 11 Apr 2017 13:44:26 +0800 Message-Id: <1491889466-69978-1-git-send-email-liyong.qiao@intel.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 203 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 11 Apr 2017 05:41:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 11 Apr 2017 05:41:49 +0000 (UTC) for IP:'134.134.136.65' DOMAIN:'mga03.intel.com' HELO:'mga03.intel.com' FROM:'liyong.qiao@intel.com' RCPT:'' X-RedHat-Spam-Score: -4.192 (BAYES_50, DCC_REPUT_13_19, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SPF_PASS, T_DKIM_INVALID) 134.134.136.65 mga03.intel.com 134.134.136.65 mga03.intel.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: mkletzan@redhat.com, liyong.qiao@intel.com Subject: [libvirt] [PATCH V4] Expose resource control capabilites on cache bank 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 11 Apr 2017 05:42:01 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch is based on Martin's cache branch. * This patch amends the cache bank capability as follow: For CDP enabled on x86 arch, we will have: ... * Added a new testdata directory `linux-resctrl-cdp` to test CDP enabled case. * Along with vircaps2xmltest case updated. P.S. here the scope is from /sys/fs/resctrl/info/L3{"" "CODE" "DATA"}, I keep it capital upper as I need to use a macro to convert from enum to string easily. Signed-off-by: Eli Qiao --- docs/schemas/capability.rng | 20 +++ src/conf/capabilities.c | 135 +++++++++++++++++= +++- src/conf/capabilities.h | 26 +++- .../vircaps2xmldata/linux-resctrl-cdp/resctrl/cpus | 1 + .../linux-resctrl-cdp/resctrl/info/L3CODE/cbm_mask | 1 + .../resctrl/info/L3CODE/min_cbm_bits | 1 + .../resctrl/info/L3CODE/num_closids | 1 + .../linux-resctrl-cdp/resctrl/info/L3DATA/cbm_mask | 1 + .../resctrl/info/L3DATA/min_cbm_bits | 1 + .../resctrl/info/L3DATA/num_closids | 1 + .../linux-resctrl-cdp/resctrl/manualres/cpus | 1 + .../linux-resctrl-cdp/resctrl/manualres/schemata | 2 + .../linux-resctrl-cdp/resctrl/manualres/tasks | 0 .../linux-resctrl-cdp/resctrl/schemata | 2 + .../linux-resctrl-cdp/resctrl/tasks | 0 tests/vircaps2xmldata/linux-resctrl-cdp/system | 1 + .../vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml | 55 +++++++++ tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml | 8 +- tests/vircaps2xmltest.c | 10 ++ 19 files changed, 261 insertions(+), 6 deletions(-) create mode 100644 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/cpus create mode 100755 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3= CODE/cbm_mask create mode 100755 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3= CODE/min_cbm_bits create mode 100755 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3= CODE/num_closids create mode 100755 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3= DATA/cbm_mask create mode 100755 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3= DATA/min_cbm_bits create mode 100755 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3= DATA/num_closids create mode 100644 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualr= es/cpus create mode 100644 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualr= es/schemata create mode 100644 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualr= es/tasks create mode 100644 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/schemata create mode 100644 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/tasks create mode 120000 tests/vircaps2xmldata/linux-resctrl-cdp/system create mode 100644 tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng index 2080953..bfed4f8 100644 --- a/docs/schemas/capability.rng +++ b/docs/schemas/capability.rng @@ -277,6 +277,26 @@ + + + + + + + + + + + BOTH + CODE + DATA + + + + + + + diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 416dd1a..c6641d1 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -52,6 +52,7 @@ #define VIR_FROM_THIS VIR_FROM_CAPABILITIES =20 #define SYSFS_SYSTEM_PATH "/sys/devices/system/" +#define SYSFS_RESCTRL_PATH "/sys/fs/resctrl/" =20 VIR_LOG_INIT("conf.capabilities") =20 @@ -873,6 +874,9 @@ virCapabilitiesFormatCaches(virBufferPtr buf, virCapsHostCacheBankPtr *caches) { size_t i =3D 0; + size_t j =3D 0; + int indent =3D virBufferGetIndent(buf, false); + virBuffer controlBuf =3D VIR_BUFFER_INITIALIZER; =20 if (!ncaches) return 0; @@ -894,13 +898,38 @@ virCapabilitiesFormatCaches(virBufferPtr buf, */ virBufferAsprintf(buf, "\n", + "size=3D'%llu' unit=3D'%s' cpus=3D'%s'", bank->id, bank->level, virCacheTypeToString(bank->type), bank->size >> (kilos * 10), kilos ? "KiB" : "B", cpus_str); =20 + /* Format control */ + virBufferAdjustIndent(&controlBuf, indent + 4); + for (j =3D 0; j < bank->ncontrols; j++) { + bool min_kilos =3D !(bank->controls[j]->min % 1024); + virBufferAsprintf(&controlBuf, + "\n", + bank->controls[j]->min >> (min_kilos * 10), + min_kilos ? "KiB" : "B", + virResctrlCacheTypeToString(bank->controls[j= ]->scope), + bank->controls[j]->max_allocation); + } + + /* Put it all together */ + if (virBufferUse(&controlBuf)) { + virBufferAddLit(buf, ">\n"); + virBufferAddBuffer(buf, &controlBuf); + virBufferAddLit(buf, "\n"); + + } else { + virBufferAddLit(buf, "/>\n"); + } + + + virBufferFreeAndReset(&controlBuf); VIR_FREE(cpus_str); } =20 @@ -1513,13 +1542,101 @@ virCapsHostCacheBankEquals(virCapsHostCacheBankPtr= a, void virCapsHostCacheBankFree(virCapsHostCacheBankPtr ptr) { + size_t i; + if (!ptr) return; =20 virBitmapFree(ptr->cpus); + for (i =3D 0; i < ptr->ncontrols; i++) + VIR_FREE(ptr->controls[i]); + VIR_FREE(ptr->controls); VIR_FREE(ptr); } =20 +VIR_ENUM_IMPL(virResctrlCache, VIR_RESCTRL_CACHE_TYPE_LAST, + "BOTH", + "CODE", + "DATA") + +/* test which TYPE of cache control supported + * -1: don't support + * 0: cat + * 1: cdp + */ +static int +virCapabilitiesGetCacheControlType(virCapsHostCacheBankPtr bank) +{ + int ret =3D -1; + char *path =3D NULL; + if (virAsprintf(&path, + SYSFS_RESCTRL_PATH "info/L%u", + bank->level) < 0) + return -1; + + if (virFileExists(path)) { + ret =3D 0; + } else { + VIR_FREE(path); + /* for CDP enabled case, CODE and DATA will show together */ + if (virAsprintf(&path, + SYSFS_RESCTRL_PATH "info/L%uCODE", + bank->level) < 0) + return -1; + if (virFileExists(path)) + ret =3D 1; + } + + VIR_FREE(path); + return ret; +} + +static int +virCapabilitiesGetCacheControl(virCapsHostCacheBankPtr bank, + virResctrlCacheType scope) +{ + int ret =3D -1; + char *path =3D NULL; + char *cbm_mask =3D NULL; + virCapsHostCacheControlPtr control; + + if (VIR_ALLOC(control) < 0) + goto cleanup; + + if (virFileReadValueUint(&control->max_allocation, + SYSFS_RESCTRL_PATH "info/L%u%s/num_closids", + bank->level, + scope ? virResctrlCacheTypeToString(scope) : = "") < 0) + goto cleanup; + + if (virFileReadValueString(&cbm_mask, + SYSFS_RESCTRL_PATH + "info/L%u%s/cbm_mask", + bank->level, + scope ? virResctrlCacheTypeToString(scope) = : "") < 0) + goto cleanup; + + virStringTrimOptionalNewline(cbm_mask); + + control->min =3D bank->size / (strlen(cbm_mask) * 4); + + control->scope =3D scope; + + if (VIR_APPEND_ELEMENT(bank->controls, + bank->ncontrols, + control) < 0) + goto error; + + ret =3D 0; + + cleanup: + VIR_FREE(path); + return ret; + error: + VIR_FREE(control); + return -1; +} + int virCapabilitiesInitCaches(virCapsPtr caps) { @@ -1595,7 +1712,21 @@ virCapabilitiesInitCaches(virCapsPtr caps) pos, ent->d_name) < 0) goto cleanup; =20 - if (bank->level < cache_min_level) { + ret =3D virCapabilitiesGetCacheControlType(bank); + + if ((bank->level >=3D cache_min_level) || (ret >=3D 0)) { + if (ret =3D=3D 0) { + if (virCapabilitiesGetCacheControl(bank, + VIR_RESCTRL_CACHE_T= YPE_BOTH) < 0) + goto cleanup; + } else if (ret =3D=3D 1) { + if ((virCapabilitiesGetCacheControl(bank, + VIR_RESCTRL_CACHE_= TYPE_CODE) < 0) || + (virCapabilitiesGetCacheControl(bank, + VIR_RESCTRL_CA= CHE_TYPE_DATA) < 0)) + goto cleanup; + } + } else { virCapsHostCacheBankFree(bank); bank =3D NULL; continue; diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h index e099ccc..5fd3e57 100644 --- a/src/conf/capabilities.h +++ b/src/conf/capabilities.h @@ -138,10 +138,30 @@ struct _virCapsHostSecModel { virCapsHostSecModelLabelPtr labels; }; =20 +/* the enum value is equal to virCacheType, but we define a new enum + as for resctrl it has different statement */ +typedef enum { + VIR_RESCTRL_CACHE_TYPE_BOTH, + VIR_RESCTRL_CACHE_TYPE_CODE, + VIR_RESCTRL_CACHE_TYPE_DATA, + + VIR_RESCTRL_CACHE_TYPE_LAST +} virResctrlCacheType; + +VIR_ENUM_DECL(virResctrlCache); + +typedef struct _virCapsHostCacheControl virCapsHostCacheControl; +typedef virCapsHostCacheControl *virCapsHostCacheControlPtr; +struct _virCapsHostCacheControl { + unsigned long long min; /* B */ + virResctrlCacheType scope; /* Data, Code or Both */ + unsigned int max_allocation; /* max number of supported allocations */ +}; + typedef enum { - VIR_CACHE_TYPE_DATA, - VIR_CACHE_TYPE_INSTRUCTION, VIR_CACHE_TYPE_UNIFIED, + VIR_CACHE_TYPE_INSTRUCTION, + VIR_CACHE_TYPE_DATA, =20 VIR_CACHE_TYPE_LAST } virCacheType; @@ -156,6 +176,8 @@ struct _virCapsHostCacheBank { unsigned long long size; /* B */ virCacheType type; /* Data, Instruction or Unified */ virBitmapPtr cpus; /* All CPUs that share this bank */ + size_t ncontrols; + virCapsHostCacheControlPtr *controls; }; =20 typedef struct _virCapsHost virCapsHost; diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/cpus b/tests/v= ircaps2xmldata/linux-resctrl-cdp/resctrl/cpus new file mode 100644 index 0000000..b3a79aa --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/cpus @@ -0,0 +1 @@ +ffffff,ffffffff,ffffffff diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/cb= m_mask b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/cbm_ma= sk new file mode 100755 index 0000000..78031da --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/cbm_mask @@ -0,0 +1 @@ +fffff diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/mi= n_cbm_bits b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/mi= n_cbm_bits new file mode 100755 index 0000000..d00491f --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/min_cbm_b= its @@ -0,0 +1 @@ +1 diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/nu= m_closids b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/num= _closids new file mode 100755 index 0000000..45a4fb7 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/num_closi= ds @@ -0,0 +1 @@ +8 diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/cb= m_mask b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/cbm_ma= sk new file mode 100755 index 0000000..78031da --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/cbm_mask @@ -0,0 +1 @@ +fffff diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/mi= n_cbm_bits b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/mi= n_cbm_bits new file mode 100755 index 0000000..d00491f --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/min_cbm_b= its @@ -0,0 +1 @@ +1 diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/nu= m_closids b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/num= _closids new file mode 100755 index 0000000..45a4fb7 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/num_closi= ds @@ -0,0 +1 @@ +8 diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/cpus= b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/cpus new file mode 100644 index 0000000..ede4cc2 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/cpus @@ -0,0 +1 @@ +000000,00000000,00000000 diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/sche= mata b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/schemata new file mode 100644 index 0000000..a0ef381 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/schemata @@ -0,0 +1,2 @@ +L3DATA:0=3Dc0000;1=3Dc0000 +L3CODE:0=3D30000;1=3D30000 diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/task= s b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/tasks new file mode 100644 index 0000000..e69de29 diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/schemata b/tes= ts/vircaps2xmldata/linux-resctrl-cdp/resctrl/schemata new file mode 100644 index 0000000..89dc76b --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/schemata @@ -0,0 +1,2 @@ +L3DATA:0=3Dfffff;1=3Dfffff +L3CODE:0=3Dfffff;1=3Dfffff diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/tasks b/tests/= vircaps2xmldata/linux-resctrl-cdp/resctrl/tasks new file mode 100644 index 0000000..e69de29 diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/system b/tests/vircaps= 2xmldata/linux-resctrl-cdp/system new file mode 120000 index 0000000..2f3a1d9 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl-cdp/system @@ -0,0 +1 @@ +../linux-resctrl/system/ \ No newline at end of file diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml b/tests/v= ircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml new file mode 100644 index 0000000..1242d2e --- /dev/null +++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml @@ -0,0 +1,55 @@ + + + + + x86_64 + + + + + + + + + 1048576 + 2048 + 4096 + 6144 + + + + + + + + + + + 2097152 + 4096 + 6144 + 8192 + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml b/tests/virca= ps2xmldata/vircaps-x86_64-resctrl.xml index c30ea87..ad2ca62 100644 --- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml +++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml @@ -41,8 +41,12 @@ - - + + + + + + =20 diff --git a/tests/vircaps2xmltest.c b/tests/vircaps2xmltest.c index f590249..db7de4c 100644 --- a/tests/vircaps2xmltest.c +++ b/tests/vircaps2xmltest.c @@ -47,6 +47,7 @@ test_virCapabilities(const void *opaque) char *capsXML =3D NULL; char *path =3D NULL; char *dir =3D NULL; + char *resctrl =3D NULL; int ret =3D -1; =20 /* @@ -58,6 +59,13 @@ test_virCapabilities(const void *opaque) data->resctrl ? "/system" : "") < 0) goto cleanup; =20 + if (virAsprintf(&resctrl, "%s/vircaps2xmldata/linux-%s/resctrl", + abs_srcdir, + data->resctrl ? data->filename : "foo") < 0) + goto cleanup; + + + virFileMockAddPrefix("/sys/fs/resctrl", resctrl); virFileMockAddPrefix("/sys/devices/system", dir); caps =3D virCapabilitiesNew(data->arch, data->offlineMigrate, data->li= veMigrate); =20 @@ -84,6 +92,7 @@ test_virCapabilities(const void *opaque) =20 cleanup: VIR_FREE(dir); + VIR_FREE(resctrl); VIR_FREE(path); VIR_FREE(capsXML); virObjectUnref(caps); @@ -112,6 +121,7 @@ mymain(void) DO_TEST("caches", VIR_ARCH_X86_64); =20 DO_TEST_FULL("resctrl", VIR_ARCH_X86_64, true, true, true); + DO_TEST_FULL("resctrl-cdp", VIR_ARCH_X86_64, true, true, true); =20 return ret; } --=20 1.9.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list