diff options
author | Jiang, Yunhong <yunhong.jiang@intel.com> | 2012-02-23 06:31:12 +0800 |
---|---|---|
committer | Jiang, Yunhong <yunhong.jiang@intel.com> | 2012-02-23 23:11:12 +0800 |
commit | 4a5a0efd49f100c7d53920807c83d9c74304ecd8 (patch) | |
tree | 44b171204d5d07b8ec4c2788cf107fa63fd4c211 /target-i386/hax-darwin.c | |
parent | a3338e7214cd0c69912866c6d71d8700c6ab35e2 (diff) | |
download | external_qemu-4a5a0efd49f100c7d53920807c83d9c74304ecd8.zip external_qemu-4a5a0efd49f100c7d53920807c83d9c74304ecd8.tar.gz external_qemu-4a5a0efd49f100c7d53920807c83d9c74304ecd8.tar.bz2 |
Check HAXM capability in QEMU
Checking HAXM capability to check if emulator can use HAXM virtalization.
Currently two possibility that HAXM not work. Firstly is VT/NX is not enabled
in the system, seconly is HAXM have used up the memory quota. See code comemnts
for the memry quota explaination.
Checking the capability in advance can give user more information that why HAXM
is not working and be more user friendly.
Change-Id: I13f73734cf783398f485fabd19cce43364b571c3
Signed-off-by: Xin, Xiaohui <xiaohui.xin@intel.com>
Signed-off-by: Gao, Fengqian <fengqian.gao@intel.com>
Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
Diffstat (limited to 'target-i386/hax-darwin.c')
-rw-r--r-- | target-i386/hax-darwin.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/target-i386/hax-darwin.c b/target-i386/hax-darwin.c index b6d27c3..2b460ce 100644 --- a/target-i386/hax-darwin.c +++ b/target-i386/hax-darwin.c @@ -85,6 +85,20 @@ int hax_set_phys_mem(target_phys_addr_t start_addr, ram_addr_t size, ram_addr_t return ret; } +int hax_capability(struct hax_state *hax, struct hax_capabilityinfo *cap) +{ + int ret; + + ret = ioctl(hax->fd, HAX_IOCTL_CAPABILITY, cap); + if (ret == -1) + { + dprint("Failed to get HAX capability\n"); + return -errno; + } + + return 0; +} + int hax_mod_version(struct hax_state *hax, struct hax_module_version *version) { int ret; |