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

Re: [Xen-devel] [PATCH 09/13] libxl: convert libxl_device_nic_add to an async operation



Roger Pau Monne writes ("Re: [PATCH 09/13] libxl: convert libxl_device_nic_add 
to an async operation"):
> Ian Jackson wrote:
> > Why do you serialise vif and vbd initialisation ?  Would anything go
> > wrong if you did them both at once ?
> 
> disk needs to be added before Qemu is launched, on the other hand nics 
> need to be added after qemu is launched, so we need to add them at 
> different moments during the domain creation, it's a PITA.

Ah I didn't spot that.  Right.

> >>       for (i = 0; i<  dm_config->num_vifs; i++) {
> >> -        ret = libxl_device_nic_add(ctx, dm_domid,&dm_config->vifs[i]);
> >> -        if (ret)
> >> -            goto out;
> >> +        /* We have to init the nic here, because we still haven't
> >> +         * called libxl_device_nic_add at this point, but qemu needs
> >> +         * the nic information to be complete.
> >> +         */
> >> +        libxl__device_nic_setdefault(gc,&dm_config->vifs[i]);
> >
> > This is really too much repetition now.  Can we not have a common "add
> > devices" function which is called once for the main domain and once
> > for the stubdom ?
> 
> I've added a functions that does the libxl_device_disk_add loop, and 
> another one for the nics. Although this line you are quoting is not 
> adding a nic, it is just filling the needed values so we can launch Qemu 
> correctly.

Right, OK.  I guess making these two functions common would involve
macros or a lot of void*'s, which you would rather avoid.

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®.