Skip to content

Commit

Permalink
driver: qemudriver: fold equivalent disk arguments
Browse files Browse the repository at this point in the history
Fold the "q35", "virt" and "pc" machines into a single if clause. They
all use the same definition anyway.

Signed-off-by: Rouven Czerwinski <[email protected]>
  • Loading branch information
Emantor committed Dec 15, 2023
1 parent 5b6852d commit c3f2a94
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions labgrid/driver/qemudriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,7 @@ def get_qemu_base_args(self):
cmd.append(
f"if=sd,format={disk_format},file={disk_path},id=mmc0{disk_opts}")
boot_args.append("root=/dev/mmcblk0p1 rootfstype=ext4 rootwait")
elif self.machine == "q35":
cmd.append("-drive")
cmd.append(
f"if=virtio,format={disk_format},file={disk_path}{disk_opts}")
boot_args.append("root=/dev/vda rootwait")
elif self.machine == "pc":
cmd.append("-drive")
cmd.append(
f"if=virtio,format={disk_format},file={disk_path}{disk_opts}")
boot_args.append("root=/dev/vda rootwait")
elif self.machine == "virt":
elif self.machine in [ "pc", "q35", "virt" ]:
cmd.append("-drive")
cmd.append(
f"if=virtio,format={disk_format},file={disk_path}{disk_opts}")
Expand Down

0 comments on commit c3f2a94

Please sign in to comment.