[CRIU] [PATCH 3/7] crtools: add a callback to show signal=*.img

Pavel Emelyanov xemul at parallels.com
Tue Dec 4 06:07:40 EST 2012


On 12/04/2012 01:50 PM, Andrey Vagin wrote:
> A size of siginfo is fixed, so siginfo-s can be saved as is.
> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  cr-show.c         | 19 +++++++++++++++++++
>  include/crtools.h |  1 +
>  2 files changed, 20 insertions(+)
> 
> diff --git a/cr-show.c b/cr-show.c
> index 8e88584..c991880 100644
> --- a/cr-show.c
> +++ b/cr-show.c
> @@ -224,6 +224,25 @@ out:
>  	pr_img_tail(CR_FD_PAGES);
>  }
>  
> +void show_siginfo(int fd, struct cr_options *o)
> +{
> +	siginfo_t info;
> +	int ret;
> +
> +	while (1) {
> +		ret = read_img_eof(fd, &info);
> +		if (ret == 0)
> +			break;
> +		if (ret < 0) {
> +			pr_perror("Unable to read siginfo");
> +			break;
> +		}
> +
> +		pr_msg("signal: si_signo=%d si_code=%x\n",
> +				info.si_signo, info.si_code);

No raw images please. Introduce the PB entry for them.

> +	}
> +}
> +
>  void show_sigacts(int fd_sigacts, struct cr_options *o)
>  {
>  	pb_show_plain(fd_sigacts, PB_SIGACT);
> diff --git a/include/crtools.h b/include/crtools.h
> index baa558b..7d85668 100644
> --- a/include/crtools.h
> +++ b/include/crtools.h
> @@ -148,6 +148,7 @@ void show_fifo(int fd, struct cr_options *o);
>  void show_fifo_data(int fd_pipes, struct cr_options *o);
>  void show_pstree(int fd_pstree, struct cr_options *o);
>  void show_sigacts(int fd_sigacts, struct cr_options *o);
> +void show_siginfo(int fd, struct cr_options *o);
>  void show_itimers(int fd, struct cr_options *o);
>  void show_creds(int fd, struct cr_options *o);
>  void show_fs(int fd, struct cr_options *o);
> 




More information about the CRIU mailing list