{
xc_physinfo_t xcphysinfo = { 0 };
int rc;
+ long l;
rc = xc_physinfo(ctx->xch, &xcphysinfo);
if (rc != 0) {
physinfo->total_pages = xcphysinfo.total_pages;
physinfo->free_pages = xcphysinfo.free_pages;
physinfo->scrub_pages = xcphysinfo.scrub_pages;
- physinfo->sharing_freed_pages = xc_sharing_freed_pages(ctx->xch);
- physinfo->sharing_used_frames = xc_sharing_used_frames(ctx->xch);
+ l = xc_sharing_freed_pages(ctx->xch);
+ if (l == -ENOSYS) {
+ l = 0;
+ } else if (l < 0) {
+ LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, l,
+ "getting sharing freed pages");
+ return ERROR_FAIL;
+ }
+ physinfo->sharing_freed_pages = l;
+ l = xc_sharing_used_frames(ctx->xch);
+ if (l == -ENOSYS) {
+ l = 0;
+ } else if (l < 0) {
+ LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, l,
+ "getting sharing used frames");
+ return ERROR_FAIL;
+ }
+ physinfo->sharing_used_frames = l;
physinfo->nr_nodes = xcphysinfo.nr_nodes;
memcpy(physinfo->hw_cap,xcphysinfo.hw_cap, sizeof(physinfo->hw_cap));