static const vshCmdOptDef opts_list[] = {
{"inactive", VSH_OT_BOOL, 0, N_("list inactive domains")},
{"all", VSH_OT_BOOL, 0, N_("list inactive & active domains")},
+ {"managed-save", VSH_OT_BOOL, 0,
+ N_("mark domains with managed save state")},
{NULL, 0, 0, NULL}
};
int *ids = NULL, maxid = 0, i;
char **names = NULL;
int maxname = 0;
+ bool managed = vshCommandOptBool(cmd, "managed-save");
+ int state;
+
inactive |= all;
if (!vshConnectionUsability(ctl, ctl->conn))
vshPrint(ctl, "%3d %-20s %s\n",
virDomainGetID(dom),
virDomainGetName(dom),
- vshDomainStateToString(vshDomainState(ctl, dom, NULL)));
+ _(vshDomainStateToString(vshDomainState(ctl, dom, NULL))));
virDomainFree(dom);
}
for (i = 0; i < maxname; i++) {
continue;
}
+ state = vshDomainState(ctl, dom, NULL);
+ if (managed && state == VIR_DOMAIN_SHUTOFF &&
+ virDomainHasManagedSaveImage(dom, 0) > 0)
+ state = -2;
+
vshPrint(ctl, "%3s %-20s %s\n",
"-",
names[i],
- vshDomainStateToString(vshDomainState(ctl, dom, NULL)));
+ state == -2 ? _("saved") : _(vshDomainStateToString(state)));
virDomainFree(dom);
VIR_FREE(names[i]);
Inject NMI to the guest.
-=item B<list> [I<--inactive> | I<--all>]
+=item B<list> [I<--inactive> | I<--all>] [I<--managed-save>]
Prints information about existing domains. If no options are
specified it prints out information about running domains.
=back
+If I<--managed-save> is specified, then domains that have managed save
+state (only possible if they are in the B<shut off> state) will
+instead show as B<saved> in the listing.
+
=item B<freecell> [B<cellno> | I<--all>]
Prints the available amount of memory on the machine or within a