All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: PATCH [base vtpm and libxl patches 4/6] add iomem support to libxl
Date: Tue, 25 Sep 2012 12:57:55 -0400	[thread overview]
Message-ID: <5061E293.7000106@jhuapl.edu> (raw)
In-Reply-To: <1348569044.3452.176.camel@zakaz.uk.xensource.com>


[-- Attachment #1.1: Type: text/plain, Size: 2065 bytes --]

On 09/25/2012 06:30 AM, Ian Campbell wrote:
> On Fri, 2012-09-21 at 20:03 +0100, Matthew Fioravante wrote:
>
>> +        if ( ret<0 ){
> Tiny coding style nit, this should be
> 	if (ret < 0) { 
Will fix
>> +            LOGE(ERROR,
>> +                 "failed give dom%d access to iomem range
>> %"PRIx64"-%"PRIx64,
>> +                 domid, io->start, io->start + io->number - 1);
>> +            ret = ERROR_FAIL;
>> +        }
>> +    }
>> +
>> +
>> +
>>      for (i = 0; i < d_config->num_nics; i++) {
>>          /* We have to init the nic here, because we still haven't
>>           * called libxl_device_nic_add at this point, but qemu needs
>> @@ -1005,6 +1005,30 @@ static void parse_config_data(const char
>> *config_source,
>>          }
>>      }
>>  
>> +    if (!xlu_cfg_get_list(config, "iomem", &iomem, &num_iomem, 0)) {
>> +        b_info->num_iomem = num_iomem;
>> +        b_info->iomem = calloc(num_iomem, sizeof(*b_info->iomem));
>> +        if (b_info->iomem == NULL) {
>> +            fprintf(stderr, "unable to allocate memory for iomem\n");
>> +            exit(-1);
>> +        }
>> +        for (i = 0; i < num_iomem; i++) {
>> +            buf = xlu_cfg_get_listitem (iomem, i);
>> +            if (!buf) {
>> +                fprintf(stderr,
>> +                        "xl: Unable to get element %d in iomem list\n", i);
>> +                exit(1);
>> +            }
>> +            if(sscanf(buf, "%" SCNx64",%" SCNu64,
>> &b_info->iomem[i].start, &b_info->iomem[i].number) != 2) {
> This should be relatively simply to parse with strtoul (see the ioports
> case) which would allow people to select hex or decimal in their
> configuration files.
Do we want to support hex or decimal? Pretty much anytime people start
talking about physical memory addresses or page numbers they use hex.
Also the ioports code actually only supports hexadecimal as it sets the
base in strtoul to 16. It also explicitly says in the xl.cfg manpage
that ioports should be given in hex.
>
> Ian
>



[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 1459 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2012-09-25 16:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21 19:03 PATCH [base vtpm and libxl patches 4/6] add iomem support to libxl Matthew Fioravante
2012-09-25 10:30 ` Ian Campbell
2012-09-25 16:57   ` Matthew Fioravante [this message]
2012-09-26  8:52     ` Ian Campbell
2012-09-26 14:27       ` Matthew Fioravante
2012-09-26 16:05         ` Matthew Fioravante
2012-09-26 16:08           ` Ian Campbell
2012-09-26 16:17             ` Matthew Fioravante
2012-09-26 16:32               ` George Dunlap

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=5061E293.7000106@jhuapl.edu \
    --to=matthew.fioravante@jhuapl.edu \
    --cc=Ian.Campbell@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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.