Commit 5f9acc8d authored by Pavel Emelyanov's avatar Pavel Emelyanov

shmem: Explicitly initialize rst_shmems

This is a position in the RM_SHREMAP memory. Since shmems are currently
the only user of it, this is validly equals zero, but it will change soon.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent aa72de67
......@@ -174,6 +174,9 @@ static int root_prepare_shared(void)
if (prepare_shared_reg_files())
return -1;
if (prepare_shmem_restore())
return -1;
for (i = 0; i < ARRAY_SIZE(cinfos); i++) {
ret = collect_image(cinfos[i]);
if (ret)
......
......@@ -28,7 +28,7 @@ extern void show_saved_shmems(void);
extern int get_shmem_fd(int pid, VmaEntry *vi);
extern unsigned long nr_shmems;
extern unsigned int rst_shmems;
extern unsigned long rst_shmems;
extern int cr_dump_shmem(void);
extern int add_shmem_area(pid_t pid, VmaEntry *vma);
......
......@@ -16,7 +16,13 @@
#include "protobuf/pagemap.pb-c.h"
unsigned long nr_shmems;
unsigned int rst_shmems;
unsigned long rst_shmems;
int prepare_shmem_restore(void)
{
rst_shmems = rst_mem_cpos(RM_SHREMAP);
return 0;
}
void show_saved_shmems(void)
{
......
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