Hi Huawei, Thanks for the comments, And my response as follows. > -----Original Message----- > From: Xie, Huawei > Sent: Thursday, November 6, 2014 10:39 AM > To: Ouyang, Changchun; dev at dpdk.org > Subject: RE: [dpdk-dev] [PATCH] librte_vhost: Fix the path test issue > > > path = realpath(memfile, resolved_path); > > - if (path == NULL) { > > + if ((path == NULL) && (strlen(resolved_path) == 0)) { > > RTE_LOG(ERR, VHOST_CONFIG, > > "(%"PRIu64") Failed to resolve fd directory\n", > > dev->device_fh); > Changchun: > For some strange file, according to API description, we shouldn't check > resolved_path as it is undefined. > To make the loop go on, we could use "continue" when we detect path is > NULL. > > RETURN VALUE > If there is no error, realpath() returns a pointer to the > resolved_path. > > Otherwise it returns a NULL pointer, and the contents of the array > resolved_path are undefined, and errno is set to indicate the error.
After my investigation this issue and find out using continue doesn't work. The reason is procmap.fname itself is "/dev/hugepages/qemu_back_mem.pc.ram.zxfqLq", It is not a normal path, so in this case, path is null, while resolved-path is /dev/hugepages/qemu_back_mem.pc.ram.zxfqLq If 'continue' is used, then procmap.fname could not be hit in the directory list, And then app will exit after report:?Failed to find memory file for pid.... So I have to keep it. Thanks again Changchun