[PATCH v2 17/17] tools/init-dom0less: Continue on error

Jason Andryuk posted 17 patches 3 months, 2 weeks ago
[PATCH v2 17/17] tools/init-dom0less: Continue on error
Posted by Jason Andryuk 3 months, 2 weeks ago
An error on one domain doesn't apply to others.  Continue the loop over
all domains if init_domain() fails.

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/helpers/init-dom0less.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c
index 4336e0f418..bd213c5ccd 100644
--- a/tools/helpers/init-dom0less.c
+++ b/tools/helpers/init-dom0less.c
@@ -377,7 +377,6 @@ int main(int argc, char **argv)
         rc = init_domain(xsh, xch, xfh, &info[i]);
         if (rc < 0) {
             fprintf(stderr, "init_domain failed.\n");
-            goto out;
         }
     }
 out:
-- 
2.50.0
Re: [PATCH v2 17/17] tools/init-dom0less: Continue on error
Posted by Stefano Stabellini 3 months, 2 weeks ago
On Wed, 16 Jul 2025, Jason Andryuk wrote:
> An error on one domain doesn't apply to others.  Continue the loop over
> all domains if init_domain() fails.
> 
> Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
> ---
>  tools/helpers/init-dom0less.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c
> index 4336e0f418..bd213c5ccd 100644
> --- a/tools/helpers/init-dom0less.c
> +++ b/tools/helpers/init-dom0less.c
> @@ -377,7 +377,6 @@ int main(int argc, char **argv)
>          rc = init_domain(xsh, xch, xfh, &info[i]);
>          if (rc < 0) {
>              fprintf(stderr, "init_domain failed.\n");
> -            goto out;
 
init_domain doesn't always return < 0 on error

That said, this change is still good.

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>