[PATCH 1/8] ch: report response message instead of just code

Purna Pavan Chandra posted 8 patches 2 months, 2 weeks ago
There is a newer version of this series
[PATCH 1/8] ch: report response message instead of just code
Posted by Purna Pavan Chandra 2 months, 2 weeks ago
The response message from CH for vm.add-net api will be more helpful in
debugging. Hence, log the message instead of just response code.

Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com>
---
 src/ch/ch_process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ch/ch_process.c b/src/ch/ch_process.c
index 48190a1273..6f99fec900 100644
--- a/src/ch/ch_process.c
+++ b/src/ch/ch_process.c
@@ -665,7 +665,7 @@ chProcessAddNetworkDevices(virCHDriver *driver,
         }
         if (http_res != 204 && http_res != 200) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Unexpected response from CH: %1$d"), http_res);
+                           _("Unexpected response from CH: %1$s"), response);
             return -1;
         }
     }
-- 
2.34.1
Re: [PATCH 1/8] ch: report response message instead of just code
Posted by Praveen K Paladugu 2 months, 2 weeks ago

On 6/28/2024 2:26 AM, Purna Pavan Chandra wrote:
> The response message from CH for vm.add-net api will be more helpful in
> debugging. Hence, log the message instead of just response code.
> 
> Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com>
> ---
>   src/ch/ch_process.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/ch/ch_process.c b/src/ch/ch_process.c
> index 48190a1273..6f99fec900 100644
> --- a/src/ch/ch_process.c
> +++ b/src/ch/ch_process.c
> @@ -665,7 +665,7 @@ chProcessAddNetworkDevices(virCHDriver *driver,
>           }
>           if (http_res != 204 && http_res != 200) {
>               virReportError(VIR_ERR_INTERNAL_ERROR,
> -                           _("Unexpected response from CH: %1$d"), http_res);
> +                           _("Unexpected response from CH: %1$s"), response);
Does cloud-hypervisor provide any additional information related to the 
failure? From what I remember cloud-hypervisor only provides HTTP 
response code in case of failures.


>               return -1;
>           }
>       }

-- 
Regards,
Praveen