[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/6 v2] xl: Do not ignore unparseable PCI BDFs



On Thu, Jul 16, 2015 at 04:47:55PM +0100, Ian Jackson wrote:
> [ 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 <Ian.Jackson@xxxxxxxxxxxxx>
> CC: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>

> ---
> 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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.