It's a feature of PTRACE_SEIZE. So we need to do something, only
if we want to change the state.
[xemul: If task _was_ in stopped state before dump and we want them
to stay alive after dump, the existing code queues one more STOP
to it. This affects subsequent dump, as we seize a stopped task
with STOP in queue.
One more item in TODO list -- support stopped tasks with STOP in
queue :)
]
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Reminder: the '&<string>' arg turns out into an address in memory
containing <string>. The '@<size>' arg turns out into an address
to uninitilized memory of size <size>, which contents it printed
after syscall returns.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We have three arrays for thread related data: item->threads,
parasite_ctl->thread and tid_state in parasite.
With this patch a thread will have the same index in all arrays.
The zero index is used for a thread leader.
In this case we don't need to search thread_state in parasite.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Right now when we collect list of vmas we need to know the
number of elements in it. In the future I will need to know
more, so it makes sense to create a vmas-list object for it.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Syntax is
crtools exec -t <pid> <syscall_name> [<arguments>]
Two types of arguments are supported -- plain, treated
as number, passed as is to the syscall. Buffer, started
with '&' -- the rest of the string is pushed to the tgt
task's memory and pointer to one is passed as syscall
argument.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>