From 418c62b58e7e7cea94bd92ab773daffa0b2f0512 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 14 Sep 2012 15:16:27 +0200 Subject: reset button --- domain.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'domain.c') 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); -- cgit