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

[Xen-changelog] [xen master] libxl: fix printing hotplug arguments/environment



commit 25131cea72bfe8ce25cadc689df34e7e8b1596f9
Author:     Roger Pau Monne <roger.pau@xxxxxxxxxx>
AuthorDate: Tue Aug 2 12:49:51 2016 +0200
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Tue Aug 2 17:03:10 2016 +0100

    libxl: fix printing hotplug arguments/environment
    
    An OS could decide to not pass any environment variables to hotplug scripts,
    and this will trigger a bug in device_hotplug logic, since it expects the
    environment array to exist. Allow env to be NULL.
    
    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/libxl/libxl_device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index b9a6df2..dbf157d 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -1130,6 +1130,7 @@ static void device_hotplug(libxl__egc *egc, 
libxl__ao_device *aodev)
         goto out;
     }
 
+    assert(args != NULL);
     LOG(DEBUG, "calling hotplug script: %s %s", args[0], args[1]);
     LOG(DEBUG, "extra args:");
     {
@@ -1140,7 +1141,7 @@ static void device_hotplug(libxl__egc *egc, 
libxl__ao_device *aodev)
             LOG(DEBUG, "\t%s", arg);
     }
     LOG(DEBUG, "env:");
-    {
+    if (env != NULL) {
         const char *k, *v;
         unsigned int x;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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