Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sriov: fix ipxe rom file issue #6081

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions provider/sriov/sriov_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,11 @@ def get_rom_file(self):
rom_vendor_device = lspci_stdout[1:-1].replace(':', '') + '.rom'
rom_file = os.path.join('/usr/share/ipxe', rom_vendor_device)
if not os.path.exists(rom_file):
build_cmd = "git clone https://github.com/ipxe/ipxe.git;\
pushd ipxe/src; make bin/{0}; cp bin/{0} {1}; popd; \
rm -rf ipxe".format(rom_vendor_device, rom_file)
process.run(build_cmd, shell=True, verbose=True)
# Directly use virtio rom file because it mainly test xml but not pxe function.
rom_file = "/usr/share/ipxe/1af41000.rom"
Comment on lines +261 to +262
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use a more direct variable name instead of commenting here.

Suggested change
# Directly use virtio rom file because it mainly test xml but not pxe function.
rom_file = "/usr/share/ipxe/1af41000.rom"
virtio_rom_file = "/usr/share/ipxe/1af41000.rom"
if not os.path.exists(virtio_rom_file):
self.test.error(f"This test needs a rom file, but neither {virtio_rom_file} or {rom_file} exist!")

if not os.path.exists(rom_file):
self.test.error("This test needs rom file: %s." % rom_file)
self.test.error("This test needs rom file but the virtio rom file also doesn't exist: %s."
% rom_file)
return rom_file

def create_iface_dev(self, dev_type, iface_dict):
Expand Down