Skip to contentSkip to conversation

hw/vfio-user: add x-pci-class-code

PATCH Applied John Levon 2 participants 3 messages Aug 27, 2025 – Sep 8, 2025

lore
Share & tools
lore

John Levon

author
#0 lore raw

PATCH 1/1 hw/vfio-user: add x-pci-class-code

This new option was not added to vfio_user_pci_dev_properties, which caused an incorrect class code for vfio-user devices.

Fixes a59d06305fff ("vfio/pci: Introduce x-pci-class-code option")
---
 hw/vfio-user/pci.c | 2 ++
 1 file changed, 2 insertions(+)
hw/vfio-user/pci.c +2 -0
index be71c77729..dfaa89498d 100644
@@ -406,6 +406,8 @@ static const Property vfio_user_pci_dev_properties[] = {
                        sub_vendor_id, PCI_ANY_ID),
     DEFINE_PROP_UINT32("x-pci-sub-device-id", VFIOPCIDevice,
                        sub_device_id, PCI_ANY_ID),
+    DEFINE_PROP_UINT32("x-pci-class-code", VFIOPCIDevice,
+                       class_code, PCI_ANY_ID),
     DEFINE_PROP_BOOL("x-send-queued", VFIOUserPCIDevice, send_queued, false),
     DEFINE_PROP_UINT32("x-msg-timeout", VFIOUserPCIDevice, wait_time, 5000),
     DEFINE_PROP_BOOL("x-no-posted-writes", VFIOUserPCIDevice, no_post, false),
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · John Levon

This new option was not added to vfio_user_pci_dev_properties, which caused an incorrect class code for vfio-user devices.

Fixes a59d06305fff ("vfio/pci: Introduce x-pci-class-code option")
---
  hw/vfio-user/pci.c | 2 ++
  1 file changed, 2 insertions(+)
hw/vfio-user/pci.c +0 -0
index be71c77729..dfaa89498d 100644

hw/vfio-user/pci.c static const Property vfio_user_pci_dev_properties[] = { · line 413

Quoted 8 lines
hw/vfio-user/pci.c +2 -0
@@ -406,6 +406,8 @@ static const Property vfio_user_pci_dev_properties[] = {
                         sub_vendor_id, PCI_ANY_ID),
      DEFINE_PROP_UINT32("x-pci-sub-device-id", VFIOPCIDevice,
                         sub_device_id, PCI_ANY_ID),
+    DEFINE_PROP_UINT32("x-pci-class-code", VFIOPCIDevice,
+                       class_code, PCI_ANY_ID),
      DEFINE_PROP_BOOL("x-send-queued", VFIOUserPCIDevice, send_queued, false),
      DEFINE_PROP_UINT32("x-msg-timeout", VFIOUserPCIDevice, wait_time, 5000),
      DEFINE_PROP_BOOL("x-no-posted-writes", VFIOUserPCIDevice, no_post, false),

Thanks,

C.

#2 lore raw
In reply to John Levon
Quoted 14 lines · John Levon

This new option was not added to vfio_user_pci_dev_properties, which caused an incorrect class code for vfio-user devices.

Fixes a59d06305fff ("vfio/pci: Introduce x-pci-class-code option")
---
  hw/vfio-user/pci.c | 2 ++
  1 file changed, 2 insertions(+)
hw/vfio-user/pci.c +0 -0
index be71c77729..dfaa89498d 100644

hw/vfio-user/pci.c static const Property vfio_user_pci_dev_properties[] = { · line 413

Quoted 8 lines
hw/vfio-user/pci.c +2 -0
@@ -406,6 +406,8 @@ static const Property vfio_user_pci_dev_properties[] = {
                         sub_vendor_id, PCI_ANY_ID),
      DEFINE_PROP_UINT32("x-pci-sub-device-id", VFIOPCIDevice,
                         sub_device_id, PCI_ANY_ID),
+    DEFINE_PROP_UINT32("x-pci-class-code", VFIOPCIDevice,
+                       class_code, PCI_ANY_ID),
      DEFINE_PROP_BOOL("x-send-queued", VFIOUserPCIDevice, send_queued, false),
      DEFINE_PROP_UINT32("x-msg-timeout", VFIOUserPCIDevice, wait_time, 5000),
      DEFINE_PROP_BOOL("x-no-posted-writes", VFIOUserPCIDevice, no_post, false),

Applied to vfio-next.

Thanks,

C.