diff options
| author | Dov Murik | 2020-09-21 11:48:30 +0200 |
|---|---|---|
| committer | Dr. David Alan Gilbert | 2020-09-25 13:45:58 +0200 |
| commit | b4deb9bf8d97dbee07781e90e2089c6410ea9098 (patch) | |
| tree | 214818d68dbd5dd7dc871210ed04be7071e01d37 /migration | |
| parent | migration/dirtyrate: Add trace_calls to make it easier to debug (diff) | |
| download | qemu-b4deb9bf8d97dbee07781e90e2089c6410ea9098.tar.gz qemu-b4deb9bf8d97dbee07781e90e2089c6410ea9098.tar.xz qemu-b4deb9bf8d97dbee07781e90e2089c6410ea9098.zip | |
migration: Truncate state file in xen-save-devices-state
When running the xen-save-devices-state QMP command, if the filename
already exists it will be truncated before dumping the devices' state
into it.
Signed-off-by: Dov Murik <dovmurik@linux.vnet.ibm.com>
Message-Id: <20200921094830.114028-1-dovmurik@linux.vnet.ibm.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'migration')
| -rw-r--r-- | migration/savevm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/migration/savevm.c b/migration/savevm.c index ee21e981ba..34e4b71052 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2803,7 +2803,8 @@ void qmp_xen_save_devices_state(const char *filename, bool has_live, bool live, vm_stop(RUN_STATE_SAVE_VM); global_state_store_running(); - ioc = qio_channel_file_new_path(filename, O_WRONLY | O_CREAT, 0660, errp); + ioc = qio_channel_file_new_path(filename, O_WRONLY | O_CREAT | O_TRUNC, + 0660, errp); if (!ioc) { goto the_end; } |
