]> xenbits.xensource.com Git - xen.git/commit
libxl: Auto-assign NIC devids in initiate_domain_create
authorStefan Bader <stefan.bader@canonical.com>
Wed, 8 Jan 2014 17:26:59 +0000 (18:26 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 9 Jan 2014 15:29:03 +0000 (15:29 +0000)
commit2d03be65d5c50053fec4a5fa1d691972e5d953c9
tree5309d8ddf6622e03bdf92757c62a23b96858f7cb
parent1a5279fa1e1407c9b8d6ae5d9b1b69f3c3b72d0b
libxl: Auto-assign NIC devids in initiate_domain_create

This will change initiate_domain_create to walk through NIC definitions
and automatically assign devids to those which have not assigned one.
The devids are needed later in domcreate_launch_dm (for HVM domains
using emulated NICs). The command string for starting the device-model
has those ids as part of its arguments.
Assignment of devids in the hotplug case is handled by libxl_device_nic_add
but that would be called too late in the startup case.
I also moved the call to libxl__device_nic_setdefault here as this seems
to be the only path leading there and avoids doing the loop a third time.
The two loops are trying to handle a case where the caller sets some devids
(not sure that should be valid) but leaves some unset.

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_create.c