On Fri, Oct 28, 2016 at 10:07:40AM +0800, Haozhong Zhang wrote: > On 10/27/16 12:31 -0200, Eduardo Habkost wrote: > > On Thu, Oct 27, 2016 at 12:22:58PM +0800, Haozhong Zhang wrote: > > > 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.zh...@intel.com> > > > > Reviewed-by: Eduardo Habkost <ehabk...@redhat.com> > > > > But I would add comment near the get_file_size() call to indicate > > that not stopping on get_file_size() errors is on purpose and not > > a mistake. > > > > I'll add comments in the next version. >
The patch was applied to machine-next and will be in my next pull request. The comment can be sent as a follow-up patch. -- Eduardo