- self._temp['pidfile'] = '/var/run/qemu_{id}.pid'.format(id=qemu_id)
- if '/var/lib/vm/' in img:
- self._opt['vm_type'] = 'nestedvm'
- self._temp['qmp'] = '/var/run/qmp_{id}.sock'.format(id=qemu_id)
- self._temp['qga'] = '/var/run/qga_{id}.sock'.format(id=qemu_id)
- elif '/opt/boot/vmlinuz' in img:
- self._opt['vm_type'] = 'kernelvm'
- self._temp['log'] = '/tmp/serial_{id}.log'.format(id=qemu_id)
- self._temp['ini'] = '/etc/vm_init_{id}.conf'.format(id=qemu_id)
+ self._temp[u"pidfile"] = f"/run/qemu_{qemu_id}.pid"
+ if img == Constants.QEMU_VM_IMAGE:
+ self._opt[u"vm_type"] = u"nestedvm"
+ self._temp[u"qmp"] = f"/run/qmp_{qemu_id}.sock"
+ self._temp[u"qga"] = f"/run/qga_{qemu_id}.sock"
+ elif img == Constants.QEMU_VM_KERNEL:
+ self._opt[u"img"], _ = exec_cmd_no_error(
+ node, f"ls -1 {Constants.QEMU_VM_KERNEL}* | tail -1",
+ message=u"Qemu Kernel VM image not found!"
+ )
+ self._opt[u"vm_type"] = u"kernelvm"
+ self._temp[u"log"] = f"/tmp/serial_{qemu_id}.log"
+ self._temp[u"ini"] = f"/etc/vm_init_{qemu_id}.conf"
+ self._opt[u"initrd"], _ = exec_cmd_no_error(
+ node, f"ls -1 {Constants.QEMU_VM_KERNEL_INITRD}* | tail -1",
+ message=u"Qemu Kernel initrd image not found!"
+ )