Atheros AR9280 Wireless Card BAR error


Go to solution Solved by ghost82,

Recommended Posts

I've looked and looked and only found references to this type of error with regards to passing through NVME drives.

 

I am trying to set up my pfsense VM to connect to a hotspot int the certain event that my point to point LTE connection fails. To do this I want to pass through a Wifi card.

 

I cannot use my built in AX card because FreeBSD does not support current cards. I bought a Ralink corp. RT3090 Wireless 802.11n card and the VM works but my whole server locks up every few days (Working on troubleshooting that currently)

 

So I bought a Atheros card and bound that to VFIO using the System Devices Tool.

 

I see it properly in my VM editor, and can select it and apply, but when I try to boot the VM I get:

 

image.thumb.png.6785a7e9fd2b34f7d596bd70e47df4c4.png

 

I've looked and looked and found a couple of references:

PCIe Passthrough of Atheros AR9280

(OK, Looks like One reference)

 

I've tried 2 different versions of the same card, both giving the same error.. I've tried tow different slots in my mainboard...

 

I just don't know where else to look.

 

Thanks

 

Arbadacarba

 

 

 

Link to comment
  • Solution

In that discussion, some user is reporting it working with the following mod, try to add custom qemu arg at the bottom of your xml, before </domain>.

From your picture your pci passthrough should have the alias hostdev1.

 

...
...
    <qemu:commandline>
      <qemu:arg value='-set'/>
      <qemu:arg value='device.hostdev1.x-msix-relocation=bar2'/>
    </qemu:commandline>
  </domain>

 

Edited by ghost82
  • Thanks 1
Link to comment
3 hours ago, Arbadacarba said:

I'm curious if there was a resource you can point me to for the conversion from Proxmox Scripting to Unraid's XML?

There's no "Unraid's xml", but there's libvirt (unraid is an interface for libvirt).

I don't know and never used proxmox, but I can image it's the same, with its configuration options.

Both proxmox and unraid are based on qemu and libvirt, libvirt being a sort of bridge to configure qemu vms (xml format).

So the basic documents you want to refer to are that for libvirt (and qemu).

You can run qemu vms from the command line terminal, qemu is a binary and you run it as a traditional binary, with options, parameters, etc.

Or you can run libvirt vms from the command line with the "virsh" command.

Most of the qemu commands/options are available in libvirt, so that options translate into xml format.

When such options are not available directly in libvirt you use <qemu:commandline>.

In the example above, in libvirt:

    <qemu:commandline>
      <qemu:arg value='-set'/>
      <qemu:arg value='device.hostdev1.x-msix-relocation=bar2'/>
    </qemu:commandline>

translates into qemu command line:

./qemubinary ...other options... -set device.hostdev1.x-msix-relocation=bar2

 

Edited by ghost82
  • Thanks 1
Link to comment
  • 3 weeks later...

So this worked GREAT right up until I installed RC3...

 

What do you mean you didn't see this scenario? There must be 1 of us doing this...

 

So after upgrading I rebooted and my VM would not start. I look and discover that my Atheros card is no longer included in the VFIO

 

I added it back in and rebooted.

 

Then on reboot I get a slightly different version of the message I got before... Only now when I look I don't see an appropriate alias assign to the wifi card.

 

image.png.8ccf2d10253582eb4f7dc8f8e41244b6.png

 

And further if I add an alias, it's gone when I look again after I attempt to start the VM.

Edited by Arbadacarba
Link to comment
4 hours ago, Arbadacarba said:

Only now when I look I don't see an appropriate alias assign to the wifi card

If this is the issue, it could be a bug (?) in the rc3.

I think you could always use terminal to edit the xml of the vm with the 'virsh edit' command.

If the alias is lacking try to manually add it with terminal:

virsh edit HEREVMNAME

 

Then in the editor add the alias in the appropriate device section:

<alias name='YOURALIASHERE'/>

 

Save and exit the editor.

Double check again with virsh edit that the alias has being added.

Close the editor and try.

  • Thanks 1
Link to comment
12 hours ago, ghost82 said:

I don't understand this, can you rephrase?

 

Failed sarcasm... Was supposed to show that I fully understood just how unique this question was and that I was in no way surprised that it wasn't foreseen and therefore fixed ahead of time...

 

WOW, I know I don't do sarcasm well... I shouldn't even have tried. :)

 

Really... that was intended as entirely self deprecating and to express my appreciation for the efforts to make this bizarre use case possible at all.

 

Thanks Again Ghost82

 

I did try editing it in the gui and did try inserting the alias there... but when I run the VM with the Atheros card connected (?) even the alias' for the other NIC vanish from the XML

 

Arbadacarba

 

