]> git.proxmox.com Git - mirror_qemu.git/commit - exec.c
exec.c: do not truncate non-empty memory backend file
authorHaozhong Zhang <haozhong.zhang@intel.com>
Thu, 27 Oct 2016 04:22:58 +0000 (12:22 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 1 Nov 2016 15:06:57 +0000 (16:06 +0100)
commitd6af99c9f8d577927a52d00af3fa8e6ec0b2a4e2
tree167b621b32133f1e0a263b8497bff56c9d24fe43
parentf35e44e7645edbb08e35b111c10c2fc57e2905c7
exec.c: do not truncate non-empty memory backend file

For '-object memory-backend-file,mem-path=foo,size=xyz', if the size of
file 'foo' does not match the given size 'xyz', the current QEMU will
truncate the file to the given size, which may corrupt the existing data
in that file. To avoid such data corruption, this patch disables
truncating non-empty backend files.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Message-Id: <20161027042300.5929-2-haozhong.zhang@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
exec.c