[libvirt] [PATCH]lxc: make sure root wouldn't be null
Gao feng
gaofeng at cn.fujitsu.com
Tue Nov 12 08:21:47 UTC 2013
On 11/12/2013 04:03 PM, Chen Hanxiao wrote:
> ping
>
see virLXCProcessEnsureRootFS, we already make sure the root is exist
for libvirt-lxc.
>> -----Original Message-----
>> From: Chen Hanxiao [mailto:chenhanxiao at cn.fujitsu.com]
>> Sent: Tuesday, November 05, 2013 5:57 PM
>> To: libvir-list at redhat.com
>> Cc: chenhanxiao at cn.fujitsu.com
>> Subject: [libvirt][PATCH]lxc: make sure root wouldn't be null
>>
>> From: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
>>
>> virDomainGetRootFilesystem may return null.
>> We should take care of it.
>>
>> Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
>> ---
>> src/lxc/lxc_container.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
>> index 255c711..e8f7a75 100644
>> --- a/src/lxc/lxc_container.c
>> +++ b/src/lxc/lxc_container.c
>> @@ -1829,7 +1829,8 @@ static int lxcContainerChild(void *data)
>> if (lxcContainerSetID(vmDef) < 0)
>> goto cleanup;
>>
>> - root = virDomainGetRootFilesystem(vmDef);
>> + if (!(root = virDomainGetRootFilesystem(vmDef)))
>> + goto cleanup;
>>
>> if (argv->nttyPaths) {
>> const char *tty = argv->ttyPaths[0];
>> --
>> 1.8.2.1
>
>
>
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
>
More information about the libvir-list
mailing list