[CRIU] [PATCH 4/6] collect: Add img argument to cinfo
Pavel Emelyanov
xemul at virtuozzo.com
Thu Mar 24 06:01:29 PDT 2016
The plan is to allow ->collect callbacks to read more
stuff from image files.
Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
criu/eventfd.c | 2 +-
criu/eventpoll.c | 4 ++--
criu/fifo.c | 2 +-
criu/file-lock.c | 2 +-
criu/files-ext.c | 2 +-
criu/files-reg.c | 4 ++--
criu/fsnotify.c | 8 ++++----
criu/include/protobuf.h | 2 +-
criu/namespaces.c | 2 +-
criu/pipes.c | 2 +-
criu/protobuf.c | 2 +-
criu/signalfd.c | 2 +-
criu/sk-inet.c | 2 +-
criu/sk-netlink.c | 2 +-
criu/sk-packet.c | 2 +-
criu/sk-unix.c | 2 +-
criu/timerfd.c | 2 +-
criu/tty.c | 4 ++--
criu/tun.c | 2 +-
19 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/criu/eventfd.c b/criu/eventfd.c
index f4baabc..887c2db 100644
--- a/criu/eventfd.c
+++ b/criu/eventfd.c
@@ -112,7 +112,7 @@ static struct file_desc_ops eventfd_desc_ops = {
.open = eventfd_open,
};
-static int collect_one_efd(void *obj, ProtobufCMessage *msg)
+static int collect_one_efd(void *obj, ProtobufCMessage *msg, struct cr_img *i)
{
struct eventfd_file_info *info = obj;
diff --git a/criu/eventpoll.c b/criu/eventpoll.c
index 9fa13c2..38afeef 100644
--- a/criu/eventpoll.c
+++ b/criu/eventpoll.c
@@ -194,7 +194,7 @@ static struct file_desc_ops desc_ops = {
.collect_fd = eventpoll_collect_fd,
};
-static int collect_one_epoll_tfd(void *o, ProtobufCMessage *msg)
+static int collect_one_epoll_tfd(void *o, ProtobufCMessage *msg, struct cr_img *i)
{
struct eventpoll_tfd_file_info *info = o;
@@ -212,7 +212,7 @@ struct collect_image_info epoll_tfd_cinfo = {
.collect = collect_one_epoll_tfd,
};
-static int collect_one_epoll(void *o, ProtobufCMessage *msg)
+static int collect_one_epoll(void *o, ProtobufCMessage *msg, struct cr_img *i)
{
struct eventpoll_file_info *info = o;
diff --git a/criu/fifo.c b/criu/fifo.c
index 7d65efc..9da5a27 100644
--- a/criu/fifo.c
+++ b/criu/fifo.c
@@ -130,7 +130,7 @@ static struct file_desc_ops fifo_desc_ops = {
.collect_fd = collect_fifo_fd,
};
-static int collect_one_fifo(void *o, ProtobufCMessage *base)
+static int collect_one_fifo(void *o, ProtobufCMessage *base, struct cr_img *i)
{
struct fifo_info *info = o, *f;
diff --git a/criu/file-lock.c b/criu/file-lock.c
index 8e4e481..eb1feab 100644
--- a/criu/file-lock.c
+++ b/criu/file-lock.c
@@ -26,7 +26,7 @@ struct file_lock_rst {
struct list_head file_lock_list = LIST_HEAD_INIT(file_lock_list);
-static int collect_one_file_lock(void *o, ProtobufCMessage *m)
+static int collect_one_file_lock(void *o, ProtobufCMessage *m, struct cr_img *i)
{
struct file_lock_rst *lr = o;
diff --git a/criu/files-ext.c b/criu/files-ext.c
index 4c22452..4c129fa 100644
--- a/criu/files-ext.c
+++ b/criu/files-ext.c
@@ -61,7 +61,7 @@ static struct file_desc_ops ext_desc_ops = {
.open = open_fd,
};
-static int collect_one_ext(void *o, ProtobufCMessage *base)
+static int collect_one_ext(void *o, ProtobufCMessage *base, struct cr_img *i)
{
struct ext_file_info *xfi = o;
diff --git a/criu/files-reg.c b/criu/files-reg.c
index 879883d..c6c7235 100644
--- a/criu/files-reg.c
+++ b/criu/files-reg.c
@@ -388,7 +388,7 @@ struct remap_info {
struct reg_file_info *rfi;
};
-static int collect_one_remap(void *obj, ProtobufCMessage *msg)
+static int collect_one_remap(void *obj, ProtobufCMessage *msg, struct cr_img *i)
{
struct remap_info *ri = obj;
RemapFilePathEntry *rfe;
@@ -1656,7 +1656,7 @@ struct file_desc *try_collect_special_file(u32 id, int optional)
return fdesc;
}
-static int collect_one_regfile(void *o, ProtobufCMessage *base)
+static int collect_one_regfile(void *o, ProtobufCMessage *base, struct cr_img *i)
{
struct reg_file_info *rfi = o;
static char dot[] = ".";
diff --git a/criu/fsnotify.c b/criu/fsnotify.c
index db7f0e6..4a9b2dc 100644
--- a/criu/fsnotify.c
+++ b/criu/fsnotify.c
@@ -828,7 +828,7 @@ static int collect_fanotify_mark(struct fsnotify_mark_info *mark)
return -1;
}
-static int collect_one_inotify(void *o, ProtobufCMessage *msg)
+static int collect_one_inotify(void *o, ProtobufCMessage *msg, struct cr_img *img)
{
struct fsnotify_file_info *info = o;
int i;
@@ -863,7 +863,7 @@ struct collect_image_info inotify_cinfo = {
.collect = collect_one_inotify,
};
-static int collect_one_fanotify(void *o, ProtobufCMessage *msg)
+static int collect_one_fanotify(void *o, ProtobufCMessage *msg, struct cr_img *img)
{
struct fsnotify_file_info *info = o;
int i;
@@ -898,7 +898,7 @@ struct collect_image_info fanotify_cinfo = {
.collect = collect_one_fanotify,
};
-static int collect_one_inotify_mark(void *o, ProtobufCMessage *msg)
+static int collect_one_inotify_mark(void *o, ProtobufCMessage *msg, struct cr_img *i)
{
struct fsnotify_mark_info *mark = o;
@@ -926,7 +926,7 @@ struct collect_image_info inotify_mark_cinfo = {
.collect = collect_one_inotify_mark,
};
-static int collect_one_fanotify_mark(void *o, ProtobufCMessage *msg)
+static int collect_one_fanotify_mark(void *o, ProtobufCMessage *msg, struct cr_img *i)
{
struct fsnotify_mark_info *mark = o;
diff --git a/criu/include/protobuf.h b/criu/include/protobuf.h
index 1b22767..821fb02 100644
--- a/criu/include/protobuf.h
+++ b/criu/include/protobuf.h
@@ -31,7 +31,7 @@ struct collect_image_info {
int fd_type;
int pb_type;
unsigned int priv_size;
- int (*collect)(void *, ProtobufCMessage *);
+ int (*collect)(void *, ProtobufCMessage *, struct cr_img *);
unsigned flags;
};
diff --git a/criu/namespaces.c b/criu/namespaces.c
index 724203e..5a7ce30 100644
--- a/criu/namespaces.c
+++ b/criu/namespaces.c
@@ -412,7 +412,7 @@ static struct file_desc_ops ns_desc_ops = {
.open = open_ns_fd,
};
-static int collect_one_nsfile(void *o, ProtobufCMessage *base)
+static int collect_one_nsfile(void *o, ProtobufCMessage *base, struct cr_img *img)
{
struct ns_file_info *nfi = o;
diff --git a/criu/pipes.c b/criu/pipes.c
index ad738ef..d5a760d 100644
--- a/criu/pipes.c
+++ b/criu/pipes.c
@@ -406,7 +406,7 @@ int collect_one_pipe_ops(void *o, ProtobufCMessage *base, struct file_desc_ops *
return 0;
}
-static int collect_one_pipe(void *o, ProtobufCMessage *base)
+static int collect_one_pipe(void *o, ProtobufCMessage *base, struct cr_img *i)
{
return collect_one_pipe_ops(o, base, &pipe_desc_ops);
}
diff --git a/criu/protobuf.c b/criu/protobuf.c
index 3201ad4..ca2f198 100644
--- a/criu/protobuf.c
+++ b/criu/protobuf.c
@@ -210,7 +210,7 @@ int collect_image(struct collect_image_info *cinfo)
break;
}
- ret = cinfo->collect(obj, msg);
+ ret = cinfo->collect(obj, msg, img);
if (ret < 0) {
o_free(obj);
cr_pb_descs[cinfo->pb_type].free(msg, NULL);
diff --git a/criu/signalfd.c b/criu/signalfd.c
index 4ffc195..064ebda 100644
--- a/criu/signalfd.c
+++ b/criu/signalfd.c
@@ -107,7 +107,7 @@ static struct file_desc_ops signalfd_desc_ops = {
.open = signalfd_open,
};
-static int collect_one_sigfd(void *o, ProtobufCMessage *msg)
+static int collect_one_sigfd(void *o, ProtobufCMessage *msg, struct cr_img *i)
{
struct signalfd_info *info = o;
diff --git a/criu/sk-inet.c b/criu/sk-inet.c
index 63bd058..460e237 100644
--- a/criu/sk-inet.c
+++ b/criu/sk-inet.c
@@ -449,7 +449,7 @@ static inline int tcp_connection(InetSkEntry *ie)
return (ie->proto == IPPROTO_TCP) && (ie->state == TCP_ESTABLISHED);
}
-static int collect_one_inetsk(void *o, ProtobufCMessage *base)
+static int collect_one_inetsk(void *o, ProtobufCMessage *base, struct cr_img *i)
{
struct inet_sk_info *ii = o;
diff --git a/criu/sk-netlink.c b/criu/sk-netlink.c
index f839faf..dc5c4a1 100644
--- a/criu/sk-netlink.c
+++ b/criu/sk-netlink.c
@@ -217,7 +217,7 @@ static struct file_desc_ops netlink_sock_desc_ops = {
.open = open_netlink_sk,
};
-static int collect_one_netlink_sk(void *o, ProtobufCMessage *base)
+static int collect_one_netlink_sk(void *o, ProtobufCMessage *base, struct cr_img *i)
{
struct netlink_sock_info *si = o;
diff --git a/criu/sk-packet.c b/criu/sk-packet.c
index 9d324a9..73d9c7b 100644
--- a/criu/sk-packet.c
+++ b/criu/sk-packet.c
@@ -489,7 +489,7 @@ static struct file_desc_ops packet_sock_desc_ops = {
.open = open_packet_sk,
};
-static int collect_one_packet_sk(void *o, ProtobufCMessage *base)
+static int collect_one_packet_sk(void *o, ProtobufCMessage *base, struct cr_img *i)
{
struct packet_sock_info *si = o;
diff --git a/criu/sk-unix.c b/criu/sk-unix.c
index 9279337..24510ca 100644
--- a/criu/sk-unix.c
+++ b/criu/sk-unix.c
@@ -1284,7 +1284,7 @@ static void unlink_stale(struct unix_sk_info *ui)
static int resolve_unix_peers(void *unused);
-static int collect_one_unixsk(void *o, ProtobufCMessage *base)
+static int collect_one_unixsk(void *o, ProtobufCMessage *base, struct cr_img *i)
{
struct unix_sk_info *ui = o;
static bool post_queued = false;
diff --git a/criu/timerfd.c b/criu/timerfd.c
index 942e5e6..c291516 100644
--- a/criu/timerfd.c
+++ b/criu/timerfd.c
@@ -188,7 +188,7 @@ static int verify_timerfd(TimerfdEntry *tfe)
return 0;
}
-static int collect_one_timerfd(void *o, ProtobufCMessage *msg)
+static int collect_one_timerfd(void *o, ProtobufCMessage *msg, struct cr_img *i)
{
struct timerfd_info *info = o;
diff --git a/criu/tty.c b/criu/tty.c
index fd02227..68d7ba3 100644
--- a/criu/tty.c
+++ b/criu/tty.c
@@ -1352,7 +1352,7 @@ static TtyInfoEntry *lookup_tty_info_entry(u32 id)
return NULL;
}
-static int collect_one_tty_info_entry(void *obj, ProtobufCMessage *msg)
+static int collect_one_tty_info_entry(void *obj, ProtobufCMessage *msg, struct cr_img *i)
{
struct tty_info_entry *info = obj;
@@ -1395,7 +1395,7 @@ struct collect_image_info tty_info_cinfo = {
.collect = collect_one_tty_info_entry,
};
-static int collect_one_tty(void *obj, ProtobufCMessage *msg)
+static int collect_one_tty(void *obj, ProtobufCMessage *msg, struct cr_img *i)
{
struct tty_info *info = obj;
diff --git a/criu/tun.c b/criu/tun.c
index cd625b2..dec730d 100644
--- a/criu/tun.c
+++ b/criu/tun.c
@@ -378,7 +378,7 @@ static struct file_desc_ops tunfile_desc_ops = {
.open = tunfile_open,
};
-static int collect_one_tunfile(void *o, ProtobufCMessage *base)
+static int collect_one_tunfile(void *o, ProtobufCMessage *base, struct cr_img *i)
{
struct tunfile_info *ti = o;
--
2.5.0
More information about the CRIU
mailing list