xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ross Lagerwall <ross.lagerwall@citrix.com>
Cc: xen-devel@lists.xenproject.org, wei.liu2@citrix.com,
	ian.jackson@eu.citrix.com
Subject: Re: [PATCH v1 3/3] xen-livepatch: If hypervisor is not compiled with Livepatching
Date: Thu, 22 Sep 2016 06:12:14 -0400	[thread overview]
Message-ID: <20160922101213.GC5975@localhost.localdomain> (raw)
In-Reply-To: <d68634fd-9b0b-20e0-9d3f-c6aa8cb32287@citrix.com>

On Thu, Sep 22, 2016 at 08:25:33AM +0100, Ross Lagerwall wrote:
> On 09/21/2016 08:20 PM, Konrad Rzeszutek Wilk wrote:
> > . print a better error code.
> > 
> > Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > ---
> >  tools/misc/xen-livepatch.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tools/misc/xen-livepatch.c b/tools/misc/xen-livepatch.c
> > index 2de04c0..f11e71f07f 100644
> > --- a/tools/misc/xen-livepatch.c
> > +++ b/tools/misc/xen-livepatch.c
> > @@ -100,8 +100,11 @@ static int list_func(int argc, char *argv[])
> >          rc = xc_livepatch_list(xch, MAX_LEN, idx, info, name, len, &done, &left);
> >          if ( rc )
> >          {
> > -            fprintf(stderr, "Failed to list %d/%d: %d(%s)!\n",
> > -                    idx, left, errno, strerror(errno));
> > +            if ( errno == ENOSYS )
> > +                fprintf(stderr, "Hypervisor compiled without Xen Livepatching!\n");
> > +            else
> > +                fprintf(stderr, "Failed to list %d/%d: %d(%s)!\n",
> > +                        idx, left, errno, strerror(errno));
> >              break;
> >          }
> >          if ( !idx )
> > 
> 
> You should save errno since you have an fprintf before you check it.

I am missing something.

Why would fprintf mess up 'errno' ?
> 
> Also, it would be good to do the same check for the first xc_livepatch_get
> in action_func() and for the xc_livepatch_upload in upload_func.

<nods>
> 
> -- 
> Ross Lagerwall

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

  reply	other threads:[~2016-09-22 10:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21 19:20 [PATCH v1] xen-livepatch fixes for Xen 4.8 Konrad Rzeszutek Wilk
2016-09-21 19:20 ` [PATCH v1 1/3] xen-livepatch: Remove the 'test' part Konrad Rzeszutek Wilk
2016-09-22  7:20   ` Ross Lagerwall
2016-09-21 19:20 ` [PATCH v1 2/3] xen-livepatch: Print the header _after_ the first livepatch hypercall Konrad Rzeszutek Wilk
2016-09-22  7:21   ` Ross Lagerwall
2016-09-21 19:20 ` [PATCH v1 3/3] xen-livepatch: If hypervisor is not compiled with Livepatching Konrad Rzeszutek Wilk
2016-09-22  7:25   ` Ross Lagerwall
2016-09-22 10:12     ` Konrad Rzeszutek Wilk [this message]
2016-09-22 10:34       ` Ian Jackson
2016-09-22 10:36         ` Ian Jackson
2016-09-22 10:41           ` Konrad Rzeszutek Wilk
2016-09-22 10:37       ` Ross Lagerwall

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=20160922101213.GC5975@localhost.localdomain \
    --to=konrad.wilk@oracle.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=ross.lagerwall@citrix.com \
    --cc=wei.liu2@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 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).