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

Re: [Xen-devel] [PATCH v8 05/13] libxl: Load guest BIOS from file



On 8/18/16 10:13 AM, Wei Liu wrote:

>  
> +    if (info->device_model_version == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
> +        if (info->u.hvm.system_firmware) {
> +            bios_filename = info->u.hvm.system_firmware;
> +        } else {
> +            switch (info->u.hvm.bios) {
> +            case LIBXL_BIOS_TYPE_SEABIOS:
> +                bios_filename = libxl__seabios_path();
> +                break;
> +            case LIBXL_BIOS_TYPE_OVMF:
> +                bios_filename = libxl__ovmf_path();
> +                break;
> +            case LIBXL_BIOS_TYPE_ROMBIOS:
> +            default:
> +                abort();

Wei,

Please consider another solution. I've been trying to use libxl from
Rust and the calls to abort() are just really hard to deal with. I know
libxl has 50+ calls currently but let's work on reducing these as much
as possible so that its possible to consume libxl in other languages.

abort() is just bad form for libraries because you don't give the caller
the ability to catch the error and handle it appropriately (which could
be as simple as displaying it to the user or potentially work around the
issue.

I know you and Anthony have gone through 8 revisions but please consider
changing this. I'm sorry for not speaking up sooner.
-- 
Doug Goldstein

Attachment: signature.asc
Description: OpenPGP digital signature

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

 


Rackspace

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