vnc: fix memory leak when vnc disconnect
[qemu/ar7.git] / python / qemu / __init__.py
blob6c919a3d56f09f2c2a294c6fde9f32cbeffb3569
1 # QEMU library
3 # Copyright (C) 2015-2016 Red Hat Inc.
4 # Copyright (C) 2012 IBM Corp.
6 # Authors:
7 # Fam Zheng <famz@redhat.com>
9 # This work is licensed under the terms of the GNU GPL, version 2. See
10 # the COPYING file in the top-level directory.
12 # Based on qmp.py.
15 import logging
16 import os
18 from . import qmp
19 from . import machine
21 LOG = logging.getLogger(__name__)
23 # Mapping host architecture to any additional architectures it can
24 # support which often includes its 32 bit cousin.
25 ADDITIONAL_ARCHES = {
26 "x86_64" : "i386",
27 "aarch64" : "armhf"
30 def kvm_available(target_arch=None):
31 host_arch = os.uname()[4]
32 if target_arch and target_arch != host_arch:
33 if target_arch != ADDITIONAL_ARCHES.get(host_arch):
34 return False
35 return os.access("/dev/kvm", os.R_OK | os.W_OK)