From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Pawel Wieczorkiewicz <wipawel@amazon.de>
Cc: Wei Liu <wl@xen.org>, Ian Jackson <ian.jackson@eu.citrix.com>,
xen-devel@lists.xen.org, mpohlack@amazon.de, amazein@amazon.de,
xen-devel@lists.xenproject.org
Subject: Re: [Xen-devel] [livepatch: independ. modules v3 3/3] python: Add XC binding for Xen build ID
Date: Tue, 20 Aug 2019 15:00:37 +0200 [thread overview]
Message-ID: <20190820130037.GF1457@mail-itl> (raw)
In-Reply-To: <20190820125108.104102-1-wipawel@amazon.de>
[-- Attachment #1.1: Type: text/plain, Size: 2653 bytes --]
On Tue, Aug 20, 2019 at 12:51:08PM +0000, Pawel Wieczorkiewicz wrote:
> Extend the list of xc() object methods with additional one to display
> Xen's buildid. The implementation follows the libxl implementation
> (e.g. max buildid size assumption being XC_PAGE_SIZE minus
> sizeof(buildid->len)).
>
> Signed-off-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
> Reviewed-by: Martin Mazein <amazein@amazon.de>
> Reviewed-by: Andra-Irina Paraschiv <andraprs@amazon.com>
> Reviewed-by: Norbert Manthey <nmanthey@amazon.de>
Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> ---
> v3:
> * Instead of allocating XC_PAGE_SIZE plus size of the len field,
> allocate one XC_PAGE_SIZE for the whole buildid struct.
> * Modify commit message to reflect the above change.
> v2:
> * No code change
> * Adding maintainers
> ---
> tools/python/xen/lowlevel/xc/xc.c | 27 +++++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
>
> diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
> index 522cbe3b9c..7ed4a253de 100644
> --- a/tools/python/xen/lowlevel/xc/xc.c
> +++ b/tools/python/xen/lowlevel/xc/xc.c
> @@ -1211,6 +1211,26 @@ out:
> return ret_obj ? ret_obj : pyxc_error_to_exception(self->xc_handle);
> }
>
> +static PyObject *pyxc_xenbuildid(XcObject *self)
> +{
> + xen_build_id_t *buildid;
> + int i, r;
> + char *str;
> +
> + buildid = alloca(XC_PAGE_SIZE);
> + buildid->len = XC_PAGE_SIZE - sizeof(*buildid);
> +
> + r = xc_version(self->xc_handle, XENVER_build_id, buildid);
> + if ( r <= 0 )
> + return pyxc_error_to_exception(self->xc_handle);
> +
> + str = alloca((r * 2) + 1);
> + for ( i = 0; i < r; i++ )
> + snprintf(&str[i * 2], 3, "%02hhx", buildid->buf[i]);
> +
> + return Py_BuildValue("s", str);
> +}
> +
> static PyObject *pyxc_xeninfo(XcObject *self)
> {
> xen_extraversion_t xen_extra;
> @@ -2294,6 +2314,13 @@ static PyMethodDef pyxc_methods[] = {
> "Returns [dict]: information about Xen"
> " [None]: on failure.\n" },
>
> + { "buildid",
> + (PyCFunction)pyxc_xenbuildid,
> + METH_NOARGS, "\n"
> + "Get Xen buildid\n"
> + "Returns [str]: Xen buildid"
> + " [None]: on failure.\n" },
> +
> { "shadow_control",
> (PyCFunction)pyxc_shadow_control,
> METH_VARARGS | METH_KEYWORDS, "\n"
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 157 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-08-20 13:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-16 12:58 [livepatch: independ. modules 1/3] livepatch: Always check hypervisor build ID upon hotpatch upload Pawel Wieczorkiewicz
2019-04-16 12:58 ` [livepatch: independ. modules 2/3] livepatch: Allow to override inter-modules buildid dependency Pawel Wieczorkiewicz
2019-08-20 13:28 ` [Xen-devel] [livepatch: independ. modules v2 " Pawel Wieczorkiewicz
2019-08-20 13:35 ` Julien Grall
2019-08-20 14:09 ` Wieczorkiewicz, Pawel
2019-08-20 14:28 ` Julien Grall
2019-08-20 14:52 ` Wieczorkiewicz, Pawel
2019-08-20 15:11 ` Julien Grall
2019-04-16 12:58 ` [livepatch: independ. modules 3/3] python: Add XC binding for Xen build ID Pawel Wieczorkiewicz
2019-08-15 9:44 ` [Xen-devel] " Pawel Wieczorkiewicz
2019-08-16 12:47 ` Wei Liu
2019-08-16 12:52 ` Wieczorkiewicz, Pawel
2019-08-19 20:40 ` Marek Marczykowski-Górecki
2019-08-20 11:04 ` Wieczorkiewicz, Pawel
2019-08-20 12:51 ` [Xen-devel] [livepatch: independ. modules v3 " Pawel Wieczorkiewicz
2019-08-20 13:00 ` Marek Marczykowski-Górecki [this message]
2019-04-23 15:47 ` [livepatch: independ. modules 1/3] livepatch: Always check hypervisor build ID upon hotpatch upload Konrad Rzeszutek Wilk
2019-04-29 9:46 ` [livepatch: independ. modules v2 " Pawel Wieczorkiewicz
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=20190820130037.GF1457@mail-itl \
--to=marmarek@invisiblethingslab.com \
--cc=amazein@amazon.de \
--cc=ian.jackson@eu.citrix.com \
--cc=mpohlack@amazon.de \
--cc=wipawel@amazon.de \
--cc=wl@xen.org \
--cc=xen-devel@lists.xen.org \
--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.