mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
Spring whitespace cleanup
Replace 8-spaces with a tab in code. Signed-off-by: Kir Kolyshkin <kir@openvz.org> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
f4e7b6e78f
commit
ba78d15557
8 changed files with 100 additions and 100 deletions
|
|
@ -38,8 +38,8 @@ int cpu_dump_cpuinfo(void)
|
|||
int ret = -1;
|
||||
|
||||
img = open_image(CR_FD_CPUINFO, O_DUMP);
|
||||
if (!img)
|
||||
return -1;
|
||||
if (!img)
|
||||
return -1;
|
||||
|
||||
cpu_info.ppc64_entry = &cpu_ppc64_info_ptr;
|
||||
cpu_info.n_ppc64_entry = 1;
|
||||
|
|
@ -51,7 +51,7 @@ int cpu_dump_cpuinfo(void)
|
|||
ret = pb_write_one(img, &cpu_info, PB_CPUINFO);
|
||||
|
||||
close_image(img);
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int cpu_validate_cpuinfo(void)
|
||||
|
|
@ -60,12 +60,12 @@ int cpu_validate_cpuinfo(void)
|
|||
CpuinfoPpc64Entry *cpu_ppc64_entry;
|
||||
struct cr_img *img;
|
||||
int ret = -1;
|
||||
img = open_image(CR_FD_CPUINFO, O_RSTR);
|
||||
if (!img)
|
||||
return -1;
|
||||
img = open_image(CR_FD_CPUINFO, O_RSTR);
|
||||
if (!img)
|
||||
return -1;
|
||||
|
||||
if (pb_read_one(img, &cpu_info, PB_CPUINFO) < 0)
|
||||
goto error;
|
||||
if (pb_read_one(img, &cpu_info, PB_CPUINFO) < 0)
|
||||
goto error;
|
||||
|
||||
if (cpu_info->n_ppc64_entry != 1) {
|
||||
pr_err("No PPC64 related entry in image\n");
|
||||
|
|
@ -121,22 +121,22 @@ error:
|
|||
|
||||
int cpuinfo_dump(void)
|
||||
{
|
||||
if (cpu_init())
|
||||
return -1;
|
||||
if (cpu_init())
|
||||
return -1;
|
||||
|
||||
if (cpu_dump_cpuinfo())
|
||||
return -1;
|
||||
if (cpu_dump_cpuinfo())
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cpuinfo_check(void)
|
||||
{
|
||||
if (cpu_init())
|
||||
return -1;
|
||||
if (cpu_init())
|
||||
return -1;
|
||||
|
||||
if (cpu_validate_cpuinfo())
|
||||
return 1;
|
||||
if (cpu_validate_cpuinfo())
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ static void xfree_tm_state(UserPpc64TmRegsEntry *tme)
|
|||
xfree(tme->vsxstate->vsxregs);
|
||||
xfree(tme->vsxstate);
|
||||
}
|
||||
if (tme->gpregs) {
|
||||
if (tme->gpregs) {
|
||||
if (tme->gpregs->gpr)
|
||||
xfree(tme->gpregs->gpr);
|
||||
xfree(tme->gpregs);
|
||||
|
|
@ -286,25 +286,25 @@ static int copy_tm_regs(user_regs_struct_t *regs, user_fpregs_struct_t *fpregs,
|
|||
CoreEntry *core)
|
||||
{
|
||||
UserPpc64TmRegsEntry *tme;
|
||||
UserPpc64RegsEntry *gpregs = core->ti_ppc64->gpregs;
|
||||
UserPpc64RegsEntry *gpregs = core->ti_ppc64->gpregs;
|
||||
|
||||
pr_debug("Copying TM registers\n");
|
||||
tme = xmalloc(sizeof(*tme));
|
||||
if (!tme)
|
||||
return -1;
|
||||
tme = xmalloc(sizeof(*tme));
|
||||
if (!tme)
|
||||
return -1;
|
||||
|
||||
user_ppc64_tm_regs_entry__init(tme);
|
||||
|
||||
tme->gpregs = allocate_gp_regs();
|
||||
if (!tme->gpregs)
|
||||
goto out_free;
|
||||
tme->gpregs = allocate_gp_regs();
|
||||
if (!tme->gpregs)
|
||||
goto out_free;
|
||||
|
||||
gpregs->has_tfhar = true;
|
||||
gpregs->tfhar = fpregs->tm.tm_spr_regs.tfhar;
|
||||
gpregs->has_texasr = true;
|
||||
gpregs->texasr = fpregs->tm.tm_spr_regs.texasr;
|
||||
gpregs->has_tfiar = true;
|
||||
gpregs->tfiar = fpregs->tm.tm_spr_regs.tfiar;
|
||||
gpregs->has_tfhar = true;
|
||||
gpregs->tfhar = fpregs->tm.tm_spr_regs.tfhar;
|
||||
gpregs->has_texasr = true;
|
||||
gpregs->texasr = fpregs->tm.tm_spr_regs.texasr;
|
||||
gpregs->has_tfiar = true;
|
||||
gpregs->tfiar = fpregs->tm.tm_spr_regs.tfiar;
|
||||
|
||||
|
||||
/* This is the checkpointed state, we must save it in place of the
|
||||
|
|
@ -315,32 +315,32 @@ static int copy_tm_regs(user_regs_struct_t *regs, user_fpregs_struct_t *fpregs,
|
|||
copy_gp_regs(gpregs, &fpregs->tm.regs);
|
||||
|
||||
if (fpregs->tm.flags & USER_FPREGS_FL_FP) {
|
||||
core->ti_ppc64->fpstate = copy_fp_regs(fpregs->tm.fpregs);
|
||||
if (!core->ti_ppc64->fpstate)
|
||||
goto out_free;
|
||||
}
|
||||
core->ti_ppc64->fpstate = copy_fp_regs(fpregs->tm.fpregs);
|
||||
if (!core->ti_ppc64->fpstate)
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
if (fpregs->tm.flags & USER_FPREGS_FL_ALTIVEC) {
|
||||
core->ti_ppc64->vrstate = copy_altivec_regs(fpregs->tm.vrregs);
|
||||
if (!core->ti_ppc64->vrstate)
|
||||
goto out_free;
|
||||
core->ti_ppc64->vrstate = copy_altivec_regs(fpregs->tm.vrregs);
|
||||
if (!core->ti_ppc64->vrstate)
|
||||
goto out_free;
|
||||
|
||||
/*
|
||||
* Force the MSR_VEC bit of the restored MSR otherwise the
|
||||
* kernel will not restore them from the signal frame.
|
||||
*/
|
||||
gpregs->msr |= MSR_VEC;
|
||||
/*
|
||||
* Force the MSR_VEC bit of the restored MSR otherwise the
|
||||
* kernel will not restore them from the signal frame.
|
||||
*/
|
||||
gpregs->msr |= MSR_VEC;
|
||||
|
||||
if (fpregs->tm.flags & USER_FPREGS_FL_VSX) {
|
||||
core->ti_ppc64->vsxstate = copy_vsx_regs(fpregs->tm.vsxregs);
|
||||
if (!core->ti_ppc64->vsxstate)
|
||||
goto out_free;
|
||||
/*
|
||||
* Force the MSR_VSX bit of the restored MSR otherwise
|
||||
* the kernel will not restore them from the signal
|
||||
* frame.
|
||||
*/
|
||||
gpregs->msr |= MSR_VSX;
|
||||
* Force the MSR_VSX bit of the restored MSR otherwise
|
||||
* the kernel will not restore them from the signal
|
||||
* frame.
|
||||
*/
|
||||
gpregs->msr |= MSR_VSX;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -380,7 +380,7 @@ static int __copy_task_regs(user_regs_struct_t *regs,
|
|||
fpstate = &(core->ti_ppc64->fpstate);
|
||||
vrstate = &(core->ti_ppc64->vrstate);
|
||||
vsxstate = &(core->ti_ppc64->vsxstate);
|
||||
}
|
||||
}
|
||||
|
||||
copy_gp_regs(gpregs, regs);
|
||||
if (fpregs->flags & USER_FPREGS_FL_FP) {
|
||||
|
|
@ -392,22 +392,22 @@ static int __copy_task_regs(user_regs_struct_t *regs,
|
|||
*vrstate = copy_altivec_regs(fpregs->vrregs);
|
||||
if (!*vrstate)
|
||||
return -1;
|
||||
/*
|
||||
* Force the MSR_VEC bit of the restored MSR otherwise the
|
||||
* kernel will not restore them from the signal frame.
|
||||
*/
|
||||
gpregs->msr |= MSR_VEC;
|
||||
/*
|
||||
* Force the MSR_VEC bit of the restored MSR otherwise the
|
||||
* kernel will not restore them from the signal frame.
|
||||
*/
|
||||
gpregs->msr |= MSR_VEC;
|
||||
|
||||
if (fpregs->flags & USER_FPREGS_FL_VSX) {
|
||||
*vsxstate = copy_vsx_regs(fpregs->vsxregs);
|
||||
if (!*vsxstate)
|
||||
return -1;
|
||||
/*
|
||||
* Force the MSR_VSX bit of the restored MSR otherwise
|
||||
* the kernel will not restore them from the signal
|
||||
* frame.
|
||||
*/
|
||||
gpregs->msr |= MSR_VSX;
|
||||
/*
|
||||
* Force the MSR_VSX bit of the restored MSR otherwise
|
||||
* the kernel will not restore them from the signal
|
||||
* frame.
|
||||
*/
|
||||
gpregs->msr |= MSR_VSX;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -441,7 +441,7 @@ int arch_alloc_thread_info(CoreEntry *core)
|
|||
|
||||
void arch_free_thread_info(CoreEntry *core)
|
||||
{
|
||||
if (CORE_THREAD_ARCH_INFO(core)) {
|
||||
if (CORE_THREAD_ARCH_INFO(core)) {
|
||||
if (CORE_THREAD_ARCH_INFO(core)->fpstate) {
|
||||
xfree(CORE_THREAD_ARCH_INFO(core)->fpstate->fpregs);
|
||||
xfree(CORE_THREAD_ARCH_INFO(core)->fpstate);
|
||||
|
|
@ -455,11 +455,11 @@ void arch_free_thread_info(CoreEntry *core)
|
|||
xfree(CORE_THREAD_ARCH_INFO(core)->vsxstate);
|
||||
}
|
||||
xfree_tm_state(CORE_THREAD_ARCH_INFO(core)->tmstate);
|
||||
xfree(CORE_THREAD_ARCH_INFO(core)->gpregs->gpr);
|
||||
xfree(CORE_THREAD_ARCH_INFO(core)->gpregs);
|
||||
xfree(CORE_THREAD_ARCH_INFO(core));
|
||||
CORE_THREAD_ARCH_INFO(core) = NULL;
|
||||
}
|
||||
xfree(CORE_THREAD_ARCH_INFO(core)->gpregs->gpr);
|
||||
xfree(CORE_THREAD_ARCH_INFO(core)->gpregs);
|
||||
xfree(CORE_THREAD_ARCH_INFO(core));
|
||||
CORE_THREAD_ARCH_INFO(core) = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int restore_fpu(struct rt_sigframe *sigframe, CoreEntry *core)
|
||||
|
|
|
|||
|
|
@ -73,8 +73,8 @@ void restore_tls(tls_t *ptls)
|
|||
|
||||
memcpy(stack32, desc, sizeof(user_desc_t));
|
||||
asm volatile (
|
||||
" mov %1,%%eax \n"
|
||||
" mov %2,%%ebx \n"
|
||||
" mov %1,%%eax \n"
|
||||
" mov %2,%%ebx \n"
|
||||
" int $0x80 \n"
|
||||
" mov %%eax,%0 \n"
|
||||
: "=g"(ret)
|
||||
|
|
|
|||
22
criu/mem.c
22
criu/mem.c
|
|
@ -57,19 +57,19 @@ int do_task_reset_dirty_track(int pid)
|
|||
|
||||
ret = write(fd, cmd, sizeof(cmd));
|
||||
if (ret < 0) {
|
||||
if (errno == EINVAL) /* No clear-soft-dirty in kernel */
|
||||
ret = 1;
|
||||
else {
|
||||
pr_perror("Can't reset %d's dirty memory tracker (%d)", pid, errno);
|
||||
ret = -1;
|
||||
}
|
||||
} else {
|
||||
pr_info(" ... done\n");
|
||||
ret = 0;
|
||||
if (errno == EINVAL) /* No clear-soft-dirty in kernel */
|
||||
ret = 1;
|
||||
else {
|
||||
pr_perror("Can't reset %d's dirty memory tracker (%d)", pid, errno);
|
||||
ret = -1;
|
||||
}
|
||||
} else {
|
||||
pr_info(" ... done\n");
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
close(fd);
|
||||
return ret;
|
||||
close(fd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned long dump_pages_args_size(struct vm_area_list *vmas)
|
||||
|
|
|
|||
|
|
@ -586,7 +586,7 @@ err:
|
|||
return ret;
|
||||
}
|
||||
|
||||
#define RESERVED_PIDS 300
|
||||
#define RESERVED_PIDS 300
|
||||
static int get_free_pid()
|
||||
{
|
||||
static struct pid *prev, *next;
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@
|
|||
|
||||
struct netlink_sk_desc {
|
||||
struct socket_desc sd;
|
||||
u32 portid;
|
||||
u32 portid;
|
||||
u32 *groups;
|
||||
u32 gsize;
|
||||
u32 dst_portid;
|
||||
u32 dst_portid;
|
||||
u32 dst_group;
|
||||
u8 state;
|
||||
u8 protocol;
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ struct packet_sock_info {
|
|||
};
|
||||
|
||||
struct packet_mreq_max {
|
||||
int mr_ifindex;
|
||||
unsigned short mr_type;
|
||||
unsigned short mr_alen;
|
||||
unsigned char mr_address[MAX_ADDR_LEN];
|
||||
int mr_ifindex;
|
||||
unsigned short mr_type;
|
||||
unsigned short mr_alen;
|
||||
unsigned char mr_address[MAX_ADDR_LEN];
|
||||
};
|
||||
|
||||
struct packet_sock_desc {
|
||||
|
|
|
|||
|
|
@ -16,17 +16,17 @@
|
|||
#endif
|
||||
|
||||
enum {
|
||||
TCPF_ESTABLISHED = (1 << 1),
|
||||
TCPF_SYN_SENT = (1 << 2),
|
||||
TCPF_SYN_RECV = (1 << 3),
|
||||
TCPF_FIN_WAIT1 = (1 << 4),
|
||||
TCPF_FIN_WAIT2 = (1 << 5),
|
||||
TCPF_TIME_WAIT = (1 << 6),
|
||||
TCPF_CLOSE = (1 << 7),
|
||||
TCPF_CLOSE_WAIT = (1 << 8),
|
||||
TCPF_LAST_ACK = (1 << 9),
|
||||
TCPF_LISTEN = (1 << 10),
|
||||
TCPF_CLOSING = (1 << 11),
|
||||
TCPF_ESTABLISHED = (1 << 1),
|
||||
TCPF_SYN_SENT = (1 << 2),
|
||||
TCPF_SYN_RECV = (1 << 3),
|
||||
TCPF_FIN_WAIT1 = (1 << 4),
|
||||
TCPF_FIN_WAIT2 = (1 << 5),
|
||||
TCPF_TIME_WAIT = (1 << 6),
|
||||
TCPF_CLOSE = (1 << 7),
|
||||
TCPF_CLOSE_WAIT = (1 << 8),
|
||||
TCPF_LAST_ACK = (1 << 9),
|
||||
TCPF_LISTEN = (1 << 10),
|
||||
TCPF_CLOSING = (1 << 11),
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -561,9 +561,9 @@ static int send_fin(struct libsoccr_sk *sk, struct libsoccr_sk_data *data,
|
|||
libnet_type = LIBNET_RAW4;
|
||||
|
||||
l = libnet_init(
|
||||
libnet_type, /* injection type */
|
||||
NULL, /* network interface */
|
||||
errbuf); /* errbuf */
|
||||
libnet_type, /* injection type */
|
||||
NULL, /* network interface */
|
||||
errbuf); /* errbuf */
|
||||
if (l == NULL)
|
||||
return -1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue