On 07/05/13 07:56, Choonho Son wrote:> Hi All,
>
> I have question how domain is built, so I looked at xl.c.
>
> If we run "xl create vm.cfg",
> main_create( ) function is called like;
>
> create_domain()
> `---- libxl_domain_create_new( )
> `---- do_domain_create( )
> `---- initiate_domain_create( )
> `---- lixl__domain_make( )
> `---- xc_domain_create( )
>
> following these functions, we can make one domain.
>
> but my question is how hotplug script like vif-bridge is called? It
> seems like that "main_networkattach( )" is called somewhere.
Scripts are called from libxl__device_{disk/nic}_add, in the call to
libxl__wait_device_connection libxl waits for the device backend to
reach state 2 and then it executes hotplug scripts.
The function device_hotplug in libxl_device.c takes care of most of the
work, aided by OS specific helpers (see libxl_linux.c and libxl_netbsd.c
for the OS specific implementation).