summaryrefslogtreecommitdiff
path: root/kvm-all.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2009-12-02 12:24:42 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 11:45:50 -0600
commit40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4 (patch)
tree98d560a0de229f27a66f637cfcadbb1672e68cc3 /kvm-all.c
parent12c09b8ce22d74f78ff50f95676cbe4f501752ae (diff)
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 <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'kvm-all.c')
-rw-r--r--kvm-all.c2
1 files changed, 1 insertions, 1 deletions
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;