On Thu, Oct 20, 2016 at 02:27:06PM +0100, Daniel P. Berrange wrote:
> On Thu, Oct 20, 2016 at 02:34:12PM +0200, Igor Mammedov wrote:
> > On Thu, 20 Oct 2016 14:13:01 +0800
> > Haozhong Zhang <haozhong.zh...@intel.com> wrote:
> > 
> > > If a file is used as the backend of memory-backend-file and its size is
> > > not identical to the property 'size', the file will be truncated. For a
> > > file used as the backend of vNVDIMM, its data is expected to be
> > > persistent and the truncation may corrupt the existing data.
> > I wonder if it's possible just skip 'size' property in your case instead
> > 'notrunc' property. That way if size is not present one'd get actual size
> > using get_file_size() and set 'size' to it?
> > And if 'size' is provided and 'size' != file_size then error out.
> 
> That works if you always want to expose the entire file, but if you
> intentionally only want to expose a subset you would still want
> to set a size (and possibly offset too) and avoid the truncation

In this case, if you don't want truncation at all you shouldn't
need to set a size on the backend object. Then QEMU could simply
use the size specified in the frontend config (i.e. from -numa
and/or -m).

-- 
Eduardo

Reply via email to