|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC 19/19] xl: Add new option dtdev
On Wed, Jun 18, 2014 at 02:40:37PM +0100, Julien Grall wrote:
> Hi Wei,
>
> On 06/16/2014 06:19 PM, Wei Liu wrote:
> > On Mon, Jun 16, 2014 at 05:18:06PM +0100, Julien Grall wrote:
> > [...]
> >> + if (!xlu_cfg_get_list (config, "dtdev", &dtdevs, 0, 0)) {
> >> + d_config->num_dtdevs = 0;
> >> + d_config->dtdevs = NULL;
> >> + for (i = 0; (buf = xlu_cfg_get_listitem(dtdevs, i)) != NULL; i++)
> >> {
> >> + libxl_device_dt *dtdev;
> >> +
> >> + d_config->dtdevs = (libxl_device_dt *)
> >> realloc(d_config->dtdevs, sizeof (libxl_device_dt) * (d_config->num_dtdevs
> >> + 1));
> >> + dtdev = d_config->dtdevs + d_config->num_dtdevs;
> >> + libxl_device_dt_init(dtdev);
> >> +
> >
> > There's a macro called ARRAY_EXTEND_INIT, you can probably use that.
>
> I can't use this macro because it requires to have a field devid in the
> structure.
Ah, OK.
In that case, you need to use xrealloc in your code.
>
> I don't think it worth to add this field just for code conciseness.
> Though I can add rename this macro into ARRAY_EXTEND_INIT_DEVID and
> introduce an ARRAY_EXTEND_INIT that could be use in more general case.
>
No need to do that in my opinion.
Wei.
> Regards,
>
> --
> Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |