ping
-----Original Message-----
From: Chen Hanxiao [mailto:chenhanxiao@cn.fujitsu.com]
Sent: Tuesday, November 05, 2013 5:57 PM
To: libvir-list(a)redhat.com
Cc: chenhanxiao(a)cn.fujitsu.com
Subject: [libvirt][PATCH]lxc: make sure root wouldn't be null
From: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
virDomainGetRootFilesystem may return null.
We should take care of it.
Signed-off-by: Chen Hanxiao <chenhanxiao(a)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