[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] PATCH [base vtpm and libxl patches 4/6] add iomem support to libxl



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) { 
> +            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.

Ian


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.