Prints the current uptime of the domains running.
+=item B<claims>
+
+Prints information about outstanding claims by the guests. This provides
+the outstanding claims and currently populated memory count for the guests.
+These values added up reflect the global outstanding claim value, which
+is provided via the I<info> argument, B<outstanding_claims> value.
+The B<Mem> column has the cumulative value of outstanding claims and
+the total amount of memory that has been right now allocated to the guest.
+
+B<EXAMPLE>
+
+An example format for the list is as follows:
+
+ Name ID Mem VCPUs State Time(s) Claimed
+ Domain-0 0 2047 4 r----- 19.7 0
+ OL5 2 2048 1 --p--- 0.0 847
+ OL6 3 1024 4 r----- 5.9 0
+ Windows_XP 4 2047 1 --p--- 0.0 1989
+
+In which it can be seen that the OL5 guest still has 847MB of claimed
+memory (out of the total 2048MB where 1191MB has been allocated to
+the guest).
+
=back
=head1 SCHEDULER SUBCOMMANDS
}
}
-static void list_domains(int verbose, int context, const libxl_dominfo *info, int nb_domain)
+static void list_domains(int verbose, int context, int claim,
+ const libxl_dominfo *info, int nb_domain)
{
int i;
static const char shutdown_reason_letters[]= "-rscw";
printf("Name ID Mem VCPUs\tState\tTime(s)");
if (verbose) printf(" UUID Reason-Code\tSecurity Label");
if (context && !verbose) printf(" Security Label");
+ if (claim) printf(" Claimed");
printf("\n");
for (i = 0; i < nb_domain; i++) {
char *domname;
printf("%-40s %5d %5lu %5d %c%c%c%c%c%c %8.1f",
domname,
info[i].domid,
- (unsigned long) (info[i].current_memkb / 1024),
+ (unsigned long) ((info[i].current_memkb +
+ info[i].outstanding_memkb)/ 1024),
info[i].vcpu_online,
info[i].running ? 'r' : '-',
info[i].blocked ? 'b' : '-',
if (info[i].shutdown) printf(" %8x", shutdown_reason);
else printf(" %8s", "-");
}
+ if (claim)
+ printf(" %5lu", (unsigned long)info[i].outstanding_memkb / 1024);
if (verbose || context) {
int rc;
size_t size;
if (details)
list_domains_details(info, nb_domain);
else
- list_domains(verbose, context, info, nb_domain);
+ list_domains(verbose, context, 0 /* claim */, info, nb_domain);
if (info_free)
libxl_dominfo_list_free(info, nb_domain);
printf("%-40s %5d %5lu %5lu\n",
domname,
info[i].domid,
- (unsigned long) (info[i].current_memkb / 1024),
+ (unsigned long) ((info[i].current_memkb +
+ info[i].outstanding_memkb) / 1024),
(unsigned long) (info[i].shared_memkb / 1024));
free(domname);
}
return time_string;
}
+int main_claims(int argc, char **argv)
+{
+ libxl_dominfo *info;
+ int opt;
+ int nb_domain;
+
+ SWITCH_FOREACH_OPT(opt, "", NULL, "claims", 0) {
+ /* No options */
+ }
+
+ if (!libxl_defbool_val(claim_mode))
+ fprintf(stderr, "claim_mode not enabled (see man xl.conf).\n");
+
+ info = libxl_list_domain(ctx, &nb_domain);
+ if (!info) {
+ fprintf(stderr, "libxl_domain_infolist failed.\n");
+ return 1;
+ }
+
+ list_domains(0 /* verbose */, 0 /* context */, 1 /* claim */,
+ info, nb_domain);
+
+ libxl_dominfo_list_free(info, nb_domain);
+ return 0;
+}
+
static char *current_time_to_string(time_t now)
{
char now_str[100];