xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] libxl: Fail domain creation if pci assignment fails
@ 2014-03-04 14:33 George Dunlap
  2014-03-04 14:33 ` [PATCH v2 2/2] xl: Add "seize" option to PCI devices George Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: George Dunlap @ 2014-03-04 14:33 UTC (permalink / raw)
  To: xen-devel; +Cc: George Dunlap, Ian Jackson, Ian Campbell

Actually pay attention to the return value of libxl__device_pci_add.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
---
CC: Ian Jackson <ian.jackson@citrix.com>
CC: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_create.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index a604cd8..53e7cb6 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1262,8 +1262,14 @@ static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
         goto error_out;
     }
 
-    for (i = 0; i < d_config->num_pcidevs; i++)
-        libxl__device_pci_add(gc, domid, &d_config->pcidevs[i], 1);
+    for (i = 0; i < d_config->num_pcidevs; i++) {
+        ret = libxl__device_pci_add(gc, domid, &d_config->pcidevs[i], 1);
+        if (ret < 0) {
+            LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                       "libxl_device_pci_add failed: %d", ret);
+            goto error_out;
+        }
+    }
 
     if (d_config->num_pcidevs > 0) {
         ret = libxl__create_pci_backend(gc, domid, d_config->pcidevs,
-- 
1.7.9.5

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

end of thread, other threads:[~2014-03-10 12:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-04 14:33 [PATCH v2 1/2] libxl: Fail domain creation if pci assignment fails George Dunlap
2014-03-04 14:33 ` [PATCH v2 2/2] xl: Add "seize" option to PCI devices George Dunlap
2014-03-10 12:11   ` Ian Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).