xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH 2/2] tools/misc: add xen-wallclock command
Date: Mon, 15 Oct 2012 13:25:10 +0100	[thread overview]
Message-ID: <507C00A6.3020001@citrix.com> (raw)
In-Reply-To: <1350293719.18058.13.camel@zakaz.uk.xensource.com>

On 15/10/12 10:35, Ian Campbell wrote:
> On Fri, 2012-10-12 at 14:02 +0100, David Vrabel wrote:
>> +int main(int argc, char *argv[])
>> +{
>> +    const static char sopts[] = "w";
>> +    const static struct option lopts[] = {
>> +        { "help", 0, NULL, 0 },
>> +        { "systowc", 0, NULL, 'w' },
>> +        { 0, 0, NULL, 0 },
>> +    };
>> +    int opt, opt_idx;
>> +
>> +    int systowc = 0;
>> +    xc_interface *xch;
>> +
>> +    exe_name = argv[0];
>> +
>> +    while ( (opt = getopt_long(argc, argv, sopts, lopts, &opt_idx)) != -1 )
>> +    {
>> +        switch ( opt )
>> +        {
>> +        case 'w':
>> +            systowc = 1;
>> +            break;
>> +        case 0:
>> +            switch (opt_idx)
>> +            {
>> +            case 0:
>> +                help();
>> +            }
>> +            break;
>> +        default:
>> +            usage(stderr);
>> +            exit(1);
>> +        }
>> +    }
>> +
>> +    /* Valid combination of options? i.e., --systowc */
>> +    if (!systowc)
>> +    {
>> +        usage(stderr);
>> +        exit(1);
>> +    }
>> +
>> +    xch = xc_interface_open(NULL, NULL, 0);
>> +    if (xch == NULL)
>> +    {
> 
> I forget: Does xc_interface_open log on error?

Yes.

>> +        exit(1);
>> +    }
>> +    xc_wallclock_sync(xch);
> 
> Worth logging if this fails?

Yes.

> I suppose we want to hold off on this and the first patch until the
> Linux side is agreed and committed?

Yes.

>> +    xc_interface_close(xch);
>> +
>> +    return 0;
>> +}

David

      reply	other threads:[~2012-10-15 12:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12 13:02 [PATCH 0/2] tools: add wallclock synchronization David Vrabel
2012-10-12 13:02 ` [PATCH 1/2] libxc: add xc_wallclock_sync() David Vrabel
2012-10-12 13:02 ` [PATCH 2/2] tools/misc: add xen-wallclock command David Vrabel
2012-10-15  9:35   ` Ian Campbell
2012-10-15 12:25     ` David Vrabel [this message]

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=507C00A6.3020001@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=xen-devel@lists.xen.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).