Unverified Commit f779730a authored by Jakob Görgen's avatar Jakob Görgen
Browse files

fixed instantiation copy error + fixed simple nic simulator due to system...

fixed instantiation copy error + fixed simple nic simulator due to system module changes + fix qemu image warning
parent 821f5580
...@@ -85,7 +85,6 @@ class Instantiation(): ...@@ -85,7 +85,6 @@ class Instantiation():
sim: sim_base.Simulation, sim: sim_base.Simulation,
env: InstantiationEnvironment = InstantiationEnvironment(), env: InstantiationEnvironment = InstantiationEnvironment(),
): ):
super().__init__()
self._id = next(self.__id_iter) self._id = next(self.__id_iter)
self.simulation: sim_base.Simulation = sim self.simulation: sim_base.Simulation = sim
self.env: InstantiationEnvironment = env self.env: InstantiationEnvironment = env
...@@ -342,7 +341,7 @@ class Instantiation(): ...@@ -342,7 +341,7 @@ class Instantiation():
cop._preserve_checkpoints = self._preserve_checkpoints cop._preserve_checkpoints = self._preserve_checkpoints
cop.preserve_tmp_folder = self.preserve_tmp_folder cop.preserve_tmp_folder = self.preserve_tmp_folder
cop._socket_per_interface = {} cop._socket_per_interface = {}
cop._sim_dependency = {} cop._sim_dependency = None
return cop return cop
def out_base_dir(self) -> str: def out_base_dir(self) -> str:
......
...@@ -70,15 +70,15 @@ class NICSim(PCIDevSim): ...@@ -70,15 +70,15 @@ class NICSim(PCIDevSim):
cmd = f"{inst.join_repo_base(relative_path=self._executable)} " cmd = f"{inst.join_repo_base(relative_path=self._executable)} "
pci_devices = self.filter_components_by_type(ty=sys_pcie.PCIeSimpleDevice) nic_devices = self.filter_components_by_type(ty=sys_nic.SimplePCIeNIC)
assert len(pci_devices) == 1 assert len(nic_devices) == 1
socket = inst.get_socket(interface=pci_devices[0]._pci_if) nic_device = nic_devices[0]
socket = inst.get_socket(interface=nic_device._pci_if)
assert socket is not None and socket._type == inst_base.SockType.LISTEN assert socket is not None and socket._type == inst_base.SockType.LISTEN
cmd += f"{socket._path} " cmd += f"{socket._path} "
eth_devices = self.filter_components_by_type(ty=sys_eth.EthSimpleNIC) socket = inst.get_socket(interface=nic_device._eth_if)
assert len(eth_devices) == 1
socket = inst.get_socket(interface=eth_devices[0]._eth_if)
assert socket is not None and socket._type == inst_base.SockType.LISTEN assert socket is not None and socket._type == inst_base.SockType.LISTEN
cmd += f"{socket._path} " cmd += f"{socket._path} "
...@@ -93,6 +93,7 @@ class NICSim(PCIDevSim): ...@@ -93,6 +93,7 @@ class NICSim(PCIDevSim):
if self.extra_args is not None: if self.extra_args is not None:
cmd += " " + self.extra_args cmd += " " + self.extra_args
print(cmd)
return cmd return cmd
......
...@@ -54,7 +54,7 @@ class DiskImage(utils_base.IdObj): ...@@ -54,7 +54,7 @@ class DiskImage(utils_base.IdObj):
copy_path = inst.join_imgs_path(relative_path=f"hdcopy.{self._id}") copy_path = inst.join_imgs_path(relative_path=f"hdcopy.{self._id}")
prep_cmds = [ prep_cmds = [
( (
f"{inst.join_repo_base(relative_path=self._qemu_img_exec)} create -f qcow2 -o " f"{inst.join_repo_base(relative_path=self._qemu_img_exec)} create -f qcow2 -F qcow2 -o "
f'backing_file="{disk_path}" ' f'backing_file="{disk_path}" '
f"{copy_path}" f"{copy_path}"
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment