From: Roger Pau Monné Date: Wed, 16 Feb 2022 14:52:22 +0000 (+0100) Subject: libxl: force netback to wait for hotplug execution before connecting X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~26^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=58d289c90690841def25b451d3855a187781b3ab;p=xen.git libxl: force netback to wait for hotplug execution before connecting 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 Signed-off-by: Roger Pau Monné Tested-by: James Dingwall Reviewed-by: Paul Durrant Tested-by: Julien Grall Reviewed-by: Wei Liu master commit: 0bdc43c8dec993258e930b34855853c22b917519 master date: 2022-01-27 13:51:19 +0100 --- diff --git a/tools/libs/light/libxl_nic.c b/tools/libs/light/libxl_nic.c index 0b45469dca..0b9e70c9d1 100644 --- a/tools/libs/light/libxl_nic.c +++ b/tools/libs/light/libxl_nic.c @@ -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; }