All of lore.kernel.org
 help / color / mirror / Atom feed
* [BACKPORT for 4.4/4.3] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem
@ 2015-01-14 13:06 Julien Grall
  2015-01-19 17:47 ` Ian Jackson
  0 siblings, 1 reply; 2+ messages in thread
From: Julien Grall @ 2015-01-14 13:06 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Julien Grall, Ian Jackson, Ian Campbell, Stefano Stabellini

If we fail to give the access, the domain will unlikely work correctly.
So we should bail out at the first error.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>

(Based on commit 7070eec417934360bf3aed434191246dfe4f8091)

---
The original patch https://patches.linaro.org/42911/ doesn't applied on
Xen 4.4 and Xen 4.3.
---
 tools/libxl/libxl_create.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index a604cd8..e3350d5 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1068,6 +1068,7 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
                  "failed give dom%d access to ioports %"PRIx32"-%"PRIx32,
                  domid, io->first, io->first + io->number - 1);
             ret = ERROR_FAIL;
+            goto error_out;
         }
     }
 
@@ -1083,6 +1084,7 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
         if (ret < 0) {
             LOGE(ERROR, "failed give dom%d access to irq %d", domid, irq);
             ret = ERROR_FAIL;
+            goto error_out;
         }
     }
 
@@ -1099,6 +1101,7 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
                  "failed give dom%d access to iomem range %"PRIx64"-%"PRIx64,
                  domid, io->start, io->start + io->number - 1);
             ret = ERROR_FAIL;
+            goto error_out;
         }
     }
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [BACKPORT for 4.4/4.3] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem
  2015-01-14 13:06 [BACKPORT for 4.4/4.3] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem Julien Grall
@ 2015-01-19 17:47 ` Ian Jackson
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Jackson @ 2015-01-19 17:47 UTC (permalink / raw)
  To: Julien Grall; +Cc: xen-devel, Wei Liu, Ian Campbell, Stefano Stabellini

Julien Grall writes ("[BACKPORT for 4.4/4.3] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem"):
> If we fail to give the access, the domain will unlikely work correctly.
> So we should bail out at the first error.
> 
> Signed-off-by: Julien Grall <julien.grall@linaro.org>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> 
> (Based on commit 7070eec417934360bf3aed434191246dfe4f8091)

Thanks.  I have applied this to 4.4 and 4.3, and also cherry-picked
the original onto 4.5.

Ian.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-19 17:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-14 13:06 [BACKPORT for 4.4/4.3] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem Julien Grall
2015-01-19 17:47 ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.