From 78b7156840b421becd45c13c0ff4da57c314b4a5 Mon Sep 17 00:00:00 2001
From: jiangdongxu1 <jiangdongxu1@huawei.com>
Date: Wed, 13 Mar 2024 15:23:57 +0800
Subject: [PATCH] vdpa: return pcieFlags when calculate vdpa passthrough
 devices.

Signed-off-by: jiangdongxu1 <jiangdongxu1@huawei.com>
---
 src/qemu/qemu_domain_address.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 6649553486..ce40fdc928 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -825,6 +825,13 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
         if (hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV)
             return pcieFlags;
 
+        /*
+         * vDPA passthrough is currently only support on arm architechture.
+         * Thus, we just assume it's PCI Express.
+         */
+        if (hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA)
+            return pcieFlags;
+
         /* according to pbonzini, from the guest PoV vhost-scsi devices
          * are the same as virtio-scsi, so they should follow virtio logic
          */
-- 
2.27.0

