All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Anthony PERARD <anthony.perard@citrix.com>,
	xen-devel@lists.xenproject.org, qemu-devel@nongnu.org,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH 1/2] xen: fix usage of ENODATA
Date: Tue, 15 Apr 2014 17:45:39 +0100	[thread overview]
Message-ID: <534D6233.8060906@citrix.com> (raw)
In-Reply-To: <534D5E24.7030508@citrix.com>

On 15/04/14 17:28, Roger Pau Monné wrote:
> On 15/04/14 18:15, Anthony PERARD wrote:
>> On Tue, Apr 15, 2014 at 10:33:08AM +0200, Roger Pau Monne wrote:
>>> ENODATA doesn't exist on FreeBSD, so ENODATA errors returned by the
>>> hypervisor are translated to ENOENT.
>>>
>>> Also, the error code is returned in errno if the call returns -1, so
>>> compare the error code with the value in errno instead of the value
>>> returned by the function.
>> But in xenctrl.h, the comment on the prototype of the function says that
>> it return the error code, there is nothing about errno been updated. So
>> I think rc should still be check for the error code instead of errno.
> Then I think the comment is wrong (or I'm missing something),
> xc_hvm_track_dirty_vram return code comes from do_xen_hypercall, which
> is basically a wrapper around ioctl, and according to the ioctl man page
> (both Linux and FreeBSD versions):
>
> "On error, -1 is returned, and errno is set appropriately."
>
> Roger.

The only thing you can safely assume about libxc and error values is
that there is no consistency whatsoever (and in some cases a completely
inability to determine success or failure from the return value).  This
is acknowledged as needing to be fixed.

The only way you have of actually working out the error semantics are to
follow the function you care about all the way to the ioctl.

~Andrew

      parent reply	other threads:[~2014-04-15 16:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1397550789-43232-1-git-send-email-roger.pau@citrix.com>
2014-04-15  8:33 ` [PATCH 1/2] xen: fix usage of ENODATA Roger Pau Monne
2014-04-15  8:33 ` [PATCH 2/2] tap-bsd: implement a FreeBSD only version of tap_open Roger Pau Monne
     [not found] ` <1397550789-43232-2-git-send-email-roger.pau@citrix.com>
2014-04-15 12:33   ` [PATCH 1/2] xen: fix usage of ENODATA Egger, Christoph
2014-04-16 14:31     ` Roger Pau Monné
2014-04-15 16:15   ` Anthony PERARD
2014-04-15 16:28     ` Roger Pau Monné
     [not found]     ` <534D5E24.7030508@citrix.com>
2014-04-15 16:45       ` Andrew Cooper [this message]

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=534D6233.8060906@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=qemu-devel@nongnu.org \
    --cc=roger.pau@citrix.com \
    --cc=stefano.stabellini@eu.citrix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.