]> xenbits.xensource.com Git - xen.git/commitdiff
xl: Do not ignore unparseable PCI BDFs
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 15 Jun 2015 15:18:38 +0000 (16:18 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 16 Jul 2015 15:58:59 +0000 (16:58 +0100)
If xlu_pci_parse_bdf fails, abandon the domain creation, rather than
blundering on.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
---
v2: Print the offending supposed-BDF too.

tools/libxl/xl_cmdimpl.c

index a08c264f883400ff029096ef30f9112203bce316..5ab4e164725fae94ce6b00ae9601d9f512cb6c9b 100644 (file)
@@ -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);