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

Cyrill Gorcunov gorcunov at gmail.com
Thu Mar 13 04:25:21 PDT 2014


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);

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