Merge "Rename 'base/logging.h'."
diff --git a/brilloemulator_x86/base_product/qemu/brilloemulator-x86 b/brilloemulator_x86/base_product/qemu/brilloemulator-x86
index b84fbb9..38e4379 100755
--- a/brilloemulator_x86/base_product/qemu/brilloemulator-x86
+++ b/brilloemulator_x86/base_product/qemu/brilloemulator-x86
@@ -37,6 +37,12 @@
    esac
 done
 
+opts=()
+if [[ -c /dev/kvm ]]; then
+  # KVM is available on the host
+  opts+=( -enable-kvm )
+fi
+
 echo Starting emulator with ${MEM}MB memory
 exec \
 ${ANDROID_BUILD_TOP}/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/qemu-system-i386 \
@@ -48,7 +54,9 @@
   -drive file="${ANDROID_BUILD_TOP}/out/target/product/brilloemulator_x86/system.img,if=none,id=system,format=raw" \
   -device virtio-blk-pci,drive=userdata \
   -drive file="${ANDROID_BUILD_TOP}/out/target/product/brilloemulator_x86/userdata.img,if=none,id=userdata,format=raw" \
-  -netdev user,id=mynet -device virtio-net-pci,netdev=mynet \
+  -netdev user,id=mynet \
+  -device virtio-net-pci,netdev=mynet \
   -vga none \
   -L ${ANDROID_BUILD_TOP}/prebuilts/android-emulator/linux-x86_64/lib/pc-bios \
+  "${opts[@]}" \
   "$@"
diff --git a/brilloemulator_x86_64/base_product/qemu/brilloemulator-x86_64 b/brilloemulator_x86_64/base_product/qemu/brilloemulator-x86_64
index 96c1dcd..7a98ed9 100755
--- a/brilloemulator_x86_64/base_product/qemu/brilloemulator-x86_64
+++ b/brilloemulator_x86_64/base_product/qemu/brilloemulator-x86_64
@@ -37,6 +37,12 @@
    esac
 done
 
+opts=()
+if [[ -c /dev/kvm ]]; then
+  # KVM is available on the host
+  opts+=( -enable-kvm )
+fi
+
 echo Starting emulator with ${MEM}MB memory
 exec \
 ${ANDROID_BUILD_TOP}/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/qemu-system-x86_64 \
@@ -48,7 +54,9 @@
   -drive file="${ANDROID_BUILD_TOP}/out/target/product/brilloemulator_x86_64/system.img,if=none,id=system,format=raw" \
   -device virtio-blk-pci,drive=userdata \
   -drive file="${ANDROID_BUILD_TOP}/out/target/product/brilloemulator_x86_64/userdata.img,if=none,id=userdata,format=raw" \
-  -netdev user,id=mynet -device virtio-net-pci,netdev=mynet \
+  -netdev user,id=mynet \
+  -device virtio-net-pci,netdev=mynet \
   -vga none \
   -L ${ANDROID_BUILD_TOP}/prebuilts/android-emulator/linux-x86_64/lib/pc-bios \
+  "${opts[@]}" \
   "$@"