diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2012-09-14 15:16:27 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2012-09-14 15:16:27 +0200 |
commit | 418c62b58e7e7cea94bd92ab773daffa0b2f0512 (patch) | |
tree | 886d68830446ff428dfdecb56c1d48ad7ffe838b /domain.c | |
parent | dd5b27b164ffd16756218795b4f6c1892ad795d2 (diff) | |
download | vconsole-418c62b58e7e7cea94bd92ab773daffa0b2f0512.tar.gz |
reset button
Diffstat (limited to 'domain.c')
-rw-r--r-- | domain.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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); |