aboutsummaryrefslogtreecommitdiffstats
path: root/domain.c
diff options
context:
space:
mode:
Diffstat (limited to 'domain.c')
-rw-r--r--domain.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/domain.c b/domain.c
index 002bb64..74b9879 100644
--- a/domain.c
+++ b/domain.c
@@ -413,6 +413,21 @@ void domain_shutdown(struct vconsole_domain *dom)
}
}
+void domain_reset(struct vconsole_domain *dom)
+{
+ virDomainPtr d = virDomainLookupByUUIDString(dom->conn->ptr, dom->uuid);
+
+ domain_update_info(dom, d);
+ switch (dom->info.state) {
+ case VIR_DOMAIN_RUNNING:
+ virDomainReset(d, 0);
+ break;
+ default:
+ fprintf(stderr, "%s: invalid guest state: %s\n",
+ __func__, domain_state_name(dom));
+ }
+}
+
void domain_kill(struct vconsole_domain *dom)
{
virDomainPtr d = virDomainLookupByUUIDString(dom->conn->ptr, dom->uuid);