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

[xen staging-4.15] libxl: force netback to wait for hotplug execution before connecting



commit 59a5fbd6fe7a23f95e5c9bef064f9548e32feea6
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Wed Feb 16 16:02:34 2022 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Feb 16 16:02:34 2022 +0100

    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 <james-xen@xxxxxxxxxxxxxx>
    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Tested-by: James Dingwall <james-xen@xxxxxxxxxxxxxx>
    Reviewed-by: Paul Durrant <paul@xxxxxxx>
    Tested-by: Julien Grall <jgrall@xxxxxxxxxx>
    Reviewed-by: Wei Liu <wei.liu@xxxxxxxxxx>
    master commit: 0bdc43c8dec993258e930b34855853c22b917519
    master date: 2022-01-27 13:51:19 +0100
---
 tools/libs/light/libxl_nic.c | 7 +++++++
 1 file changed, 7 insertions(+)

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;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.