Commit 92eb5ff5 authored by Pavel Emelyanov's avatar Pavel Emelyanov

pipe: Run master resolve via post_cb engine

Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 3b288ca3
......@@ -268,8 +268,6 @@ static int root_prepare_shared(void)
if (ret < 0)
goto err;
mark_pipe_master();
ret = tty_setup_slavery();
if (ret)
goto err;
......
......@@ -6,7 +6,6 @@
extern struct collect_image_info pipe_cinfo;
extern int collect_pipes(void);
extern void mark_pipe_master(void);
extern const struct fdtype_ops pipe_dump_ops;
static inline u32 pipe_id(const struct fd_parms *p)
......
......@@ -5,6 +5,7 @@
#include <stdlib.h>
#include <sys/mman.h>
#include "crtools.h"
#include "imgset.h"
#include "image.h"
#include "files.h"
......@@ -93,7 +94,7 @@ int collect_pipe_data(int img_type, struct pipe_data_rst **hash)
}
/* Choose who will restore a pipe. */
void mark_pipe_master(void)
static int mark_pipe_master(void *unused)
{
LIST_HEAD(head);
......@@ -156,6 +157,7 @@ void mark_pipe_master(void)
}
list_splice(&head, &pipes);
return 0;
}
static struct pipe_data_rst *pd_hash_pipes[PIPE_DATA_HASH_SIZE];
......@@ -394,6 +396,10 @@ static int collect_one_pipe(void *o, ProtobufCMessage *base)
list_add(&pi->pipe_list, &tmp->pipe_list);
}
if (list_empty(&pipes))
if (add_post_prepare_cb(mark_pipe_master, NULL))
return -1;
list_add_tail(&pi->list, &pipes);
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment