[libvirt] [PATCH] qemu: Explain why mdevs are assumed to be PCI Express

Andrea Bolognani posted 1 patch 6 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1497261613-25413-1-git-send-email-abologna@redhat.com
src/qemu/qemu_domain_address.c | 5 +++++
1 file changed, 5 insertions(+)
[libvirt] [PATCH] qemu: Explain why mdevs are assumed to be PCI Express
Posted by Andrea Bolognani 6 years, 10 months ago
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 src/qemu/qemu_domain_address.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 2106b34..b5b863f 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -645,6 +645,11 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
             return pcieFlags;
         }
 
+        /* mdevs don't have corresponding files in /sys that we can poke to
+         * try and figure out whether they are legacy PCI or PCI Express, so
+         * the logic below would never work; instead, we just go ahead and
+         * assume they're PCI Express. This is a very reasonable assumption,
+         * as all current mdev-capable devices are indeed PCI Express */
         if (hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV)
             return pcieFlags;
 
-- 
2.7.5

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: Explain why mdevs are assumed to be PCI Express
Posted by Erik Skultety 6 years, 10 months ago
On Mon, Jun 12, 2017 at 06:00:13PM +0800, Andrea Bolognani wrote:
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  src/qemu/qemu_domain_address.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
> index 2106b34..b5b863f 100644
> --- a/src/qemu/qemu_domain_address.c
> +++ b/src/qemu/qemu_domain_address.c
> @@ -645,6 +645,11 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
>              return pcieFlags;
>          }
>
> +        /* mdevs don't have corresponding files in /sys that we can poke to
> +         * try and figure out whether they are legacy PCI or PCI Express, so
> +         * the logic below would never work; instead, we just go ahead and
> +         * assume they're PCI Express. This is a very reasonable assumption,
> +         * as all current mdev-capable devices are indeed PCI Express */
>          if (hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV)
>              return pcieFlags;
>
> --
> 2.7.5
>

ACK

Erik

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list