[PATCH 2/2] hw/vfio/iommufd.c: report hint to user when vfio-dev/vfio*/dev is missing

Pierrick Bouvier posted 2 patches 2 weeks, 5 days ago
Maintainers: Yi Liu <yi.l.liu@intel.com>, Eric Auger <eric.auger@redhat.com>, Zhenzhong Duan <zhenzhong.duan@intel.com>, Alex Williamson <alex@shazbot.org>, "Cédric Le Goater" <clg@redhat.com>
There is a newer version of this series
[PATCH 2/2] hw/vfio/iommufd.c: report hint to user when vfio-dev/vfio*/dev is missing
Posted by Pierrick Bouvier 2 weeks, 5 days ago
Give a hint about missing kernel config CONFIG_VFIO_DEVICE_CDEV.

Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 hw/vfio/iommufd.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
index 131612eb836..3e33dfbb356 100644
--- a/hw/vfio/iommufd.c
+++ b/hw/vfio/iommufd.c
@@ -274,7 +274,10 @@ static int iommufd_cdev_getfd(const char *sysfs_path, Error **errp)
     }
 
     if (!g_file_get_contents(vfio_dev_path, &contents, &length, NULL)) {
-        error_setg(errp, "failed to load \"%s\"", vfio_dev_path);
+        error_setg(errp,
+                   "failed to load \"%s\""
+                   " (is your kernel config missing CONFIG_VFIO_DEVICE_CDEV?)",
+                   vfio_dev_path);
         goto out_close_dir;
     }
 
-- 
2.47.3
Re: [PATCH 2/2] hw/vfio/iommufd.c: report hint to user when vfio-dev/vfio*/dev is missing
Posted by Yi Liu 2 weeks, 5 days ago
On 3/18/26 06:57, Pierrick Bouvier wrote:
> Give a hint about missing kernel config CONFIG_VFIO_DEVICE_CDEV.
> 
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
>   hw/vfio/iommufd.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
> index 131612eb836..3e33dfbb356 100644
> --- a/hw/vfio/iommufd.c
> +++ b/hw/vfio/iommufd.c
> @@ -274,7 +274,10 @@ static int iommufd_cdev_getfd(const char *sysfs_path, Error **errp)
>       }
>   
>       if (!g_file_get_contents(vfio_dev_path, &contents, &length, NULL)) {
> -        error_setg(errp, "failed to load \"%s\"", vfio_dev_path);
> +        error_setg(errp,
> +                   "failed to load \"%s\""
> +                   " (is your kernel config missing CONFIG_VFIO_DEVICE_CDEV?)",
> +                   vfio_dev_path);
>           goto out_close_dir;
>       }
>   

Reviewed-by: Yi Liu <yi.l.liu@intel.com>
RE: [PATCH 2/2] hw/vfio/iommufd.c: report hint to user when vfio-dev/vfio*/dev is missing
Posted by Duan, Zhenzhong 2 weeks, 5 days ago

>-----Original Message-----
>From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

>Subject: [PATCH 2/2] hw/vfio/iommufd.c: report hint to user when vfio-
>dev/vfio*/dev is missing
>
>Give a hint about missing kernel config CONFIG_VFIO_DEVICE_CDEV.
>
>Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>

Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>

Zhenzhong
Re: [PATCH 2/2] hw/vfio/iommufd.c: report hint to user when vfio-dev/vfio*/dev is missing
Posted by Cédric Le Goater 2 weeks, 5 days ago
On 3/17/26 23:57, Pierrick Bouvier wrote:
> Give a hint about missing kernel config CONFIG_VFIO_DEVICE_CDEV.
> 
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
>   hw/vfio/iommufd.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
> index 131612eb836..3e33dfbb356 100644
> --- a/hw/vfio/iommufd.c
> +++ b/hw/vfio/iommufd.c
> @@ -274,7 +274,10 @@ static int iommufd_cdev_getfd(const char *sysfs_path, Error **errp)
>       }
>   
>       if (!g_file_get_contents(vfio_dev_path, &contents, &length, NULL)) {
> -        error_setg(errp, "failed to load \"%s\"", vfio_dev_path);
> +        error_setg(errp,
> +                   "failed to load \"%s\""
> +                   " (is your kernel config missing CONFIG_VFIO_DEVICE_CDEV?)",
> +                   vfio_dev_path);
>           goto out_close_dir;
>       }
>   

Reviewed-by: Cédric Le Goater <clg@redhat.com>

Thanks,

C.


Re: [PATCH 2/2] hw/vfio/iommufd.c: report hint to user when vfio-dev/vfio*/dev is missing
Posted by Philippe Mathieu-Daudé 2 weeks, 5 days ago
On 17/3/26 23:57, Pierrick Bouvier wrote:
> Give a hint about missing kernel config CONFIG_VFIO_DEVICE_CDEV.
> 
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
>   hw/vfio/iommufd.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>