@@ -896,7 +896,8 @@ int xc_nvdimm_pmem_get_regions_nr(xc_interface *xch, uint8_t type, uint32_t *nr)
if ( !nr ||
(type != PMEM_REGION_TYPE_RAW &&
- type != PMEM_REGION_TYPE_MGMT) )
+ type != PMEM_REGION_TYPE_MGMT &&
+ type != PMEM_REGION_TYPE_DATA) )
return -EINVAL;
sysctl.cmd = XEN_SYSCTL_nvdimm_op;
@@ -162,6 +162,10 @@ static int pmem_get_regions_nr(xen_sysctl_nvdimm_pmem_regions_nr_t *regions_nr)
regions_nr->num_regions = nr_mgmt_regions;
break;
+ case PMEM_REGION_TYPE_DATA:
+ regions_nr->num_regions = nr_data_regions;
+ break;
+
default:
rc = -EINVAL;
}
Allow XEN_SYSCTL_nvdimm_pmem_get_regions_nr to return the number of data PMEM regions. Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com> --- Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Wei Liu <wei.liu2@citrix.com> Cc: Andrew Cooper <andrew.cooper3@citrix.com> Cc: Jan Beulich <jbeulich@suse.com> --- tools/libxc/xc_misc.c | 3 ++- xen/common/pmem.c | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-)