diff options
author | Jeff Lane <jeffrey.lane@canonical.com> | 2016-01-06 14:11:39 -0500 |
---|---|---|
committer | Jeff Lane <jeffrey.lane@canonical.com> | 2016-01-06 14:11:39 -0500 |
commit | d67398ac1c2593f2759fd51b1b3324b915835e13 (patch) | |
tree | 9904fe4d7502ba59d3f98ec53eb585c184cd22ca /bin | |
parent | ecedfe23ce6e203b79d112af81f312627453f761 (diff) | |
parent | 694c9975002ca28e8975638b0fa84e5fa126c62b (diff) |
Modified virtualization script to add gicv3 support on arm64 when necessary
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/virtualization | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bin/virtualization b/bin/virtualization index f9d1f1f..4960fbe 100755 --- a/bin/virtualization +++ b/bin/virtualization @@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. from argparse import ArgumentParser import configparser +from glob import glob import os import re import logging @@ -69,10 +70,9 @@ QEMU_ARCH_CONFIG = { 'qemu_bin': 'qemu-system-aarch64', 'qemu_disk_type': QEMU_DISK_TYPE_VIRTIO_BLK, 'qemu_extra_args': [ - '-machine', 'virt', '-cpu', 'host', '-enable-kvm', - '-serial', 'stdio', + #'-serial', 'stdio', ], }, 'armhf': { @@ -130,6 +130,13 @@ class QemuRunner(object): "-net", "nic", "-net", "user,net=10.0.0.0/8,host=10.0.0.1,hostfwd=tcp::2222-:22", ] + # If arch is arm64, add the machine type for gicv3, or default to old + # type + if self.arch == 'arm64': + if glob("/sys/firmware/devicetree/base/interrupt-controller@*/compatible"): + self.config['qemu_extra_args'].extend(['-machine', 'virt,gic_version=3']) + else: + self.config['qemu_extra_args'].extend(['-machine', 'virt']) # Add any architecture-specific parameters if 'qemu_extra_args' in self.config: self.params = self.params + self.config['qemu_extra_args'] |