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

Pavel Emelyanov xemul at parallels.com
Thu Mar 13 04:46:02 PDT 2014


On 03/13/2014 03:35 PM, Cyrill Gorcunov wrote:
> On Thu, Mar 13, 2014 at 03:31:30PM +0400, Pavel Emelyanov wrote:
>>>>
>>>> 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;
> 
> This should not be error or warning, that was the point.
> Look, someone start "show" action on new image format,
> why should there be "missing image" warning yielded?

OK, let's say that some flag (O_EXCL? O_SMTHELSE) to denote
the optionality of an image. Not the whole new call.

> Don't get me wrong, it's not a problem to update
> open_image_at I just think it wont be convenient.
> Or maybe I misunderstand you and you propose to
> drop pr_perror from open_image_at body itself and
> leave error message to be produced by a caller instead?
> .
> 




More information about the CRIU mailing list