8000 Add a flag to the saveFlags function by liu-weifeng · Pull Request #3 · libvirt/libvirt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add a flag to the saveFlags function #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/libvirt/libvirt-domain.h
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ typedef enum {
VIR_DOMAIN_SAVE_BYPASS_CACHE = 1 << 0, /* Avoid file system cache pollution */
VIR_DOMAIN_SAVE_RUNNING = 1 << 1, /* Favor running over paused */
VIR_DOMAIN_SAVE_PAUSED = 1 << 2, /* Favor paused over running */
VIR_DOMAIN_SAVE_NOT_SHUTDOWN = 1 << 3, /* Do not shut down the domain */
} virDomainSaveRestoreFlags;

int virDomainSave (virDomainPtr domain,
Expand Down
15 changes: 9 additions & 6 deletions src/qemu/qemu_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3258,11 +3258,13 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom,
if (ret < 0)
goto endjob;

/* Shut it down */
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SAVED, 0);
virDomainAuditStop(vm, "saved");
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_SAVED);
if (!(flags&VIR_DOMAIN_SAVE_NOT_SHUTDOWN)) {
/* Shut it down */
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SAVED, 0);
virDomainAuditStop(vm, "saved");
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_SAVED);
}
endjob:
if (ret < 0) {
if (was_running && virDomainObjIsActive(vm)) {
Expand Down Expand Up @@ -3319,7 +3321,8 @@ qemuDomainSaveFlags(virDomainPtr dom, const char *path, const char *dxml,

virCheckFlags(VIR_DOMAIN_SAVE_BYPASS_CACHE |
VIR_DOMAIN_SAVE_RUNNING |
VIR_DOMAIN_SAVE_PAUSED, -1);
VIR_DOMAIN_SAVE_PAUSED |
VIR_DOMAIN_SAVE_NOT_SHUTDOWN, -1);

cfg = virQEMUDriverGetConfig(driver);
if (cfg->saveImageFormat) {
Expand Down
0