2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

image: Move image descriptors to own files

Move image object descriptors to own image-desc
file(s). This allow to reuse the code in other tools.
I had to move show declarations to cr-show.h as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Cyrill Gorcunov
2013-05-28 22:12:06 +04:00
committed by Pavel Emelyanov
parent 225716278a
commit 17b0a47b98
7 changed files with 234 additions and 193 deletions

View File

@@ -9,91 +9,12 @@
#include "util.h"
#include "image.h"
#include "lock.h"
#include "cr-show.h"
#include "protobuf/vma.pb-c.h"
#define CR_FD_PERM (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH)
enum {
CR_FD_INVENTORY,
CR_FD_STATS,
/*
* Task entries
*/
_CR_FD_TASK_FROM,
CR_FD_FILE_LOCKS,
CR_FD_CORE,
CR_FD_IDS,
CR_FD_MM,
CR_FD_VMAS,
CR_FD_SIGACT,
CR_FD_ITIMERS,
CR_FD_CREDS,
CR_FD_FS,
CR_FD_RLIMIT,
CR_FD_SIGNAL,
_CR_FD_TASK_TO,
CR_FD_PAGEMAP,
/*
* NS entries
*/
_CR_FD_NS_FROM,
CR_FD_UTSNS,
CR_FD_IPCNS_VAR,
CR_FD_IPCNS_SHM,
CR_FD_IPCNS_MSG,
CR_FD_IPCNS_SEM,
CR_FD_MOUNTPOINTS,
CR_FD_NETDEV,
CR_FD_IFADDR,
CR_FD_ROUTE,
_CR_FD_NS_TO,
CR_FD_PSTREE,
CR_FD_SHMEM_PAGEMAP,
CR_FD_GHOST_FILE,
CR_FD_TCP_STREAM,
CR_FD_FDINFO,
_CR_FD_GLOB_FROM,
CR_FD_SK_QUEUES,
CR_FD_REG_FILES,
CR_FD_NS_FILES,
CR_FD_INETSK,
CR_FD_UNIXSK,
CR_FD_PACKETSK,
CR_FD_NETLINKSK,
CR_FD_PIPES,
CR_FD_PIPES_DATA,
CR_FD_FIFO,
CR_FD_FIFO_DATA,
CR_FD_TTY,
CR_FD_TTY_INFO,
CR_FD_REMAP_FPATH,
CR_FD_EVENTFD,
CR_FD_EVENTPOLL,
CR_FD_EVENTPOLL_TFD,
CR_FD_SIGNALFD,
CR_FD_INOTIFY,
CR_FD_INOTIFY_WD,
CR_FD_FANOTIFY,
CR_FD_FANOTIFY_MARK,
_CR_FD_GLOB_TO,
CR_FD_TMPFS,
CR_FD_PAGES,
CR_FD_PSIGNAL,
CR_FD_PAGES_OLD,
CR_FD_SHM_PAGES_OLD,
CR_FD_MAX
};
struct script {
struct list_head node;
char *path;
@@ -152,40 +73,6 @@ extern int close_service_fd(enum sfd_type type);
extern bool is_service_fd(int fd, enum sfd_type type);
extern bool is_any_service_fd(int fd);
/* file descriptors template */
struct cr_fd_desc_tmpl {
const char *fmt; /* format for the name */
u32 magic; /* magic in the header */
void (*show)(int fd);
};
void show_files(int fd);
void show_pagemap(int fd);
void show_reg_files(int fd);
void show_ns_files(int fd);
void show_core(int fd);
void show_ids(int fd);
void show_mm(int fd);
void show_vmas(int fd);
void show_pipes(int fd);
void show_pipes_data(int fd);
void show_fifo(int fd);
void show_fifo_data(int fd);
void show_pstree(int fd);
void show_sigacts(int fd);
void show_siginfo(int fd);
void show_itimers(int fd);
void show_creds(int fd);
void show_fs(int fd);
void show_remap_files(int fd);
void show_ghost_file(int fd);
void show_fown_cont(void *p);
void show_eventfds(int fd);
void show_tty(int fd);
void show_tty_info(int fd);
void show_file_locks(int fd);
void show_rlimit(int fd);
int check_img_inventory(void);
int write_img_inventory(void);
void kill_inventory(void);