Re: [Xen-devel] [PATCH V6 2/7] libxl_read_file_contents: add new entry to read sysfs file

2015-08-13 Thread Wei Liu
On Tue, Aug 11, 2015 at 08:37:09PM -0600, Chun Yan Liu wrote: [...] > > > + > > > +if (rs < datalen) { > > > +if (ferror(f)) { > > > LOGE(ERROR, "failed to read %s", filename); > > > -else if (feof(f)) > > > -LOG(ERROR, "%s chang

Re: [Xen-devel] [PATCH V6 2/7] libxl_read_file_contents: add new entry to read sysfs file

2015-08-11 Thread Chun Yan Liu
>>> On 8/11/2015 at 07:26 PM, in message <2015082655.ge7...@zion.uk.xensource.com>, Wei Liu wrote: > On Mon, Aug 10, 2015 at 06:35:23PM +0800, Chunyan Liu wrote: > > Sysfs file has size=4096 but actual file content is less than that. > > Current libxl_read_file_contents will treat it as e

Re: [Xen-devel] [PATCH V6 2/7] libxl_read_file_contents: add new entry to read sysfs file

2015-08-11 Thread Wei Liu
On Mon, Aug 10, 2015 at 06:35:23PM +0800, Chunyan Liu wrote: > Sysfs file has size=4096 but actual file content is less than that. > Current libxl_read_file_contents will treat it as error when file size > and actual file content differs, so reading sysfs file content with > this function always fa

[Xen-devel] [PATCH V6 2/7] libxl_read_file_contents: add new entry to read sysfs file

2015-08-10 Thread Chunyan Liu
Sysfs file has size=4096 but actual file content is less than that. Current libxl_read_file_contents will treat it as error when file size and actual file content differs, so reading sysfs file content with this function always fails. Add a new entry libxl_read_sysfs_file_contents to handle sysfs