diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2012-09-06 14:17:34 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2012-09-06 14:17:34 +0200 |
commit | 0b005f4cff8ae28655243043529fa091a481c9fa (patch) | |
tree | 767d4f67afe4f17801965af8181c8ae37eb06617 /domain.c | |
parent | 8776506e3cabba93083438fef1587de915af8113 (diff) | |
download | vconsole-0b005f4cff8ae28655243043529fa091a481c9fa.tar.gz |
add menu item to save guest to disk
Diffstat (limited to 'domain.c')
-rw-r--r-- | domain.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -313,6 +313,22 @@ void domain_pause(struct vconsole_domain *dom) } } +void domain_save(struct vconsole_domain *dom) +{ + virDomainPtr d = virDomainLookupByUUIDString(dom->conn->ptr, dom->uuid); + + virDomainGetInfo(d, &dom->info); + switch (dom->info.state) { + case VIR_DOMAIN_RUNNING: + case VIR_DOMAIN_PAUSED: + virDomainManagedSave(d, 0); + break; + default: + fprintf(stderr, "%s: invalid guest state: %s\n", + __func__, domain_state_name(dom)); + } +} + void domain_reboot(struct vconsole_domain *dom) { virDomainPtr d = virDomainLookupByUUIDString(dom->conn->ptr, dom->uuid); |