[CRIU] [PATCH] env: Introduce logging of runtime environment

Pavel Emelyanov xemul at parallels.com
Fri Sep 19 08:21:04 PDT 2014


On 09/19/2014 07:11 PM, Cyrill Gorcunov wrote:
> On Fri, Sep 19, 2014 at 07:03:33PM +0400, Pavel Emelyanov wrote:
>> On 09/19/2014 06:59 PM, Cyrill Gorcunov wrote:
>>> On Fri, Sep 19, 2014 at 05:51:15PM +0400, Pavel Emelyanov wrote:
>>>> On 09/17/2014 11:22 AM, Cyrill Gorcunov wrote:
>>>>
>>>>> +void log_rt_env(unsigned int loglevel)
>>>>> +{
>>>>> +	if (pr_quelled(loglevel))
>>>>> +		return;
>>>>> +
>>>>> +	print_on_level(loglevel, "Run time environment info\n");
>>>>> +	print_on_level(loglevel, "  Command line: %s\n", rt_env.cmdline);
>>>>> +}
>>>>> +
>>>>> +int fill_rt_env(int argc, char *argv[])
>>>>
>>>> Why do we need pre-fill? The getopt_long rearranges options, but
>>>> doesn't eat them :)
>>>
>>> Well, I not sure if it's guaranteed that argv and argc will remain
>>> intact,
>>
>> It is. The getopt_long only reshuffles them.
> 
> How it's different then? I mean we need a real copy of then command line,
> and we fetch it early, what you propose instead?

I proposed to print argv array after parsing in whatever state
it will happen to be. Now I think that probably better idea is
to dump the cr_options struct -- you'd have to do it for RPC
anyway, so why not unifying?

Thanks,
Pavel



More information about the CRIU mailing list