[libvirt] [PATCH] LXC: Allow to input relative path of program for lxc-enter-namespace

Gao feng gaofeng at cn.fujitsu.com
Tue Jun 11 08:02:12 UTC 2013


User execvp to replace execv, so user can use
relative path to exec programs in container.

Such as "lxc-enter-namespace domain ls"

And the user can still use absolute path to
exec programs.

Signed-off-by: Gao feng <gaofeng at cn.fujitsu.com>
---
 tools/virsh-domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 955e882..8161b23 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -7902,7 +7902,7 @@ cmdLxcEnterNamespace(vshControl *ctl, const vshCmd *cmd)
         if (virFork(&pid) < 0)
             _exit(255);
         if (pid == 0) {
-            execv(cmdargv[0], cmdargv);
+            execvp(cmdargv[0], cmdargv);
             _exit(255);
         } else {
             if (virProcessWait(pid, NULL) < 0)
-- 
1.8.1.4




More information about the libvir-list mailing list