File: hw-vfio-user-add-x-pci-class-code.patch

package info (click to toggle)
qemu 1%3A10.1.0%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 416,048 kB
  • sloc: ansic: 4,763,284; pascal: 115,134; python: 105,712; asm: 68,689; sh: 53,146; makefile: 27,519; perl: 18,864; cpp: 11,442; xml: 3,629; objc: 2,877; yacc: 2,505; php: 1,299; tcl: 1,296; lex: 1,110; sql: 71; awk: 43; sed: 35; javascript: 7
file content (39 lines) | stat: -rw-r--r-- 1,693 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From: John Levon <john.levon@nutanix.com>
Date: Wed, 27 Aug 2025 20:08:10 +0100
Subject: hw/vfio-user: add x-pci-class-code
Forwarded: not-needed
Origin: upstream, https://gitlab.com/qemu-project/qemu/-/commit/1b50621881241ac5bc75ae7f8aa4c278ada8a668
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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")
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250827190810.1645340-1-john.levon@nutanix.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
(cherry picked from commit 1b50621881241ac5bc75ae7f8aa4c278ada8a668)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/vfio-user/pci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/vfio-user/pci.c b/hw/vfio-user/pci.c
index be71c77729..dfaa89498d 100644
--- a/hw/vfio-user/pci.c
+++ b/hw/vfio-user/pci.c
@@ -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),
-- 
2.47.3