From: Wei Liu <wei.liu2@citrix.com>
To: Doug Goldstein <cardoe@cardoe.com>
Cc: Anthony PERARD <anthony.perard@citrix.com>,
Xen-devel <xen-devel@lists.xenproject.org>,
Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH v8 05/13] libxl: Load guest BIOS from file
Date: Wed, 24 Aug 2016 10:16:15 +0100 [thread overview]
Message-ID: <20160824091614.GB20641@citrix.com> (raw)
In-Reply-To: <0132585e-ee1f-3486-27bd-b2356d0323e3@cardoe.com>
On Tue, Aug 23, 2016 at 04:00:24PM -0400, Doug Goldstein wrote:
> 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.
As said, the abort() in internal function marks an impossible situation
to get into -- much like BUG_ON in hypervisor. I would expect the error
to be handled in some other places in libxl. In this particular
instance, I haven't checked, but if there is no such check elsewhere, I
will either fix it here or somewhere else appropriate.
Furthermore, I'm not averse to systematically removing abort(), but I
would like to at least have a rough idea how upper layer would want to
handle that, and what is the implication on other parts of libxl.
Wei.
> --
> Doug Goldstein
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-08-24 9:16 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-18 14:13 [PATCH v8 00/13] Load BIOS via toolstack instead of been embedded in hvmloader Wei Liu
2016-08-18 14:13 ` [PATCH v8 01/13] libxc: Rework extra module initialisation Wei Liu
2016-08-18 14:13 ` [PATCH v8 02/13] libxc: Prepare a start info structure for hvmloader Wei Liu
2016-08-18 14:13 ` [PATCH v8 03/13] configure: #define SEABIOS_PATH and OVMF_PATH Wei Liu
2016-08-18 14:13 ` [PATCH v8 04/13] firmware/makefile: install BIOS blob Wei Liu
2016-08-18 14:13 ` [PATCH v8 05/13] libxl: Load guest BIOS from file Wei Liu
2016-08-19 14:43 ` Andrew Cooper
2016-08-22 13:13 ` Wei Liu
2016-08-22 13:26 ` Andrew Cooper
2016-08-22 14:26 ` Wei Liu
2016-08-22 15:05 ` [PATCH 0/2] Fix issue with {OVMF,SEABIOS}_PATH Wei Liu
2016-08-22 15:05 ` [PATCH 1/2] tools: only define {OVMF, SEABIOS}_PATH when they are enabled Wei Liu
2016-08-22 15:05 ` [PATCH 2/2] libxl: only return {OVMF, SEABIOS}_PATH if available Wei Liu
2016-08-23 9:37 ` [PATCH 0/2] Fix issue with {OVMF,SEABIOS}_PATH Andrew Cooper
2016-08-24 11:38 ` Ian Jackson
2016-08-24 11:59 ` Wei Liu
2016-08-22 15:09 ` [PATCH v8 05/13] libxl: Load guest BIOS from file Andrew Cooper
2016-08-22 15:13 ` Wei Liu
2016-08-23 20:00 ` Doug Goldstein
2016-08-24 9:16 ` Wei Liu [this message]
2016-08-18 14:13 ` [PATCH v8 06/13] hvmloader: Grab the hvm_start_info pointer Wei Liu
2016-08-18 14:13 ` [PATCH v8 07/13] hvmloader: Locate the BIOS blob Wei Liu
2016-08-18 15:39 ` Jan Beulich
2016-08-18 15:48 ` Andrew Cooper
2016-08-18 15:51 ` Wei Liu
2016-08-18 14:13 ` [PATCH v8 08/13] hvmloader: Load SeaBIOS from hvm_start_info modules Wei Liu
2016-08-18 14:13 ` [PATCH v8 09/13] hvmloader: Load OVMF from modules Wei Liu
2016-08-18 14:13 ` [PATCH v8 10/13] hvmloader: bios->bios_load() now needs to be defined Wei Liu
2016-08-18 14:13 ` [PATCH v8 11/13] hvmloader: Always build-in SeaBIOS and OVMF loader Wei Liu
2016-08-18 14:13 ` [PATCH v8 12/13] configure: do not depend on SEABIOS_PATH or OVMF_PATH Wei Liu
2016-08-18 14:13 ` [PATCH v8 13/13] docs/misc/hvmlite: Point to the canonical definition of hvm_start_info Wei Liu
2016-08-18 16:23 ` [PATCH v8 00/13] Load BIOS via toolstack instead of been embedded in hvmloader Wei Liu
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=20160824091614.GB20641@citrix.com \
--to=wei.liu2@citrix.com \
--cc=anthony.perard@citrix.com \
--cc=cardoe@cardoe.com \
--cc=xen-devel@lists.xenproject.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).