From: Igor Druzhinin <igor.druzhinin@citrix.com>
To: Ian Jackson <ian.jackson@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Paul Durrant <xadimgnik@gmail.com>, "wl@xen.org" <wl@xen.org>,
Andrew Cooper <Andrew.Cooper3@citrix.com>
Subject: Re: [XEN PATCH for-4.14] tools/xen-ucode: fix error code propagation of microcode load operation
Date: Fri, 12 Jun 2020 18:16:01 +0100 [thread overview]
Message-ID: <2d885485-c00f-9938-33fc-1f20d084b259@citrix.com> (raw)
In-Reply-To: <24291.45845.782250.165305@mariner.uk.xensource.com>
On 12/06/2020 17:53, Ian Jackson wrote:
> Igor Druzhinin writes ("[PATCH] tools/xen-ucode: fix error code propagation of microcode load operation"):
>> Otherwise it's impossible to know the reason for a fault or blob rejection
>> inside the automation.
> ...
>> fprintf(stderr, "Failed to update microcode. (err: %s)\n",
>> strerror(errno));
>
> This part is fine.
>
>> + ret = errno;
>> xc_interface_close(xch);
> ...
>> }
>> close(fd);
>>
>> - return 0;
>> + return ret;
>
> Unfortunately I don't think this is right. errno might not fit into a
> return value.
errno codes that Xen return are all lower than 127. It fits perfectly fine.
> Returning nonzero on microcode loading error would
> definitely be right, but ...
>
> ... oh I have just read the rest of this file.
>
> I think what is missing here is simply `return errno' (and the braces)
> There is no need to call xc_interface_close, or munmap, if we are
> about to exit.
Probably but that is identical to what was suggested.
Cleaning resource is just a nice thing to do although unnecessary.
Can change to just "return errno" if that's what you'd prefer.
> I think fixing the lost error return is 4.14 material, so I have
> added that to the subject line.
>
> Paul, would you Release-ack a patch that replaced every `return errno'
> with (say) exit(12) ?
That would again conceal real return code from automation.
Igor
next prev parent reply other threads:[~2020-06-12 17:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-12 16:44 [PATCH] tools/xen-ucode: fix error code propagation of microcode load operation Igor Druzhinin
2020-06-12 16:53 ` [XEN PATCH for-4.14] " Ian Jackson
2020-06-12 17:13 ` Paul Durrant
2020-06-15 11:13 ` Ian Jackson
2020-06-12 17:16 ` Igor Druzhinin [this message]
2020-06-15 11:17 ` Ian Jackson
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=2d885485-c00f-9938-33fc-1f20d084b259@citrix.com \
--to=igor.druzhinin@citrix.com \
--cc=Andrew.Cooper3@citrix.com \
--cc=ian.jackson@citrix.com \
--cc=wl@xen.org \
--cc=xadimgnik@gmail.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).