From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [PATCH 1/6 v2] xl: Do not ignore unparseable PCI BDFs Date: Thu, 16 Jul 2015 16:47:55 +0100 Message-ID: <1437061675-21113-1-git-send-email-ian.jackson@eu.citrix.com> References: <559BFBDB.6040508@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <559BFBDB.6040508@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xensource.com Cc: Ian Jackson , Wei Liu , Ian Campbell , Andrew Cooper List-Id: xen-devel@lists.xenproject.org [ resending just 1/6 rather than the others as well ] If xlu_pci_parse_bdf fails, abandon the domain creation, rather than blundering on. Signed-off-by: Ian Jackson CC: Andrew Cooper --- v2: Print the offending supposed-BDF too. --- tools/libxl/xl_cmdimpl.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index a08c264..5ab4e16 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1945,8 +1945,14 @@ skip_vfb: pcidev->power_mgmt = pci_power_mgmt; pcidev->permissive = pci_permissive; pcidev->seize = pci_seize; - if (!xlu_pci_parse_bdf(config, pcidev, buf)) - d_config->num_pcidevs++; + e = xlu_pci_parse_bdf(config, pcidev, buf); + if (e) { + fprintf(stderr, + "unable to parse PCI BDF `%s' for passthrough\n", + buf); + exit(-e); + } + d_config->num_pcidevs++; } if (d_config->num_pcidevs && c_info->type == LIBXL_DOMAIN_TYPE_PV) libxl_defbool_set(&b_info->u.pv.e820_host, true); -- 1.7.10.4