[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v9 3/8] tools/misc: add xen-domctx to present domain context
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@xxxxxxxxxx> > Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> > --- > Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> > Cc: Wei Liu <wl@xxxxxxx> > > 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. > +#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. > + sizeof(*(_x)), len - off); \ > + exit(1); \ Your error handling will be far more simple by using err() instead of opencoding it. ~Andrew
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |