[CRIU] [PATCH 1/7] image: Refine open_image helpers

Pavel Emelyanov xemul at parallels.com
Thu Mar 13 04:31:30 PDT 2014


On 03/13/2014 03:25 PM, Cyrill Gorcunov wrote:
> On Thu, Mar 13, 2014 at 02:39:50PM +0400, Pavel Emelyanov wrote:
>> On 03/13/2014 02:30 PM, Cyrill Gorcunov wrote:
>>>
>>> Because we're merging image files one into another
>>> for backward compatibility we need to try to access
>>> old image files without producing error message if
>>> such image file doesn't exist.
>>>
>>> Thus alternate open_image to take @optional argument,
>>> which makes it exit with -ENOENT error code but don't
>>> print any error message if file doesn't exits.
>>>
>>> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
>>> ---
>>>  image.c         |  4 +++-
>>>  include/image.h | 15 +++++++++++++--
>>>  2 files changed, 16 insertions(+), 3 deletions(-)
>>>
>>
>>
>> Just make existing open_image_at() report -ENOENT in case
>> of image is missing. No need in separate fn.
> 
> So who will be printing
> 
> 	pr_perror("Unable to open %s", path);

open_image()
if (errno == ENOENT)
	pr_warn("missing image");
	return -ENOENT;

> if image needed? Every caller? Look, this helper allows
> to specify a context of calling: if image is optional
> then no need to issue any error message.
> .
> 




More information about the CRIU mailing list