[Spice-devel] [PATCH linux vdagent] Add POC for getting xrandr output from monitor ID

Gerd Hoffmann kraxel at redhat.com
Wed Oct 10 13:27:32 UTC 2018


  Hi,

> # ./get-xrandr-output 0000:02:03.0 0
> sys path: /sys/class/drm/card0
> sys path device: /sys/class/drm/card0/device
> Device /dev/dri/card0 is at ../../../virtio2
> card addr 'virtio2' does not match requested addr '0000:02:03.0'
> no card exists

I think you should use this:

kraxel at fedora ~# readlink /sys/class/drm/card0
../../devices/pci0000:00/0000:00:01.0/virtio0/drm/card0

> Also, as Frediano already mentioned in his email, in Gerd's initial
> suggestion [1] the PCI address was like so:
> 
>   pci/$domain/$slot.$fn/$slot.$fn
>                         ^^^^^^^^^  gpu device
>               ^^^^^^^^^            pci bridge
> 
> I'm not saying we can't use the BDF, Gerd, did you have a reason for
> not using the bus and list the PCI device hierarchy instead?

The pci bus numeration is done by the guest (typically the firmware).
So the bus numbers do not exist (yet) when qemu starts.  They also may
change at runtime (even though typically they don't).

slot and function and (if present) parent pci bridges will not change.

cheers,
  Gerd



More information about the Spice-devel mailing list