diff options
author | dann frazier <dann.frazier@canonical.com> | 2014-04-30 15:14:28 -0600 |
---|---|---|
committer | dann frazier <dann.frazier@canonical.com> | 2014-04-30 15:14:28 -0600 |
commit | e95ca8eec43c35c450a1a012bd28a1561e3b07e9 (patch) | |
tree | 20be02cdfaec951e3bb3eb227617aee6677637a6 /bin/virtualization | |
parent | b142871043db01b25add05897e5106d417a239ba (diff) |
Migrate armhf to the virt model
ARM has moved from using vexpress-based models to the "virt" model for the guests. This lets us use virtio. However, since we don't have PCI, this is a different virtio disk type then used on x86, so I've added a new VIRTIO_BLK disk type. We also no longer need to specify a dtb.
Diffstat (limited to 'bin/virtualization')
-rwxr-xr-x | bin/virtualization | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/bin/virtualization b/bin/virtualization index 8a861fe..db6684a 100755 --- a/bin/virtualization +++ b/bin/virtualization @@ -57,18 +57,17 @@ class XENTest(object): # in the disk image that we can chain to, and instead # we need to have qemu load boot files externally CLOUD_IMAGE_TYPE = Enum('CLOUD_IMAGE_TYPE', 'TAR DISK') -QEMU_DISK_TYPE = Enum('QEMU_DISK_TYPE', 'SD VIRTIO') +QEMU_DISK_TYPE = Enum('QEMU_DISK_TYPE', 'SD VIRTIO VIRTIO_BLK') QEMU_ARCH_CONFIG = { 'armhf': { 'cloudimg_type': CLOUD_IMAGE_TYPE.TAR, 'cloudimg_arch': 'armhf', - 'dtb': 'vexpress-v2p-ca15-tc1.dtb', 'qemu_bin': 'qemu-system-arm', - 'qemu_disk_type': QEMU_DISK_TYPE.SD, + 'qemu_disk_type': QEMU_DISK_TYPE.VIRTIO_BLK, 'qemu_extra_args': [ - '-machine', 'vexpress-a15', - '-cpu', 'cortex-a15', + '-machine', 'virt', + '-cpu', 'host', '-enable-kvm', '-serial', 'stdio', ], @@ -97,6 +96,7 @@ class QemuRunner(object): def __init__(self, arch): self.arch = arch self.config = QEMU_ARCH_CONFIG[arch] + self.drive_id = 0 # Parameters common to all architectures self.params = [ self.config['qemu_bin'], @@ -135,7 +135,13 @@ class QemuRunner(object): drive = drive + ["file=%s,if=sd,cache=writeback" % (cloudimg)] elif self.config['qemu_disk_type'] == QEMU_DISK_TYPE.VIRTIO: drive = drive + ["file=%s,if=virtio" % (cloudimg)] + elif self.config['qemu_disk_type'] == QEMU_DISK_TYPE.VIRTIO_BLK: + drive = drive + [ "file=%s,if=none,id=disk.%d" + % (cloudimg, self.drive_id) ] + drive = drive + [ "-device", "virtio-blk-device,drive=disk.%d" + % (self.drive_id) ] self.params = self.params + drive + self.drive_id = self.drive_id + 1 def get_params(self): params = self.params @@ -213,8 +219,6 @@ class KVMTest(object): qemu.add_boot_files( kernel='/boot/vmlinuz', initrd='/boot/initrd.img', - dtb="/lib/firmware/%s/device-tree/%s" % (os.uname()[2], - self.qemu_config['dtb']) ) qemu.add_drive(data_disk) |