|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v11 09/17] libxl: set nic type of stub to PV instead of copying from the parent
Roger Pau Monne writes ("[PATCH v11 09/17] libxl: set nic type of stub to PV
instead of copying from the parent"):
> Introduce a new function used to copy the array of nics from the
> parent guest to the stubdomain, and set the type of the nics used to
> PV unconditianlly, or the call to setdefaults later is going to fail.
...
> +static int libxl__nics_from_hvm_guest_config(libxl__gc *gc,
> + const libxl_domain_config
> *guest_config,
> + libxl_device_nic *nic)
At the very least this parameter should be called `nics' or declared
as an array. It would be nice to document the implied array size
guest_config->num_nics.
> +{
> + const libxl_domain_build_info *b_info = &guest_config->b_info;
> + int i;
> +
> + if (b_info->type != LIBXL_DOMAIN_TYPE_HVM)
> + return ERROR_INVAL;
> +
> + for (i = 0; i < guest_config->num_nics; i++) {
> + libxl_device_nic_init(&nic[i]);
> + memcpy(&nic[i], &guest_config->nics[i], sizeof(nic[i]));
> + nic[i].nictype = LIBXL_NIC_TYPE_VIF;
> + nic[i].backend_domid = 0;
As discussed, this should not be hardcoded to 0.
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |