[PATCH 1/2] i386/sev: Fix error message in sev_get_capabilities()

Michal Privoznik posted 2 patches 5 months ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
[PATCH 1/2] i386/sev: Fix error message in sev_get_capabilities()
Posted by Michal Privoznik 5 months ago
When a custom path is provided to sev-guest object and opening
the path fails an error message is reported. But the error
message still mentions DEFAULT_SEV_DEVICE ("/dev/sev") instead of
the custom path.

Fixes: 16dcf200dc951c1cde3e5b442457db5f690b8cf0
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 target/i386/sev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/i386/sev.c b/target/i386/sev.c
index 30b83f1d77..8c350d42b0 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -595,7 +595,7 @@ static SevCapability *sev_get_capabilities(Error **errp)
     fd = open(sev_device, O_RDWR);
     if (fd < 0) {
         error_setg_errno(errp, errno, "SEV: Failed to open %s",
-                         DEFAULT_SEV_DEVICE);
+                         sev_device);
         g_free(sev_device);
         return NULL;
     }
-- 
2.44.2
Re: [PATCH 1/2] i386/sev: Fix error message in sev_get_capabilities()
Posted by Philippe Mathieu-Daudé 5 months ago
On 24/6/24 10:52, Michal Privoznik wrote:
> When a custom path is provided to sev-guest object and opening
> the path fails an error message is reported. But the error
> message still mentions DEFAULT_SEV_DEVICE ("/dev/sev") instead of
> the custom path.
> 
> Fixes: 16dcf200dc951c1cde3e5b442457db5f690b8cf0
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>   target/i386/sev.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

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