­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ {%- import 'libvirt_disks.jinja' as libvirt_disks -%} {%- from 'libvirt_macros.jinja' import opt_attribute as opt_attribute -%} {%- macro opt_attribute(obj, name, conv=none) %} {%- if obj.get(name) is not none %} {{ name }}='{{ obj[name] if conv is none else conv(obj[name]) }}'{% endif -%} {%- endmacro %} {%- import 'libvirt_chardevs.jinja' as libvirt_chardevs -%} {{ name }} {%- if cpu %} {{ cpu.get('maximum', '') }} {%- endif %} {%- if cpu.get('vcpus') %} {%- for vcpu_id in cpu["vcpus"].keys() %} {%- endfor %} {%- endif %} {%- if cpu %} {%- if cpu.model %} {{ cpu.model.get('name', '') }} {%- endif %} {%- if cpu.vendor %} {{ cpu.get('vendor', '') }} {%- endif %} {%- if cpu.topology %} {%- endif %} {%- if cpu.cache %} {%- endif %} {%- if cpu.features %} {%- for k, v in cpu.features.items() %} {%- endfor %} {%- endif %} {%- if cpu.numa %} {%- for numa_id in cpu.numa.keys() %} {%- if cpu.numa.get(numa_id) %} {%- if cpu.numa[numa_id].distances %} {%- for sibling_id in cpu.numa[numa_id].distances %} {%- endfor %} {%- endif %} {%- endif %} {%- endfor %} {%- endif %} {%- if cpu.iothreads %} {{ cpu.iothreads }} {%- endif %} {%- endif %} {%- if cpu.tuning %} {%- if cpu.tuning.vcpupin %} {%- for vcpu_id, cpuset in cpu.tuning.vcpupin.items() %} {%- endfor %} {%- endif %} {%- if cpu.tuning.emulatorpin %} {%- endif %} {%- if cpu.tuning.iothreadpin %} {%- for thread_id, cpuset in cpu.tuning.iothreadpin.items() %} {%- endfor %} {%- endif %} {%- if cpu.tuning.shares %} {{ cpu.tuning.shares }} {%- endif %} {%- if cpu.tuning.period %} {{ cpu.tuning.period }} {%- endif %} {%- if cpu.tuning.quota %} {{ cpu.tuning.quota }} {%- endif %} {%- if cpu.tuning.global_period %} {{ cpu.tuning.global_period }} {%- endif %} {%- if cpu.tuning.global_quota %} {{ cpu.tuning.global_quota }} {%- endif %} {%- if cpu.tuning.emulator_period %} {{ cpu.tuning.emulator_period }} {%- endif %} {%- if cpu.tuning.emulator_quota %} {{ cpu.tuning.emulator_quota }} {%- endif %} {%- if cpu.tuning.iothread_period %} {{ cpu.tuning.iothread_period }} {%- endif %} {%- if cpu.tuning.iothread_quota %} {{ cpu.tuning.iothread_quota }} {%- endif %} {%- if cpu.tuning.vcpusched %} {%- for sched in cpu.tuning.vcpusched %} {%- endfor %} {%- endif %} {%- if cpu.tuning.iothreadsched %} {%- for sched in cpu.tuning.iothreadsched %} {%- endfor %} {%- endif %} {%- if cpu.tuning.emulatorsched %} {%- endif %} {%- if cpu.tuning.cachetune %} {%- for k, v in cpu.tuning.cachetune.items() %} {%- for e, atrs in v.items() %} {%- if e is number and atrs %} {%- elif e is not number %} {%- for atr, val in atrs.items() %} {%- endfor %} {%- endif %} {%- endfor %} {%- endfor %} {%- endif %} {%- if cpu.tuning.memorytune %} {%- for vcpus, nodes in cpu.tuning.memorytune.items() %} {%- for id, bandwidth in nodes.items() %} {%- endfor %} {%- endfor %} {%- endif %} {%- endif %} {%- if mem.max %} {{ to_kib(mem.max) }} {%- endif %} {%- if mem.boot %} {{ to_kib(mem.boot) }} {%- endif %} {%- if mem.current %} {{ to_kib(mem.current) }} {%- endif %} {%- if mem %} {%- if 'hard_limit' in mem and mem.hard_limit %} {{ to_kib(mem.hard_limit) }} {%- endif %} {%- if 'soft_limit' in mem and mem.soft_limit %} {{ to_kib(mem.soft_limit) }} {%- endif %} {%- if 'swap_hard_limit' in mem and mem.swap_hard_limit %} {{ to_kib(mem.swap_hard_limit) }} {%- endif %} {%- if 'min_guarantee' in mem and mem.min_guarantee %} {{ to_kib(mem.min_guarantee) }} {%- endif %} {%- endif %} {%- if numatune %} {%- if 'memory' in numatune and numatune.memory %} {%- endif %} {%- if 'memnodes' in numatune and numatune.memnodes %} {%- for cell_id in numatune['memnodes'] %} {%- endfor %} {%- endif %} {%- endif %} {%- if mem %} {%- if mem.hugepages %} {%- for page in mem.hugepages %} {%- endfor %} {%- if mem.nosharepages %} {%- endif %} {%- if mem.locked %} {%- endif %} {%- if mem.source %} {%- endif %} {%- if mem.access %} {%- endif %} {%- if mem.allocation %} {%- endif %} {%- if mem.discard %} {%- endif %} {%- endif %} {%- endif %} {{ os_type }} {%- if boot %} {%- if 'kernel' in boot %} {{ boot.kernel }} {%- endif %} {%- if 'initrd' in boot %} {{ boot.initrd }} {%- endif %} {%- if 'cmdline' in boot %} {{ boot.cmdline }} {%- endif %} {%- if 'loader' in boot %} {{ boot.loader }} {%- endif %} {%- if 'nvram' in boot %} {%- endif %} {%- endif %} {%- for dev in boot_dev %} {%- endfor %} {%- if clock %} {%- for timer_name in clock.timers %} {%- set timer = clock.timers[timer_name] %} {%- if "threshold" in timer or "slew" in timer or "limit" in timer %} {%- endif %} {%- endfor %} {%- endif %} {{ on_reboot }} {%- for disk in disks %} {%- if disk.type == 'file' and 'source_file' in disk -%} {%- endif %} {%- if disk.type == 'block' -%} {%- endif %} {%- if disk.type == 'volume' and 'pool' in disk -%} {%- endif %} {%- if disk.type == 'network' %}{{ libvirt_disks.network_source(disk) }}{%- endif %} {%- if disk.address -%}
{%- endif %} {%- if disk.driver -%} {%- endif %} {%- endfor %} {%- if controller_model %} {%- endif %} {%- for nic in nics %} {%- if nic.get('mac') -%} {%- endif %} {%- if nic.model %}{% endif %} {%- endfor %} {%- if graphics %} {%- if graphics.type == "spice" and hypervisor in ["qemu", "kvm"] %} {%- endif %} {%- endif %} {%- for serial in serials %} {{ libvirt_chardevs.chardev(serial) }} {%- endfor %} {%- for console in consoles %} {{ libvirt_chardevs.chardev(console) }} {%- endfor %} {%- if hypervisor in ["qemu", "kvm"] %} {%- endif %} {%- for hostdev in hostdevs %} {%- if hostdev["type"] == "usb" %} {%- elif hostdev["type"] == "pci" %}
{%- endif %} {%- endfor %} {%- if hypervisor_features.get("kvm-hint-dedicated") %} {%- endif %}