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

Re: [Xen-devel] [PATCH v4 for 4.5 2/8] libxl: synchronise configuration when we hotplug a device



On Tue, 2014-09-16 at 11:01 +0100, Wei Liu wrote:
> We update JSON version first, then write to xenstore, so that we
> maintain the following invariant: any device which is present in
> xenstore has a corresponding entry in JSON.
> 
> The workflow is as followed:
>    lock json config
>        read json config
>        update in-memory json config with new entry, replacing
>          any stale entry
>        for loop
>            open xs transaction
>            check device existence, abort if it exists
>            write in-memory json config to disk
>            commit xs transaction
>        end for loop
>    unlock json config
> 
> Please see comment in libxl_internal.h for correctness proof.
> 
> As those routines are called both during domain creation and device
> hotplug, we add a flag to indicate whether we need to update JSON
> config. This flag is only set to true when we hotplug a device. We
> cannot update JSON config during domain creation as JSON config is
> committed to disk only when domain creation finishes.
> 
> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>



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