From 40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Wed, 2 Dec 2009 12:24:42 +0100 Subject: Don't leak file descriptors We're leaking file descriptors to child processes. Set FD_CLOEXEC on file descriptors that don't need to be passed to children to stop this misbehaviour. Signed-off-by: Kevin Wolf Signed-off-by: Anthony Liguori --- kvm-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kvm-all.c') diff --git a/kvm-all.c b/kvm-all.c index b605caaef4..b8ffe546c5 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -416,7 +416,7 @@ int kvm_init(int smp_cpus) s->slots[i].slot = i; s->vmfd = -1; - s->fd = open("/dev/kvm", O_RDWR); + s->fd = qemu_open("/dev/kvm", O_RDWR); if (s->fd == -1) { fprintf(stderr, "Could not access KVM kernel module: %m\n"); ret = -errno; -- cgit v1.2.3