Skip to content

Instantly share code, notes, and snippets.

@RaghavRao
Created April 28, 2021 00:52
Show Gist options
  • Save RaghavRao/47fa300edffb28e5df3387b30b9756c3 to your computer and use it in GitHub Desktop.
Save RaghavRao/47fa300edffb28e5df3387b30b9756c3 to your computer and use it in GitHub Desktop.
Find PCI device in virsh nodedev format
#!/bin/bash
virsh nodedev-list --cap pci | grep $( echo pci_.*"$(lspci | grep "$1" | awk '{ print $1 }' | tr ':' '_' | tr '.' '_' )" )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment