[lxc-devel] [PATCH 3/9] lxc_start: ERROR if container is already running.

Dongsheng Yang yangds.fnst at cn.fujitsu.com
Wed Sep 17 03:41:16 UTC 2014


On 09/17/2014 11:36 AM, Serge Hallyn wrote:
> Quoting Dongsheng Yang (yangds.fnst at cn.fujitsu.com):
>> We should exit with a error when starting a running container.
>>
>> Signed-off-by: Dongsheng Yang <yangds.fnst at cn.fujitsu.com>
> Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

Thanx for your ACK Hallyn. But for not wasting your time, please go to
[PATCH 0/9 V1] Rewrite lxc-device. for reviewing. I have updated this 
patchset
according some sugguestion from Stgraber. :)
Thanx
Yang

>
>> ---
>>   src/lxc/lxc_start.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/src/lxc/lxc_start.c b/src/lxc/lxc_start.c
>> index e836325..9a05356 100644
>> --- a/src/lxc/lxc_start.c
>> +++ b/src/lxc/lxc_start.c
>> @@ -276,6 +276,10 @@ int main(int argc, char *argv[])
>>   		}
>>   	}
>>   
>> +	if (c->is_running(c)) {
>> +		ERROR("Container is already running.");
>> +		goto out;
>> +	}
>>   	/*
>>   	 * We should use set_config_item() over &defines, which would handle
>>   	 * unset c->lxc_conf for us and let us not use lxc_config_define_load()
>> -- 
>> 1.8.4.2
>>
> .
>



More information about the lxc-devel mailing list