From: "Durrant, Paul" <pdurrant@amazon.co.uk>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
Paul Durrant <paul@xen.org>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>, Wei Liu <wl@xen.org>
Subject: RE: [PATCH v9 3/8] tools/misc: add xen-domctx to present domain context
Date: Mon, 5 Oct 2020 09:16:28 +0000 [thread overview]
Message-ID: <54c3b27f69314aeeaf9e5e17d1406f06@EX13D32EUC003.ant.amazon.com> (raw)
In-Reply-To: <241eda02-e7ab-a44c-8f1c-38eb85c2f8dc@citrix.com>
> -----Original Message-----
> From: Andrew Cooper <andrew.cooper3@citrix.com>
> Sent: 02 October 2020 23:40
> To: Paul Durrant <paul@xen.org>; xen-devel@lists.xenproject.org
> Cc: Durrant, Paul <pdurrant@amazon.co.uk>; Ian Jackson <ian.jackson@eu.citrix.com>; Wei Liu
> <wl@xen.org>
> Subject: RE: [EXTERNAL] [PATCH v9 3/8] tools/misc: add xen-domctx to present domain context
>
> CAUTION: This email originated from outside of the organization. Do not click links or open
> attachments unless you can confirm the sender and know the content is safe.
>
>
>
> On 24/09/2020 14:10, Paul Durrant wrote:
> > This tool is analogous to 'xen-hvmctx' which presents HVM context.
> > Subsequent patches will add 'dump' functions when new records are
> > introduced.
> >
> > Signed-off-by: Paul Durrant <pdurrant@amazon.com>
> > Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> > ---
> > Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> > Cc: Wei Liu <wl@xen.org>
> >
> > NOTE: Ian requested ack from Andrew
>
> I mean - its a fairly throwaway piece of misc userspace, so ack.
>
> However, it is largely superseded by the changes you need to make to
> verify-stream-v2 so you might want to bear that in mind.
>
> Also, I wonder if it is wise in general that we're throwing so many misc
> debugging tools into sbin.
>
The intention is to eventually replace hvm context so we'll need a parallel tool to replace xen-hvmctx, unless we want to retire it.
> > +#include <inttypes.h>
> > +#include <stdio.h>
> > +#include <stdlib.h>
> > +#include <string.h>
> > +#include <errno.h>
> > +
> > +#include <xenctrl.h>
> > +#include <xen/xen.h>
> > +#include <xen/domctl.h>
> > +#include <xen/save.h>
> > +
> > +static void *buf = NULL;
> > +static size_t len, off;
> > +
> > +#define GET_PTR(_x) \
> > + do { \
> > + if ( len - off < sizeof(*(_x)) ) \
> > + { \
> > + fprintf(stderr, \
> > + "error: need another %lu bytes, only %lu available\n", \
>
> %zu is the correct formatter for size_t.
>
True, missed that.
> > + sizeof(*(_x)), len - off); \
> > + exit(1); \
>
> Your error handling will be far more simple by using err() instead of
> opencoding it.
>
Ok.
Paul
> ~Andrew
next prev parent reply other threads:[~2020-10-05 9:16 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-24 13:10 [PATCH v9 0/8] domain context infrastructure Paul Durrant
2020-09-24 13:10 ` [PATCH v9 1/8] xen/common: introduce a new framework for save/restore of 'domain' context Paul Durrant
2020-10-02 21:20 ` Andrew Cooper
2020-10-03 14:33 ` Wei Liu
2020-10-05 8:03 ` Paul Durrant
2020-10-13 11:44 ` Jan Beulich
2020-10-02 22:00 ` Andrew Cooper
2020-09-24 13:10 ` [PATCH v9 2/8] xen/common/domctl: introduce XEN_DOMCTL_get/setdomaincontext Paul Durrant
2020-09-30 14:31 ` Wei Liu
2020-10-02 21:58 ` Andrew Cooper
2020-10-05 9:18 ` Durrant, Paul
2020-09-24 13:10 ` [PATCH v9 3/8] tools/misc: add xen-domctx to present domain context Paul Durrant
2020-09-30 14:32 ` Wei Liu
2020-10-02 22:39 ` Andrew Cooper
2020-10-05 9:16 ` Durrant, Paul [this message]
2020-09-24 13:10 ` [PATCH v9 4/8] docs/specs: add missing definitions to libxc-migration-stream Paul Durrant
2020-09-30 14:35 ` Wei Liu
2020-10-02 22:42 ` Andrew Cooper
2020-10-05 9:14 ` Durrant, Paul
2020-09-24 13:10 ` [PATCH v9 5/8] docs / tools: specific migration v4 to include DOMAIN_CONTEXT Paul Durrant
2020-09-30 14:41 ` Wei Liu
2020-10-05 10:09 ` Andrew Cooper
2020-10-05 10:13 ` Paul Durrant
2020-09-24 13:10 ` [PATCH v9 6/8] common/domain: add a domain context record for shared_info Paul Durrant
2020-09-25 12:44 ` Jan Beulich
2020-09-30 14:42 ` Wei Liu
2020-10-05 10:39 ` Andrew Cooper
2020-10-07 12:03 ` Paul Durrant
2020-10-13 11:49 ` Jan Beulich
2020-09-24 13:10 ` [PATCH v9 7/8] x86/time: add a domain context record for tsc_info Paul Durrant
2020-09-30 14:43 ` Wei Liu
2020-09-24 13:10 ` [PATCH v9 8/8] tools/libxc: add DOMAIN_CONTEXT records to the migration stream Paul Durrant
2020-09-30 14:46 ` Wei Liu
2020-10-01 15:17 ` Andrew Cooper
2020-09-24 19:36 ` [PATCH v9 0/8] domain context infrastructure Lengyel, Tamas
2020-09-25 12:49 ` Paul Durrant
2020-09-28 14:16 ` Lengyel, Tamas
2020-09-29 11:53 ` Durrant, Paul
2020-09-29 12:05 ` Tamas K Lengyel
2020-09-29 12:13 ` Durrant, Paul
2020-09-29 14:19 ` Lengyel, Tamas
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=54c3b27f69314aeeaf9e5e17d1406f06@EX13D32EUC003.ant.amazon.com \
--to=pdurrant@amazon.co.uk \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=paul@xen.org \
--cc=wl@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 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).