From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xen.org
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
Ian Jackson <ian.jackson@citrix.com>,
Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH v2 1/2] libxl: Fail domain creation if pci assignment fails
Date: Tue, 4 Mar 2014 14:33:40 +0000 [thread overview]
Message-ID: <1393943621-9713-1-git-send-email-george.dunlap@eu.citrix.com> (raw)
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
next reply other threads:[~2014-03-04 14:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-04 14:33 George Dunlap [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1393943621-9713-1-git-send-email-george.dunlap@eu.citrix.com \
--to=george.dunlap@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).