Skip to content

Commit

Permalink
libxl: force netback to wait for hotplug execution before connecting
Browse files Browse the repository at this point in the history
By writing an empty "hotplug-status" xenstore node in the backend path
libxl can force Linux netback to wait for hotplug script execution
before proceeding to the 'connected' state.

This is required so that netback doesn't skip state 2 (InitWait) and
thus blocks libxl waiting for such state in order to launch the
hotplug script (see libxl__wait_device_connection).

Reported-by: James Dingwall <[email protected]>
Signed-off-by: Roger Pau Monné <[email protected]>
Tested-by: James Dingwall <[email protected]>
Reviewed-by: Paul Durrant <[email protected]>
Tested-by: Julien Grall <[email protected]>
Reviewed-by: Wei Liu <[email protected]>
master commit: 0bdc43c
master date: 2022-01-27 13:51:19 +0100
  • Loading branch information
royger authored and jbeulich committed Feb 16, 2022
1 parent 11eedbb commit 59a5fbd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/libs/light/libxl_nic.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,13 @@ static int libxl__set_xenstore_nic(libxl__gc *gc, uint32_t domid,
flexarray_append(ro_front, "mtu");
flexarray_append(ro_front, GCSPRINTF("%u", nic->mtu));

/*
* Force backend to wait for hotplug script execution before switching to
* connected state.
*/
flexarray_append(back, "hotplug-status");
flexarray_append(back, "");

return 0;
}

Expand Down

0 comments on commit 59a5fbd

Please sign in to comment.