Link to comment
On 3/12/2022 at 10:35 PM, Arbadacarba said:

WOW, I know I don't do sarcasm well... I shouldn't even have tried. :)

Not your fault for sure, even with a translator I'm missing the meaning, even if explained ahah, but all I need to know it's that it was sarcasm :D

 

Did you try with the virsh edit command? It can be a bug in the gui stripping the aliases.

Link to comment

Hi same problem here since 6.10rc3. With macinabox VM 

where i set this:

 

<qemu:arg value='device.sata0-0-1.rotation_rate=1'/>

 

The VM won’t start with error « no device sata0.0.1….

i try to had a label via webgui and virsh edit  but the setting not stay in place .

Link to comment

Can you please check in your diagnostics file, after setting a vm with aliases in unraid (don't bother if they are stripped or not) and run it then stop it:

 

1. Extract diagnostics zip and go to qemu/VMName.txt

2. Open VMName.txt and check if the aliases are there: for example for 'sata0-0-1' alias, you should have this in the device line:

id=sata0-0-1

 

Libvirt aliases translate to ids in qemu.

 

If they are not there too, as a temporary workaround you could run the vm directly from the command line, adding all the ids you need, calling directly the qemu binary.

Edited by ghost82
Link to comment

Hi in my problematic vm i can find this in diagnostic file

 

-device '{"driver":"ide-hd","bus":"ide.2","drive":"libvirt-2-format","id":"sata0-0-2","bootindex":1,"write-cache":"on"}' \

 

-set device.sata0-0-2.rotation_rate=1 \

 

qemu-system-x86_64: -set device.sata0-0-2.rotation_rate=1: there is no device "sata0-0-2" defined

Link to comment

Looking at the qemu bugtracker, it seems confirmed there too; the alias is there, it's not stripped, the issue is with the -set and json format.

https://gitlab.com/qemu-project/qemu/-/issues/787

 

Quote

This seems caused by libvirt trying to generate JSON syntax for -device by default for QEMU 6.2.0. However, QEMU 6.2.0 doesn't support -set option when JSON syntax is used for -device

 

Also here:

https://gitlab.com/libvirt/libvirt/-/issues/287

 

There is a patch too, but it hasn't been merged.

Not sure, how to eventually modify qemu.conf to add capability_filters; the only option could be to extract the unraid bzroot file, "patch" it, and recompress it, to have a persistent solution after a reboot. Moreover it's not clear if this is working or not.

...and:

Quote

# For debugging and testing purposes it's sometimes useful to be able to disable

# libvirt behaviour based on the capabilities of the qemu process. This option

# allows to do so. DO _NOT_ use in production and beaware that the behaviour

# may change across versions.

 

 

For rotation_rate I think you can actually add it to the libvirt xml without using the custom qemu arg (from libvirt 7.3.0, 6.10 RC3 should have >=7.8.0), something like this, in the target line of the disk section:

    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='path/to/vdisk.img'/>
      <target dev='hdc' bus='sata' rotation_rate='1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>

 

For x-msix-relocation the only option should be that described in the next post :(

Edited by ghost82
  • Thanks 1
Link to comment
11 hours ago, ghost82 said:

Looking at the qemu bugtracker, it seems confirmed there too; the alias is there, it's not stripped, the issue is with the -set and json format.

https://gitlab.com/qemu-project/qemu/-/issues/787

 

 

Also here:

https://gitlab.com/libvirt/libvirt/-/issues/287

 

There is a patch too, but it hasn't been merged.

Not sure, how to eventually modify qemu.conf to add capability_filters; the only option could be to extract the unraid bzroot file, "patch" it, and recompress it, to have a persistent solution after a reboot. Moreover it's not clear if this is working or not.

...and:

 

 

For rotation_rate I think you can actually add it to the libvirt xml without using the custom qemu arg (from libvirt 7.3.0, 6.10 RC3 should have >=7.8.0), something like this, in the target line of the disk section:

    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='path/to/vdisk.img'/>
      <target dev='hdc' bus='sata' rotation_rate='1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>

 

For x-msix-relocation the only option should be that described in the next post :(

Hi your solution "rotation rate in target line"  work perfectly for me. Thanks for all

  • Like 1
Link to comment
On 3/12/2022 at 5:04 AM, Arbadacarba said:

So this worked GREAT right up until I installed RC3

In RC3 add this:

  <qemu:capabilities>
    <qemu:del capability='device.json'/>
  </qemu:capabilities>

right after the </qemu:commandline> closing tag.

 

Please read also this, as this should be a temporary workaround:

https://forums.unraid.net/bug-reports/prereleases/rc3-vm-alias-handler-change-r1768/?do=findComment&comment=18036

 

Edited by ghost82
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.