summaryrefslogtreecommitdiffstats
path: root/lib/configure-vm
diff options
context:
space:
mode:
authorDan Radez <dradez@redhat.com>2017-05-05 16:51:02 -0400
committerDan Radez <dradez@redhat.com>2017-06-22 16:37:59 -0400
commit586110a27dc11e89a5ff3552f3215e8a0716aa92 (patch)
treee1fa6054d3f8077f114675d8de2b5da4a302a374 /lib/configure-vm
parentff9beeb45e7d25aedf2d25644497b0468a96ee16 (diff)
Adding conditionals dependent on arch
There are x86 specific build items that can't be used when building on aarch64. Adding conditionals so that the items only get built in when building on x86_64. There are aarch64 specific settings that need to be set for deployment. JIRA: APEX-381 Change-Id: I63e1c99d5d22bbb523c88be7e973a6c834a38b01 Signed-off-by: Dan Radez <dradez@redhat.com>
Diffstat (limited to 'lib/configure-vm')
-rwxr-xr-xlib/configure-vm32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/configure-vm b/lib/configure-vm
index 340a7ab6..5cb45218 100755
--- a/lib/configure-vm
+++ b/lib/configure-vm
@@ -100,6 +100,7 @@ def main():
'enable_serial_console': '',
'direct_boot': '',
'kernel_args': '',
+ 'user_interface': '',
}
if args.image is not None:
params['imagefile'] = args.image
@@ -162,6 +163,37 @@ def main():
<cmdline>%s</cmdline>
""" % ' '.join(args.kernel_args)
+ if args.arch == 'aarch64':
+
+ params['direct_boot'] += """
+ <loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
+ <nvram>/var/lib/libvirt/qemu/nvram/centos7.0_VARS.fd</nvram>
+ """
+ params['user_interface'] = """
+ <controller type='virtio-serial' index='0'>
+ <address type='virtio-mmio'/>
+ </controller>
+ <serial type='pty'>
+ <target port='0'/>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ </console>
+ <channel type='unix'>
+ <target type='virtio' name='org.qemu.guest_agent.0'/>
+ <address type='virtio-serial' controller='0' bus='0' port='1'/>
+ </channel>
+ """
+ else:
+ params['user_interface'] = """
+ <input type='mouse' bus='ps2'/>
+ <graphics type='vnc' port='-1' autoport='yes'/>
+ <video>
+ <model type='cirrus' vram='9216' heads='1'/>
+ </video>
+ """
+
+
libvirt_template = source_template % params
conn=libvirt.open(args.uri)
a = conn.defineXML(libvirt_template)