Lines Matching refs:f

110         full_opt = f"{opt}"
115 full_cmd = f"{cmd:40s} {opt}".strip()
116 full_opt = f"`{full_cmd}`"
123 with open(self.script_template_path, "r") as f:
124 s += f.read(99)
127 s += f"{self._vm_name}\n"
130 with open(self.script_template_path, "r") as f:
131 f.seek(99,0)
132 s += f.read()
143 s += f"{name}={value}\n"
148 s += f"{command}\n"
176 s += f"{cpu_info:3d}{'':17s}"
177 s += f"{vcpu_id:3d}{'':17s}"
178 s += f"{self._cpu_dict[cpu_info]:3d}\n"
184 s += f" {param}\n"
192 s += f"{command}\n"
197 with open(path, "w") as f:
198 f.write(self.to_string())
199 logging.info(f"Successfully generated launch script {path} for VM '{self._vm_name}'.")
209 self.add_dynamic_dm_parameter("add_virtual_device", f"{vbdf} {kind} {options}")
214f"//bus[@type='pci' and @address='0x{bus:x}']/device[@address='0x{(dev << 16) | fun:x}']"
220 …self.add_dynamic_dm_parameter("add_passthrough_device", f"{vbdf} 0000:{bus:02x}:{dev:02x}.{fun} {o…
237 lapic_id = eval_xpath(board_etree, f"//processors//thread[cpu_id='{cpu}']/apic_id/text()", None)
241 …logging.warning(f"CPU {cpu} is not defined in the board XML, so it can't be available to VM {vm_na…
251 vm_name = eval_xpath(vm_scenario_etree, "./name/text()", f"ACRN Post-Launched VM")
262 …script.add_vm_descriptor("vm_type", f"'{eval_xpath(vm_scenario_etree, './/vm_type/text()', 'STANDA…
263 … script.add_vm_descriptor("scheduler", f"'{eval_xpath(hv_scenario_etree, './/SCHEDULER/text()')}'")
264 script.add_vm_descriptor("own_pcpu", f"'{eval_xpath(vm_scenario_etree, './/own_pcpu/text()')}'")
272 … script.add_dynamic_dm_parameter("add_cpus", f"{' '.join([str(x) for x in sorted(lapic_ids)])}")
274 script.add_plain_dm_parameter(f"-m {eval_xpath(vm_scenario_etree, './/memory/size/text()')}M")
303 …for ivshmem in eval_xpath_all(vm_scenario_etree, f"//IVSHMEM_REGION[PROVIDED_BY = 'Device Model' a…
304 vbdf = eval_xpath(ivshmem, f".//VBDF/text()")
307 …script.add_virtual_device("ivshmem", slot, options=f"dm:/{ivshmem.find('NAME').text},{ivshmem.find…
309 …script.add_virtual_device("ivshmem", slot, options=f"dm:/{ivshmem.find('NAME').text},{ivshmem.find…
311 …for ivshmem in eval_xpath_all(vm_scenario_etree, f"//IVSHMEM_REGION[PROVIDED_BY = 'Hypervisor' and…
312 vbdf = eval_xpath(ivshmem, f".//VBDF/text()")
315 …script.add_virtual_device("ivshmem", slot, options=f"hv:/{ivshmem.find('NAME').text},{ivshmem.find…
317 …script.add_virtual_device("ivshmem", slot, options=f"hv:/{ivshmem.find('NAME').text},{ivshmem.find…
322 …for idx, conn in enumerate(eval_xpath_all(hv_scenario_etree, f"//vuart_connection[endpoint/vm_name…
323 if eval_xpath(conn, f"./type/text()") == "pci":
324 vbdf = eval_xpath(conn, f"./endpoint[vm_name/text() = '{vm_name}']/vbdf/text()")
326 script.add_virtual_device("uart", slot, options=f"vuart_idx:{idx}")
340 … script.add_virtual_device("virtio-input", options=f"{backend_device_file},id:{unique_identifier}")
353 …script.add_virtual_device("virtio-console", options=f"{preceding_mask}file:file_port={output_file_…
356 …script.add_virtual_device("virtio-console", options=f"{preceding_mask}tty:tty_port={tty_file_path}…
359 …script.add_virtual_device("virtio-console", options=f"socket:{os.path.basename(sock_file_path).spl…
361 …script.add_virtual_device("virtio-console", options=f"{preceding_mask}{backend_type}:{backend_type…
367 tap_conf = f"tap={params[0]}"
371 script.add_init_command(f"mac=$(cat /sys/class/net/e*/address)")
372 params.append(f"mac_seed=${{mac:0:17}}-{vm_name}")
382 var = f"dir_{os.path.basename(block_device)}"
383 script.add_init_command(f"{var}=`mount_partition {block_device}`")
384 script.add_virtual_device("virtio-blk", options=os.path.join(f"${{{var}}}", rootfs_img))
385 script.add_deinit_command(f"unmount_partition ${{{var}}}")
395 … params.append(f"geometry={window_resolutions}+{horizontal_offset}+{vertical_offset}")
398 params.append(f"geometry=fullscreen:{monitor_id}")
430 script.add_plain_dm_parameter(f"{customized_parameters}")
431 script.add_plain_dm_parameter(f"{vm_name}")
458 logging.error(f"Cannot create output directory {out_dir}: File exists")
461 logging.error(f"Cannot create output directory: {e}")
476 … script.write_to_file(os.path.join(out_dir, f"launch_user_vm_id{post_vm_id - service_vm_id}.sh"))