physinfo->scrub_pages = xcphysinfo.scrub_pages;
physinfo->outstanding_pages = xcphysinfo.outstanding_pages;
l = xc_sharing_freed_pages(ctx->xch);
- if (l == -ENOSYS) {
+ if (l < 0 && errno == ENOSYS) {
l = 0;
} else if (l < 0) {
LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, l,
}
physinfo->sharing_freed_pages = l;
l = xc_sharing_used_frames(ctx->xch);
- if (l == -ENOSYS) {
+ if (l < 0 && errno == ENOSYS) {
l = 0;
} else if (l < 0) {
LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, l,
if( !strcasecmp(cmd, "info") )
{
+ long rc;
if( argc != 2 )
return usage(argv[0]);
- printf("used = %ld\n", xc_sharing_used_frames(xch));
- printf("freed = %ld\n", xc_sharing_freed_pages(xch));
+ rc = xc_sharing_freed_pages(xch);
+ if ( rc < 0 )
+ return 1;
+
+ printf("used = %ld\n", rc);
+ rc = xc_sharing_used_frames(xch);
+ if ( rc < 0 )
+ return 1;
+ printf("freed = %ld\n", rc);
}
else if( !strcasecmp(cmd, "enable") )
{