[CRIU] [PATCH 1/3] logfd: Distinguish functions which do setup logdf

Kir Kolyshkin kir at openvz.org
Tue Feb 28 17:36:02 EST 2012


On Feb 29, 2012 2:25 AM, "Cyrill Gorcunov" <gorcunov at openvz.org> wrote:
>
> We have a few helper functions which all do setup
> logfd but in different program flow context. So
> rename them just to be able to distinguish them
> without much effort.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  include/restorer-log.h |    2 +-
>  parasite.c             |    4 ++--
>  restorer-log.c         |    2 +-
>  restorer.c             |    2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/include/restorer-log.h b/include/restorer-log.h
> index f038dd0..7a2316f 100644
> --- a/include/restorer-log.h
> +++ b/include/restorer-log.h
> @@ -7,5 +7,5 @@ extern void write_num_n(long num);
>  extern void write_num(long num);
>  extern void write_string_n(char *str);
>  extern void write_string(char *str);
> -extern void set_logfd(int fd);
> +extern void restorer_set_logfd(int fd);
>  #endif
> diff --git a/parasite.c b/parasite.c
> index 9a9114f..8fffa18 100644
> --- a/parasite.c
> +++ b/parasite.c
> @@ -410,7 +410,7 @@ static int init(struct parasite_init_args *args)
>        return ret;
>  }
>
> -static int set_logfd(void)
> +static int obtain_logfd(void)

Why not get_logfd? Get and set make a nice pair.

>  {
>        logfd = recv_fd(tsock);
>        return logfd;
> @@ -440,7 +440,7 @@ static int __used parasite_service(unsigned long cmd,
void *args)
>        case PARASITE_CMD_FINI:
>                return fini();
>        case PARASITE_CMD_SET_LOGFD:
> -               return set_logfd();
> +               return obtain_logfd();
>        case PARASITE_CMD_DUMPPAGES_INIT:
>                return dump_pages_init((parasite_status_t *) args);
>        case PARASITE_CMD_DUMPPAGES_FINI:
> diff --git a/restorer-log.c b/restorer-log.c
> index 858e360..634513e 100644
> --- a/restorer-log.c
> +++ b/restorer-log.c
> @@ -3,7 +3,7 @@
>
>  static int logfd;
>
> -void set_logfd(int fd)
> +void restorer_set_logfd(int fd)
>  {
>        logfd = fd;
>  }
> diff --git a/restorer.c b/restorer.c
> index 552f741..ecffd7e 100644
> --- a/restorer.c
> +++ b/restorer.c
> @@ -352,7 +352,7 @@ long restore_task(struct task_restore_core_args *args)
>        act.rt_sa_handler = sigchld_handler;
>        sys_sigaction(SIGCHLD, &act, NULL);
>
> -       set_logfd(args->logfd);
> +       restorer_set_logfd(args->logfd);
>
>        core_entry      = first_on_heap(core_entry, args->mem_zone.heap);
>        vma_entry       = next_on_heap(vma_entry, core_entry);
> --
> 1.7.7.6
>
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://openvz.org/mailman/listinfo/criu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openvz.org/pipermail/criu/attachments/20120229/6c9286fe/attachment.html


More information about the CRIU mailing list