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

[Xen-changelog] [xen stable-4.6] libxl: do not assume Dom0 backend while getting nic info



commit 57dbc55cd3e239ab0ce5bdd62cf309e27fe52a1a
Author:     Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
AuthorDate: Mon Sep 5 12:15:26 2016 +0200
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Mon Sep 19 16:34:06 2016 +0100

    libxl: do not assume Dom0 backend while getting nic info
    
    Fill backend_domid field based on backend path.
    
    [ Correspoding xen.git#master commit is 7539772a65b0 -iwj ]
    
    Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
    (cherry picked from commit 317eb71bc3b0830338601fb14d1f49546a1c1e35)
---
 tools/libxl/libxl.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 45d202a..18e9d4d 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -3485,6 +3485,18 @@ static int libxl__device_nic_from_xenstore(libxl__gc *gc,
     else
         nic->devid = 0;
 
+    rc = libxl__xs_read_checked(gc, XBT_NULL,
+                                GCSPRINTF("%s/backend", libxl_path), &tmp);
+    if (rc) goto out;
+
+    if (!tmp) {
+        LOG(ERROR, "nic %s does not exist (no backend path)", libxl_path);
+        rc = ERROR_FAIL;
+        goto out;
+    }
+    rc = libxl__backendpath_parse_domid(gc, tmp, &nic->backend_domid);
+    if (rc) goto out;
+
     /* nic->mtu = */
 
     tmp = READ_LIBXLDEV(gc, "mac");
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

_______________________________________________
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®.